CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-71416

CVE-2026-71416: Cross-Site WebSocket Hijacking in Headroom Proxy Server

Amit Schendel
Amit Schendel
Senior Security Researcher

Oct 3, 2026·6 min read·11 visits

Executive Summary (TL;DR)

Headroom proxy prior to v0.35.0 fails to validate the Origin header during WebSocket handshakes, allowing malicious websites to hijack connections, abuse ambient API credentials, and execute arbitrary commands.

A critical cross-site WebSocket hijacking (CSWSH) vulnerability in headroomlabs-ai/headroom prior to version 0.35.0 allows unauthorized external origins to establish connection channels to the Headroom proxy, enabling arbitrary prompt execution and remote code execution through local tool integration.

Vulnerability Overview

The Headroom proxy server, developed by headroomlabs-ai, operates as an intermediary for Large Language Model (LLM) communications. The server compresses request payloads before they reach the upstream LLM providers to reduce processing latency and operational costs. The application exposes an interactive WebSocket endpoint at /v1/responses to facilitate real-time streaming operations between client endpoints and LLM backends.

Prior to version 0.35.0, the WebSocket upgrade handler for the /v1/responses route accepted incoming connection handshakes without performing validation on the HTTP Origin header. Because web browsers do not restrict cross-origin WebSocket connections under the Same-Origin Policy (SOP), any third-party website loaded in a user's browser can initiate a direct connection to a local or internal Headroom proxy on the user's behalf.

This flaw represents a severe weakness matching CWE-1385 (Missing Origin Validation in WebSockets) and CWE-287 (Improper Authentication). If the target proxy runs with ambient authentication credentials—such as the OPENAI_API_KEY stored in server-side environment variables—the incoming hijacked WebSocket session inherits those credentials automatically. This allows unauthorized third-party origins to query upstream models and run local tool suites.

Root Cause Analysis

The core technical flaw exists within the WebSocket handshake negotiation implementation. In a standard HTTP application, the browser maintains strict logical boundaries between origins via the Same-Origin Policy (SOP). However, WebSocket connections are explicitly excluded from SOP protections at the browser layer, allowing web scripts to construct connection tunnels to arbitrary targets across different domains.

To compensate for this open transport model, the WebSocket protocol specification requires browsers to append an Origin header to the initial HTTP upgrade handshake request. Target servers are responsible for reading this header and verifying that the requesting origin matches an explicit allowlist. If the server fails to inspect the Origin header during handshake processing, it remains vulnerable to Cross-Site WebSocket Hijacking (CSWSH).

In vulnerable deployments of the Headroom proxy, the FastAPI/ASGI handler accepting connections at /v1/responses accepted the upgrade handshake unconditionally. Once the handshake succeeded, the connection was elevated to a persistent TCP-based WebSocket stream. If the incoming request did not include explicit client authorization tokens, the backend automatically fell back to the administrative server-side OPENAI_API_KEY environment variable, effectively authenticating the hijacked session without client interaction.

Code Analysis

The remediation commit c632023cc1ec61d15f8f8e86efe3b54d51604a64 introduces origin verification checks prior to the establishment of the WebSocket session. Below is an analysis of the validation sequence implemented within headroom/proxy/handlers/openai.py to prevent unauthorized cross-origin connections:

def _is_allowed_websocket_origin(headers: dict[str, str]) -> bool:
    # Native clients (like curl, CLI tools) commonly omit Origin headers. This absence is allowed.
    origin = _header_get(headers, "origin")
    if not origin:
        return True
 
    allowed_origins = _allowed_ws_origins_from_env()
    if allowed_origins is None:
        # Fallback to loopback validation if no custom origins are configured
        return _is_loopback_ws_origin(origin)
    if "*" in allowed_origins:
        return True
 
    normalized_origin = _normalize_origin(origin)
    if normalized_origin is None:
        return False
 
    normalized_allowed = {
        normalized
        for allowed in allowed_origins
        for normalized in (_normalize_origin(allowed),)
        if normalized is not None
    }
    return normalized_origin in normalized_allowed

During the execution of handle_openai_responses_ws, the server retrieves the headers from the initial handshake. If the origin validation fails, the proxy generates an explicit warning log and closes the websocket session immediately using WebSocket close code 1008 (Policy Violation), halting downstream processing.

if not _is_allowed_websocket_origin(ws_headers):
    logger.warning(
        "event=websocket_origin_not_allowed request_id=%s session_id=%s path=%s origin=%r",
        request_id,
        session_id,
        _ws_path,
        _header_get(ws_headers, "origin"),
    )
    await websocket.close(code=1008, reason="origin not allowed")
    return

Exploitation Methodology

Exploitation of this vulnerability requires three prerequisites. First, the victim must run the vulnerable Headroom proxy locally or within a reachable private subnet. Second, the proxy must hold active API credentials. Third, the victim must navigate to an attacker-controlled web page.

The attacker-controlled webpage hosts a background JavaScript payload designed to connect to the local Headroom proxy loopback address. When the victim accesses this webpage, the browser executes the script and initiates a connection upgrade request to ws://localhost:8787/v1/responses on the local machine.

Because the browser automatically appends the actual site origin to the connection request, the request headers contain Origin: https://attacker.com. Since the vulnerable proxy lacks verification controls, it completes the handshake. The attacker script can then send formatted JSON commands down the open channel to trigger model operations, exploit local command-execution integrations, or extract sensitive query histories.

Impact Assessment

The impact of a successful CSWSH exploit on the Headroom proxy is classified as High. Because the proxy processes system commands and connects directly to critical corporate development infrastructure, a hijacked connection bypasses perimeter security protections.

