/

CVE-2026-40289

Severity:

CRITICAL RISK

(9.1)

Missing Authentication / Broken Session Enforcement

CVE-2026-40289

Analyzed

Vulnerability type

Category:

Missing Authentication / Broken Session Enforcement

CWE:

CWE-306

Impact:

Unauthenticated Remote Session Hijacking and Unauthorized Browser Automation Control

Severity:

CRITICAL RISK

(9.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

PraisonAI's browser bridge WebSocket endpoint (/ws) lacks proper authentication and relies on a bypassable Origin check, allowing unauthenticated network clients to attach to active browser automation sessions.

When the bridge is network-accessible, an attacker can start or hijack sessions, drive browser automation remotely, and receive all resulting actions and outputs from affected browser-extension sessions.

Affected context

This vulnerability affects deployments of PraisonAI and praisonaiagents that:

  • Run the browser bridge (via praisonai browser start) with the WebSocket server bound to 0.0.0.0 or otherwise network-accessible.
  • Depend on implicit trust of WebSocket clients rather than enforcing explicit authentication or robust origin validation.
  • Have browser extensions or browser automation agents connected and idle, waiting for work from the bridge.

In such environments, any host with network path to the bridge can potentially initiate or hijack sessions without user interaction or credentials.

Exploit preconditions

  • Attack surface: The /ws WebSocket endpoint exposed by the PraisonAI browser bridge.
  • Required access: Network-level reachability to the host/port where the bridge is listening (commonly bound to 0.0.0.0 by default).
  • Required authentication/credentials: None; the endpoint accepts unauthenticated connections.
  • Trigger point: Attacker establishes a WebSocket connection, omits the Origin header (or bypasses weak checks), and sends a start_session message.
  • Why exploitation is possible:
  • The server does not enforce any authentication or session-level authorization for clients.
  • Origin validation is applied only when an Origin header is present and can be bypassed by non-browser clients that simply omit it.
  • The bridge automatically assigns the attacker's connection to the first idle browser-extension WebSocket and then forwards all actions and outputs to the attacker without additional checks.

Why this happens

The core issue is a missing authentication and authorization layer on a network-exposed WebSocket control channel, aligning with CWE-306: Missing Authentication for Critical Function.

The browser bridge implements a control-plane API where incoming WebSocket connections can request start_session and thereby control existing browser-extension sessions. However:

  • There is no requirement for client identity verification (e.g., tokens, API keys, or session cookies) before accepting commands.
  • The only gate is a best-effort Origin header check, which is inherently unreliable for non-browser clients and is skipped entirely when the header is absent.
  • Session routing logic assigns the first idle browser-extension connection to any accepted client without verifying that the client is authorized to control it.

Abstractly, this is an insecure pattern where a privileged backend automation endpoint trusts any reachable client on the network, exposing critical capabilities without strong authentication or context-aware session binding.

Potential impact

  • Remote hijacking of idle browser automation sessions by unauthenticated network attackers.
  • Unauthorized execution of browser automation tasks, including navigation, form submission, and interaction with authenticated web applications loaded in the controlled browser.
  • Leakage of sensitive browser context such as page contents, DOM data, cookies (if exposed via automation), and automation logs or model outputs.
  • Misuse of model-backed automation capabilities to perform unwanted actions (e.g., data exfiltration, account manipulation, or reconnaissance within internal web apps).
  • Abuse of connected infrastructure and credentials to pivot into internal applications accessible only from the automated browser's environment.
  • Erosion of auditability and accountability, as malicious actions appear to originate from legitimate browser agents.

General mitigation guidance

Mitigation typically focuses on enforcing strong authentication and minimizing network exposure for control-plane WebSocket endpoints:

  • Introduce explicit authentication on the WebSocket endpoint:
  • Require a time-bound, unguessable credential (API key, bearer token, or session-bound secret) before accepting control messages such as start_session.
  • Tie WebSocket connections to user identities or trusted services, not anonymous clients.
  • Harden origin and client validation:
  • Treat Origin checks as a defense-in-depth mechanism, not the sole control.
  • Enforce consistent validation regardless of client type; do not accept unauthenticated clients that omit headers normally set by browsers.
  • Constrain network exposure:
  • Bind the browser bridge to loopback or a dedicated internal interface by default where possible.
  • Use firewall rules, container networking policies, or reverse proxies to limit reachable sources to trusted networks or hosts.
  • Implement authorization-aware session routing:
  • Associate browser-extension sessions with specific principals or scopes.
  • Only route a session to a client that can present proof-of-authorization for that session or workspace.
  • Apply least privilege and observability:
  • Limit what browser automation can access (e.g., internal sites, high-privilege accounts) and prefer separate profiles for sensitive tasks.
  • Add logging and alerts for unexpected or anomalous connections to the WebSocket bridge.

How teams detect issues like this

Detection efforts can combine configuration review, code analysis, and runtime monitoring:

  • Static and code-level analysis:
  • Search for WebSocket endpoints that:
  • Bind to 0.0.0.0 or otherwise accept external traffic.
  • Accept control messages (e.g., session start/attach) without checking authentication or authorization state.
  • Rely primarily on the Origin header for trust decisions, especially where the absence of Origin is treated as acceptable.
  • Use static analysis or linting rules to flag network listeners that do not integrate with the standard authentication middleware used elsewhere in the system.
  • Configuration and architecture review:
  • Review deployment manifests, Docker configurations, and container orchestration settings for browser bridge services that are exposed beyond localhost.
  • Verify that any reverse proxy or API gateway in front of the bridge enforces authentication for /ws.
  • Runtime and network monitoring:
  • Instrument logging to capture:
  • All WebSocket connection attempts to /ws, including remote IPs, headers, and session routing decisions.
  • Anonymous connections initiating start_session or equivalent control messages.
  • Use IDS/IPS or network telemetry to alert on suspicious or unexpected WebSocket traffic to the bridge from untrusted networks.
  • Automated security testing:
  • Incorporate API-level security testing or DAST to probe WebSocket endpoints for missing authentication and weak origin handling.

Sources

SourceLink
github.comgithub.com/MervinPraison/PraisonAI/security/advisories/GHSA-8x8f-54wf-vv92

Frequently asked

questions

It can be, but only if the PraisonAI browser bridge is exposed beyond trusted networks. If the /ws endpoint is bound to 0.0.0.0 and reachable from the internet without an upstream access control layer, an external attacker could connect and hijack sessions. In more locked-down environments, the risk is limited to whoever has network access to the host or internal segment where the bridge runs.

No credentials are required. The attack can be performed by any WebSocket-capable client library as long as it can reach the bridge endpoint. Because the server only checks the Origin header when present, a non-browser client that omits Origin is accepted without authentication, enabling unauthenticated control.

The most robust pattern is to treat the WebSocket bridge as a privileged API and require explicit, verifiable authentication and authorization on every connection. This typically means integrating the WebSocket handshake with the same auth mechanisms used for HTTP (tokens, sessions, or mutual TLS) and enforcing that only authenticated, authorized principals can start or attach to browser sessions. Origin checks should be retained as an additional layer, not a primary control.

When designing real-time control channels such as WebSockets:

  • Assume any network-exposed endpoint may be reached by untrusted clients.
  • Apply a consistent authentication and authorization model across HTTP and WebSocket surfaces.
  • Avoid relying solely on browser-specific headers (like Origin) for access control, especially when non-browser clients are possible.
  • Prefer secure-by-default bindings (e.g., localhost-only for local tools) and require explicit configuration to expose services more broadly.
  • Incorporate security reviews, threat modeling, and automated checks focusing on control-plane endpoints that can drive high-privilege actions.
Find out what's already
exploitable in your codebase.