# CVE-2026-77775: Headroom Proxy Sends Upstream Requests to a Client-Supplied Base URL Without Address Validation

The Markdown version of <https://upatch.dev/cve/CVE-2026-77775>. Last updated 25 Nov 2026.

## At a glance

CVE-2026-77775 is rated High 7.7 (CVSS 4.0, CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:N/SC:H/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X). It affects Headroom (Headroom Labs) and was published on 21 Aug 2026. It is not in CISA's Known Exploited Vulnerabilities catalog. Its EPSS score is 0.6%: the estimated chance it is exploited in the next 30 days, as of 24 Nov 2026. The upatch `cve-2026-77775-headroom-ssrf-block` mitigates it, and is vetted (merged into the registry).

A upatch is a signed BPF program that shirudo loads into a running Linux kernel to block the code path this CVE's exploit takes. It holds the line until the fix ships; it does not replace patching.

## The vulnerability

CVE-2026-77775, "Headroom Proxy Sends Upstream Requests to a Client-Supplied Base URL Without Address Validation", was published on 20 August 2026. Headroom's LLM proxy lets a client override the upstream destination with the `x-headroom-base-url` HTTP request header. `_resolve_openai_upstream_base` in `headroom/proxy/handlers/openai.py`, `_select_passthrough_base_url` in `headroom/providers/proxy_routes.py`, and the `passthrough` route in `headroom/providers/proxy_routes.py` accept the client-supplied URL without rejecting loopback, link-local, RFC 1918, or reserved addresses. Because the proxy forwards the request and returns the upstream response to the caller, an attacker can reach internal services and cloud metadata endpoints (`169.254.169.254`) and read their responses.

### Official description

Headroom's LLM proxy lets a client choose the upstream destination with the x-headroom-base-url request header. \_resolve_openai_upstream_base in headroom/proxy/handlers/openai.py accepts the header value, requires only that it parse with an http or https scheme and a hostname, and returns it for use as the upstream base; \_select_passthrough_base_url in headroom/providers/proxy_routes.py reads the same header for the passthrough routes. No check rejects loopback, link-local, or RFC 1918 destinations, and because the component is a proxy the upstream response is returned to the caller, so the request reaches internal services and cloud metadata addresses and their responses are disclosed. The Authorization header accompanying the request is forwarded unchanged to the caller-designated host. The pip console script binds 127.0.0.1 by default, but the reference docker-compose.yml ships --host 0.0.0.0 with published ports and no required HEADROOM_PROXY_TOKEN, which the server itself warns about at startup, so a deployment following the shipped compose exposes the affected data-plane routes to the network without authentication.

## What the upatch does

The `lsm/socket_connect` program returns `-EPERM` when a process whose command name is `headroom` connects an `AF_INET` or `AF_INET6` `SOCK_STREAM` socket to a non-public IP address:

| Family     | Refused destination ranges                                                                                                                                    |
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `AF_INET`  | `0.0.0.0/8`, `10.0.0.0/8`, `100.64.0.0/10`, `127.0.0.0/8`, `169.254.0.0/16`, `172.16.0.0/12`, `192.168.0.0/16`, `198.18.0.0/15`, `224.0.0.0/4`, `240.0.0.0/4` |
| `AF_INET6` | `::`, `::1`, `::ffff:0:0/96` mapped to any refused IPv4 range, `fc00::/7`, `fe80::/10`, `ff00::/8`                                                            |

The program checks the socket type and destination address first and reads the current task's command name only when a stream socket connects to an internal address. It preserves any negative verdict from an earlier BPF LSM program on the same hook and increments key 0 of the `refused` per-CPU array on each refusal.

