{"answers":{"affected":"2 open source packages ship an affected version, including @grackle-ai/server.","exploited":"There is no known exploitation of GHSA-w3hv-x4fp-6h6j in the wild and no public exploit code.","fix":"Upgrade @grackle-ai/server to 0.70.3 or later.","what":"GHSA-w3hv-x4fp-6h6j is a vulnerability in @grackle-ai/server, published on 25 Mar 2026. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for GHSA-w3hv-x4fp-6h6j and fix it if it is affected.\n\nWhat it is: GHSA-w3hv-x4fp-6h6j is a vulnerability in @grackle-ai/server, published on 25 Mar 2026. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.\nExploitation: There is no known exploitation of GHSA-w3hv-x4fp-6h6j in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- @grackle-ai/server (npm): affected all versions; fixed in 0.70.3\n- @grackle-ai/server (npm): affected all versions; fixed in 0.70.3\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/GHSA-w3hv-x4fp-6h6j/ (Markdown: https://insights.sbomify.com/GHSA-w3hv-x4fp-6h6j/index.md)","id":"GHSA-w3hv-x4fp-6h6j","markdown":"https://insights.sbomify.com/GHSA-w3hv-x4fp-6h6j/index.md","name":"GHSA-w3hv-x4fp-6h6j","record":{"aliases":[],"analysis":{"component_type":"server_software","fix_type":"patch","impacts":["data_read"],"network_reachable":"adjacent_or_local","non_default_config":false,"product_category":"Grackle AI server","requires_auth":"low_privilege","summary":"Attackers can hijack WebSocket connections to read real-time session data if a user visits a malicious site while logged in.","user_interaction":"required","vuln_class":"csrf"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"### 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 \u0026\u0026 !origin.includes(\"localhost\") \u0026\u0026 !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`","ecosystems":["npm"],"exploits":{"exploitdb":null,"first_seen":null,"github_poc":null,"max_poc_stars":null,"metasploit":null,"nuclei":null,"refs":[],"tier":null},"has_fix":true,"headline":"@grackle-ai/server has Missing WebSocket Origin Header Validation","id":"GHSA-w3hv-x4fp-6h6j","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"npm","product":null,"products":[],"type":"csrf","year":"2026"},"n_packages":2,"n_references":null,"packages":[{"ecosystem":"npm","fixed":["0.70.3"],"introduced":["0"],"last_affected":[],"package":"@grackle-ai/server","purl":null,"source":"GHSA-w3hv-x4fp-6h6j"},{"ecosystem":"npm","fixed":["0.70.3"],"introduced":["0"],"last_affected":[],"package":"@grackle-ai/server","purl":"pkg:npm/%40grackle-ai/server","source":"GHSA-w3hv-x4fp-6h6j"}],"products":null,"published":"2026-03-25","related":[],"sources":[{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":"Attackers can hijack WebSocket connections to read real-time session data if a user visits a malicious site while logged in.","url":"https://insights.sbomify.com/GHSA-w3hv-x4fp-6h6j/"}