Summary
PraisonAI's Browser Server insufficiently validates Chrome extension origins before accepting WebSocket connections. An attacker who can reach the browser server and supply a crafted origin may start sessions and perform unauthorized browser automation.
Affected context
The issue occurs in PraisonAI deployments using the Browser Server and its WebSocket connection handler. It becomes risky when the server is reachable by an untrusted client and relies on a regular expression to authorize Chrome extension origins without requiring the entire origin value to match.
Exploit preconditions
- Attack surface: Browser Server WebSocket endpoint - Required access: Network reachability to the endpoint and the ability to
submit a connection origin
- Trigger point: Origin validation before WebSocket acceptance - Why exploitation is possible: The validation uses an unanchored regular
expression, so an origin with a valid-looking prefix and additional
trailing content may pass the authorization check
Why this happens
The underlying bug is an incomplete authorization decision based on partial regular-expression matching. Using a matching operation that does not require the complete origin to conform to the expected format allows attacker- controlled suffixes to bypass the intended trust boundary. This maps primarily to CWE-284, Improper Access Control, with CWE-625 reflecting the improper restriction of regular-expression matching.
Potential impact
- An attacker may establish an unauthorized browser session
- An attacker could invoke browser automation commands
- Sensitive information displayed in the automated browser may be exposed
- The application may perform actions with the browser's available privileges
- Connected systems could be affected through authenticated browser sessions
General mitigation guidance
Mitigation generally focuses on making origin authorization exact, explicit, and fail-closed. Secure-by-default patterns include validating the complete origin against an allowlist or structured origin parser, rejecting unexpected suffixes and malformed values, and avoiding trust decisions based solely on loosely constrained regular expressions. Organizations may also reduce input trust by enforcing server-side session authorization, isolate browser automation from sensitive accounts, and run browser workers with the minimum network and operating-system privileges required.
How teams detect issues like this
Detection approaches include static analysis and code review searches for partial regular-expression matching in authorization or origin checks, especially uses of re.match() without an end-of-input constraint. Reviewers can inspect WebSocket handlers for origin validation performed before acceptance and verify that authorization is based on an exact allowlist. Runtime tests and policy checks can exercise malformed, suffixed, and unexpected origin values and confirm that they are rejected. Automated security review tools may help identify these patterns in application code.

