High

@grackle-ai/server has Missing WebSocket Origin Header Validation

  • Disclosed: 25.03.2026
  • Updated: 11.10.2026 10:22

Impact

The 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).

This 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).

Affected code:

  • packages/server/src/ws-bridge.ts:80-91 — connection handler accepts WebSocket upgrades without checking req.headers.origin

Patches

Fix: Validate req.headers.origin against an allowlist before accepting connections:

ts
const origin = req.headers.origin || "";
if (origin && !origin.includes("localhost") && !origin.includes("127.0.0.1")) {
  ws.close(4003, "Invalid origin");
  return;
}

Workarounds

Ensure the Grackle server is only accessible on 127.0.0.1 (the default). Do not use --allow-network in untrusted network environments.

Resources

  • CWE-346: Origin Validation Error
  • File: packages/server/src/ws-bridge.ts

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
npm package @grackle-ai/server < 0.70.3 0.70.3

References

CVSS score -
CVSS vector
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
Weakness (CWE)
CWE-346
Platform
npm
Package
@grackle-ai/server
Disclosed
25.03.2026
Updated
11.10.2026 10:22

Sources and licenses

OSV / GitHub Advisory Database - GHSA-w3hv-x4fp-6h6j - CC BY 4.0

Vulnerability history: @grackle-ai/server

All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.

Total entries
5
First → latest
03.2026 03.2026
Without a fix
0
Exploited in attacks
0

Severity breakdown

  • High 1
  • Medium 1
  • Low 3

Disclosures per year

  1. 2026: 5
  1. Low ghsa-5j35-xr4g-vwf4 < 0.70.5 0.70.5
  2. @grackle-ai/server has Missing WebSocket Origin Header Validation this entry
    High ghsa-w3hv-x4fp-6h6j < 0.70.3 0.70.3

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.