An attacker who establishes a WebSocket channel can issue commands to any connected agent tooling. If the Headroom agent has access to system shells or file-system utilities, the attacker can execute arbitrary commands directly on the host computer running the proxy. This effectively turns a cross-site scripting/phishing vector into an unauthenticated remote code execution exploit.

Additionally, the unauthorized use of LLM credits presents financial and availability concerns. Attackers can execute batch requests to exhaust API quotas or harvest conversation logs containing confidential internal code, proprietary schemas, and access tokens stored in past prompt outputs.

Remediation and Mitigation

The primary resolution is to upgrade all Headroom proxy installations to version v0.35.0 or higher. This version implements strict Origin header checking and rejects non-loopback connections by default unless an explicit configuration override is provided.

For deployments where immediate upgrading is not possible, administrators should bound the proxy listening socket strictly to the loopback interface (127.0.0.1 or ::1) instead of all interfaces (0.0.0.0). This restricts access from other systems on the network and reduces the attack surface.

If cross-origin access is required, define specific allowed origins using the HEADROOM_WS_ORIGINS or HEADROOM_CORS_ORIGINS environment variables. Avoid using wildcards (*) in production configurations, as wildcards restore the vulnerable state by disabling origin matching logic.

Fix Analysis (1)

Technical Appendix

CVSS Score
8.8/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
EPSS Probability
0.22%
Top 89% most exploited

Affected Systems

headroomlabs-ai/headroom

Affected Versions Detail

Product
Affected Versions
Fixed Version
headroom
headroomlabs-ai
< 0.35.0v0.35.0
AttributeDetail
CWE IDCWE-1385 (Missing Origin Validation in WebSockets)
Attack VectorNetwork (Requires User Interaction)
CVSS v3.1 Score8.8
EPSS Score0.00219 (Percentile: 11.24%)
Exploit StatusProof of Concept (PoC) available
CISA KEV StatusNot Listed

MITRE ATT&CK Mapping

T1190Exploit Public-Facing Application
Initial Access
T1078Valid Accounts
Initial Access
CWE-1385
Missing Origin Validation in WebSockets

The application does not validate the Origin header during the WebSocket handshake, allowing cross-site WebSocket hijacking.

Vulnerability Timeline

Official patch commit c632023cc1ec61d15f8f8e86efe3b54d51604a64 pushed to main repository.
2026-06-27
GitHub Security Advisory published (GHSA-h46j-26q3-rggf).
2026-09-11
CVE-2026-71416 officially assigned and registered.
2026-09-11
Headroom version v0.35.0 released containing fixes.
2026-09-11
National Vulnerability Database (NVD) record updated with metrics.
2026-09-30

References & Sources

  • [1]GitHub Security Advisory GHSA-h46j-26q3-rggf
  • [2]Fix Commit c632023cc1ec61d15f8f8e86efe3b54d51604a64
  • [3]Headroom Release v0.35.0
  • [4]NVD - CVE-2026-71416 Details

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•1 day ago•CVE-2026-107844
5.3

CVE-2026-107844: Path Traversal Vulnerability in Contao ImagesController

A path traversal vulnerability (CWE-22) in Contao CMS allows unauthenticated remote attackers to bypass directory boundary restrictions in ImagesController and access files within the project directory.

Amit Schendel
Amit Schendel
8 views•5 min read
•1 day ago•CVE-2026-107848
3.5

CVE-2026-107848: Cross-Site Request Forgery (CSRF) in Contao Backend Actions via GET Requests

Contao Open Source CMS versions 4.0.0 through 5.3.49 and 5.4.0-RC1 through 5.7.11 contain a Cross-Site Request Forgery (CSRF) vulnerability in backend parameter handling. The `RequestTokenListener` component validates anti-CSRF tokens solely for HTTP POST requests, while GET-based declarative guards run only when an `act` parameter is present in the query string. Consequently, custom backend actions dispatched via alternative parameters such as `key=` can execute without CSRF token verification when triggered by an authenticated user.

Amit Schendel
Amit Schendel
7 views•5 min read
•1 day ago•CVE-2026-107843
5.3

CVE-2026-107843: Unthrottled Activation Email Resend and Account Enumeration in Contao CMS

Contao CMS versions 4.1.0 through 5.3.49 and 5.4.0-RC1 through 5.7.11 fail to validate form submission tokens and enforce rate limiting when processing activation email resend requests via HTTP POST, enabling resource exhaustion and account state enumeration.

Amit Schendel
Amit Schendel
8 views•4 min read
•1 day ago•CVE-2026-107842
5.3

CVE-2026-107842: Information Disclosure via Stale Indexing in Contao Search Module

An information disclosure vulnerability in Contao CMS allows unauthenticated site visitors to view protected page titles, URLs, and text excerpts through search queries when protected page indexing is disabled after previously being enabled.

Amit Schendel
Amit Schendel
10 views•4 min read
•1 day ago•GHSA-G38J-7V97-X298
6.5

GHSA-G38J-7V97-X298: Missing Authorization Check in Vikunja CalDAV Task Relation Creation

In Vikunja prior to version 2.6.0, relation creation via the CalDAV endpoint fails to invoke the TaskRelation.CanCreate authorization check. This missing access control allows an authenticated user to establish unauthorized relationships and perform write operations against any task, provided its unique identifier (UID) is known.

Alon Barad
Alon Barad
12 views•5 min read
•1 day ago•GHSA-3HC7-R24J-RPWC
6.8

GHSA-3hc7-r24j-rpwc: Cross-Project Task Disclosure via Subtask Expansion in Vikunja

A cross-project information disclosure vulnerability in Vikunja allows authenticated users with read access to one project to view private task details from unauthorized projects via subtask expansion parameters.

Alon Barad
Alon Barad
9 views•5 min read