# CVE-2026-82270: Portkey AI Gateway Server-Side Request Forgery via /v1/proxy/\*

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

## At a glance

CVE-2026-82270 is rated High 8.7 (CVSS 4.0, CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/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 Portkey AI Gateway (Portkey-AI) and was published on 28 Aug 2026. It is not in CISA's Known Exploited Vulnerabilities catalog. Its EPSS score is 0.5%: the estimated chance it is exploited in the next 30 days, as of 25 Nov 2026. The upatch `cve-2026-82270-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-82270 is a server-side request forgery (SSRF) vulnerability in Portkey AI Gateway (`@portkey-ai/gateway`) through version 1.15.2, published on 28 August 2026. In `src/index.ts`, the `/v1/proxy/*` route is registered (`app.post('/v1/proxy/*', proxyHandler)`) without the `requestValidator` middleware that checks `x-portkey-custom-host` via `isValidCustomHost`. An unauthenticated caller can send a `POST /v1/proxy/*` request with `x-portkey-custom-host` pointing to a loopback, RFC 1918 private, link-local or cloud metadata address (`169.254.169.254`, `fd00:ec2::254`), and `proxyHandler` forwards the request body and `Authorization` headers to that internal target. In addition, outbound `fetch` calls follow HTTP redirects by default, allowing an allowlisted external host to redirect requests to internal addresses.

### Official description

Portkey AI Gateway through 1.15.2 contains a server-side request forgery vulnerability in the /v1/proxy/\* route that lacks requestValidator middleware. Attackers can set the x-portkey-custom-host header to internal addresses and forward requests with Authorization headers to reach internal services and exfiltrate provider API keys.

## What the upatch does

The BPF LSM program `cve_2026_82270_ssrf_block` attaches to `lsm/socket_connect` and returns `-EPERM` when a process whose command name or executable is `node` attempts to connect an `AF_INET` or `AF_INET6` socket to any of the internal or reserved ranges denied by `isValidCustomHost` in `src/middlewares/requestValidator/index.ts`:

- IPv4: `0.0.0.0/8`, `10.0.0.0/8`, `100.64.0.0/10` (CGNAT), `127.0.0.0/8` (loopback), `169.254.0.0/16` (link-local and cloud metadata `169.254.169.254`), `172.16.0.0/12`, `192.0.0.0/24`, `192.0.2.0/24`, `192.168.0.0/16`, `198.18.0.0/15`, `198.51.100.0/24`, `203.0.113.0/24` and `224.0.0.0/3` (multicast and reserved).
- IPv6: `::1/128`, `::/128`, `fc00::/7` (unique-local, including `fd00:ec2::254`), `fe80::/10` (link-local), `fec0::/10` (site-local), `ff00::/8`, `2001:db8::/32`, and IPv4-mapped (`::ffff:0:0/96`), IPv4-compatible (`::/96`), NAT64 (`64:ff9b::/96`) and 6to4 (`2002::/16`) embeddings of the blocked IPv4 ranges.

The program checks the socket family and destination address first, and inspects the current task's command or executable name only when the destination falls in a blocked range. Because `lsm/socket_connect` runs in the kernel on every outbound connection attempt, it stops both direct `/v1/proxy/*` requests and HTTP redirects to internal addresses. Refusals are counted in the `refused` per-CPU array map at key 0.

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

## Side effects

- Any `node` process on the machine is refused outbound `AF_INET` and `AF_INET6` connections to loopback, private, link-local, CGNAT and metadata addresses. Inbound connections to Portkey AI Gateway on loopback or private interfaces continue to work because `accept` does not call `socket_connect`.
- Local model backends (such as Ollama on loopback) or Redis cache backends (`REDIS_CONNECTION_STRING`) hosted on loopback or RFC 1918 addresses cannot be reached by `node` over TCP/IP while the upatch is loaded.
- Non-`node` processes on the host (including `sshd`, system services, `curl` and `python3`) are unaffected.

## Preemption model and cost

The program keeps no shared state beyond a single per-CPU counter updated with `__sync_fetch_and_add`, so it is safe under every kernel preemption model, including `PREEMPT_LAZY`, `PREEMPT_DYNAMIC` with preemptible RCU, and `PREEMPT_RT`. Connections to public IPv4 or IPv6 addresses and non-IP sockets return after reading the address family and destination IP without querying task state or maps.

## Affected versions

This is an application vulnerability in Portkey AI Gateway (`@portkey-ai/gateway`) through 1.15.2 (confirmed at commit `669825cbe89ee51569918b8f78a9db486fd69dd4`). The upatch runs on any Linux kernel supported by shirudo with BPF LSM and BTF enabled.

## How it was tested

On Portkey AI Gateway 1.15.2, the /v1/proxy/\* SSRF probe connected out to the internal loopback listener before and after the upatch was loaded, and was refused at lsm/socket_connect while the upatch was loaded.

- **Tested:** 25 Nov 2026
- **Target:** Portkey AI Gateway (@portkey-ai/gateway) 1.15.2 on Node.js
- **Kernel:** 7.4-shirudo-ci-20261123
- **Architecture:** x86_64

### Results

| State           | Outbound SSRF connection to loopback listener blocked |
| --------------- | ----------------------------------------------------- |
| Before loading  | no                                                    |
| Upatch loaded   | yes                                                   |
| After unloading | no                                                    |

## 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-82270
```

Publish and roll out:

```sh
shirudo bpm push build/packages/cve-2026-82270-1.0.0.bee oci://<registry>/<namespace>/cve-2026-82270 --keys-dir <keys-dir>
shirudo bpm tree append build/packages/cve-2026-82270-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-82270 record (CVE API)](https://cveawg.mitre.org/api/cve/CVE-2026-82270)
- [VulnCheck advisory for CVE-2026-82270](https://www.vulncheck.com/advisories/portkey-ai-gateway-server-side-request-forgery-via-v1-proxy)
- [Portkey AI Gateway issue #1718](https://github.com/Portkey-AI/gateway/issues/1718)
- [Vulnerable route registration in src/index.ts at 669825cbe89ee51569918b8f78a9db486fd69dd4](https://github.com/Portkey-AI/gateway/blob/669825cbe89ee51569918b8f78a9db486fd69dd4/src/index.ts)

### Links

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

### More references from NVD (4)

- [github.com](https://github.com/Portkey-AI/gateway)
- [github.com](https://github.com/Portkey-AI/gateway/blob/669825cbe89ee51569918b8f78a9db486fd69dd4/src/index.ts)
- [github.com](https://github.com/Portkey-AI/gateway/issues/1718)
- [vulncheck.com](https://www.vulncheck.com/advisories/portkey-ai-gateway-server-side-request-forgery-via-v1-proxy)
