GHSA-w3hv-x4fp-6h6j: @grackle ai/server @grackle-ai/server Has Missing WebSocket Origin Vulnerability
HIGHGHSA-w3hv-x4fp-6h6j is a HIGH @grackle-ai/server has missing websocket origin vulnerability (CWE-346: Origin Validation Error) affecting @grackle ai/server libraries in the npm ecosystem. The issue involves @grackle-ai/server has missing websocket origin header validation. Remediation is available by upgrading affected packages to version 0.70.3.
GHSA-w3hv-x4fp-6h6j at a Glance
How to Fix GHSA-w3hv-x4fp-6h6j
To remediate this vulnerability, upgrade all affected @grackle ai/server dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install @grackle-ai/server@0.70.3
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls @grackle-ai/server
How to Check if You Are Affected
To determine whether your Node.js application is affected by GHSA-w3hv-x4fp-6h6j, inspect your project dependencies using npm:
npm ls @grackle-ai/server
Analyze the terminal output to locate any version of @grackle ai/server in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.70.3), your application is affected.
Note: The npm ls @grackle-ai/server command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-346: Origin Validation Error, where the product does not properly verify that the source of data or communication is valid. In @grackle ai/server, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
GHSA-w3hv-x4fp-6h6j Affected @grackle ai/server Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
@grackle-ai/server
|
npm |
< 0.70.3
|
0.70.3
|
References
Frequently Asked Questions
What is GHSA-w3hv-x4fp-6h6j?
Which @grackle ai/server versions are affected?
What version fixes GHSA-w3hv-x4fp-6h6j?
Is @grackle-ai/server affected?
What CWE is associated with GHSA-w3hv-x4fp-6h6j?
How can I check npm dependencies for GHSA-w3hv-x4fp-6h6j?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-w3hv-x4fp-6h6j",
"modified" : "2026-03-25T17:28:05Z",
"published" : "2026-03-25T17:27:48Z",
"aliases" : [ ],
"summary" : "@grackle-ai/server has Missing WebSocket Origin Header Validation",
"details" : "### Impact\n\nThe WebSocket upgrade handler in the server validates authentication (API key token or session cookie) but does not check the `Origin` header. A malicious webpage on a different origin could initiate a WebSocket connection to `ws://localhost:3000/ws` if it can leverage the user's session cookie (which is `SameSite=Lax`, allowing top-level navigations).\n\nThis enables **cross-origin WebSocket hijacking** — if a user visits a malicious site while a Grackle session is active, the attacker's page could open a WebSocket and subscribe to real-time events (session output, task updates, environment state).\n\n**Affected code:**\n- `packages/server/src/ws-bridge.ts:80-91` — connection handler accepts WebSocket upgrades without checking `req.headers.origin`\n\n### Patches\n\n**Fix:** Validate `req.headers.origin` against an allowlist before accepting connections:\n```typescript\nconst origin = req.headers.origin || \"\";\nif (origin && !origin.includes(\"localhost\") && !origin.includes(\"127.0.0.1\")) {\n ws.close(4003, \"Invalid origin\");\n return;\n}\n```\n\n### Workarounds\n\nEnsure the Grackle server is only accessible on `127.0.0.1` (the default). Do not use `--allow-network` in untrusted network environments.\n\n### Resources\n\n- CWE-346: Origin Validation Error\n- File: `packages/server/src/ws-bridge.ts`",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "@grackle-ai/server"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.70.3"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 0.70.2"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/nick-pape/grackle/security/advisories/GHSA-w3hv-x4fp-6h6j"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/nick-pape/grackle"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-346" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-03-25T17:27:48Z",
"nvd_published_at" : null
}
}