The policy: [`cve-2026-77775-headroom-ssrf-block.bpf.c`](https://github.com/copper-helm/upatch-registry/tree/main/upatches/cve-2026-77775), 132 lines of BPF C attached at `lsm/socket_connect`, licensed GPL-2.0 OR BSD-2-Clause.

## Side effects

- Any outbound TCP connection from a process named `headroom` to a loopback, link-local, RFC 1918, carrier-grade NAT, benchmarking, multicast, or reserved IPv4/IPv6 address fails with `EPERM`, and Headroom returns HTTP 502 (`connection_error`) to the client.
- Outbound TCP connections from `headroom` to public upstream LLM APIs keep working.
- A deployment that intentionally connects from `headroom` to an internal or on-premises upstream LLM gateway or local database over TCP is also refused while this upatch is loaded.

## Preemption model and cost

The program is written for preemptible RCU and keeps no shared state other than the `refused` per-CPU counter, which it updates with an atomic fetch-and-add so interleaved runs on the same CPU cannot lose counts. On ordinary connections to public IP addresses or non-stream sockets, the program checks the socket type, address family, and IP prefix in registers and returns without calling any helper.

## Affected versions

Application: `headroom-ai` versions before `0.36.1` (fixed in `0.36.1`).

Kernels: any Linux kernel with BPF LSM and BTF enabled that shirudo supports.

## How it was tested

On a vulnerable Headroom 0.29.0 proxy, the loaded upatch refused the x-headroom-base-url SSRF connection to a loopback target and the proxy returned HTTP 502, while requests before loading and after unloading reached the target.

- **Tested:** 25 Nov 2026
- **Target:** headroom-ai 0.29.0 proxy on Python 3.12, listening on 127.0.0.1:8787
- **Kernel:** 7.4-shirudo-ci-20261123
- **Architecture:** x86_64
- **Distribution:** Ubuntu 26.04

### Results

| State           | SSRF via x-headroom-base-url blocked | Proxy response to loopback x-headroom-base-url |
| --------------- | ------------------------------------ | ---------------------------------------------- |
| Before loading  | no                                   | HTTP 200 (probe body returned)                 |
| Upatch loaded   | yes                                  | HTTP 502 (connection refused by LSM)           |
| After unloading | no                                   | HTTP 200 (probe body returned)                 |

## How to apply

Build the upatch from source, sign it with your own shirudo key, and publish it to your own OCI registry. Machines that follow your upatch tree load it within about a minute.

Build and sign:

```sh
git clone https://github.com/copper-helm/upatch-registry
cd upatch-registry
tools/build <shirudo-checkout> <keys-dir> 1.0.0 upatches/cve-2026-77775
```

Publish and roll out:

```sh
shirudo bpm push build/packages/cve-2026-77775-1.0.0.bee oci://<registry>/<namespace>/cve-2026-77775 --keys-dir <keys-dir>
shirudo bpm tree append build/packages/cve-2026-77775-1.0.0.bee oci://<registry>/<namespace>/<tree> --tree-id <tree-id> --keys-dir <keys-dir>
```

## Review

- Contributors: romanlab.
- Reviewers: none recorded yet.

## Sources and links

- [CVE-2026-77775 record (CVE API)](https://cveawg.mitre.org/api/cve/CVE-2026-77775)
- [VulnCheck advisory](https://www.vulncheck.com/advisories/headroom-proxy-sends-upstream-requests-to-a-client-supplied-base-url-without-address-validation)
- [Pull request #2207](https://github.com/headroomlabs-ai/headroom/pull/2207) and fix commit [ac962fcce374](https://github.com/headroomlabs-ai/headroom/commit/ac962fcce374739572c04e09269c12b9daeb457f) (merged in [1f96dabc1913](https://github.com/headroomlabs-ai/headroom/commit/1f96dabc19130947770353cd6e814db4fd96e6a0))
- [Vulnerable handler in v0.29.0](https://github.com/headroomlabs-ai/headroom/blob/v0.29.0/headroom/proxy/handlers/openai.py) and [upstream_guard.py in v0.36.1](https://github.com/headroomlabs-ai/headroom/blob/v0.36.1/headroom/proxy/upstream_guard.py)

### Links

- [CVE-2026-77775 on upatch.dev](https://upatch.dev/cve/CVE-2026-77775) (this page, as HTML)
- [NVD](https://nvd.nist.gov/vuln/detail/CVE-2026-77775)
- [CVE.org](https://www.cve.org/CVERecord?id=CVE-2026-77775)
- [CWE-918](https://cwe.mitre.org/data/definitions/918.html)
- Upatch source: [upatches/cve-2026-77775](https://github.com/copper-helm/upatch-registry/tree/main/upatches/cve-2026-77775)

### More references from NVD (5)

- [github.com](https://github.com/headroomlabs-ai/headroom)
- [github.com](https://github.com/headroomlabs-ai/headroom/blob/v0.29.0/headroom/proxy/handlers/openai.py)
- [github.com](https://github.com/headroomlabs-ai/headroom/blob/v0.36.1/headroom/proxy/upstream_guard.py)
- [github.com](https://github.com/headroomlabs-ai/headroom/pull/2207)
- [vulncheck.com](https://www.vulncheck.com/advisories/headroom-proxy-sends-upstream-requests-to-a-client-supplied-base-url-without-address-validation)
