upatch.dev

CVE-2026-85124

@fastify/http-proxy vulnerable to prefix escape via backslash dot-segments

Drops HTTP requests with backslash dot-segments to mitigate CVE-2026-85124 in @fastify/http-proxy.

High 7.5Vetted

EPSS 0.7%: the estimated chance this CVE is exploited in the next 30 days, as of 24 Nov 2026.

At a glance

CVE-2026-85124 is a high (CVSS 7.5) vulnerability in @fastify/http-proxy, published 3 September 2026. A vetted upatch, cve-2026-85124-backslash-block, blocks it on running Linux machines with shirudo until @fastify/http-proxy is upgraded.

Severity
High 7.5 CVSS 3.1
Chance of exploitation
0.7% in the next 30 days (EPSS, 24 Nov 2026)
Known exploited
No, not on CISA’s KEV list
Weakness
CWE-22
Affected software
@fastify/http-proxy
Upatch status
Vetted, merged into the registry
How to apply
Build, sign and roll out with shirudo

Overview

CVE-2026-85124, "@fastify/http-proxy vulnerable to prefix escape via backslash dot-segments", was published on 3 September 2026 (GHSA-qv33-689p-2xq5). Versions of @fastify/http-proxy before 11.6.2 do not validate proxied HTTP request paths for backslash-based dot-segments before forwarding them to the configured upstream. While the WebSocket path validates destinations, the plain HTTP request handler passes the rewritten path to @fastify/reply-from, which only rejects forward-slash traversal (/../). When @fastify/http-proxy is configured with prefix and rewritePrefix (such as prefix: '/pub' and rewritePrefix: '/internal'), a request path containing backslashes and .. segments (such as /pub/dir\..\..\secret or /pub/dir%5c..%5c..%5csecret) is passed to the WHATWG new URL() constructor, which normalizes `` to / and resolves the .. segments upward, escaping /internal and reaching hidden upstream endpoints such as /secret.

Official description

@fastify/http-proxy versions before 11.6.2 do not validate proxied HTTP request paths for backslash based dot-segments before forwarding them to the configured upstream. The plain HTTP request handler skips the destination validation that the WebSocket path performs, and the underlying reply-from library only rejects forward-slash traversal, so a request containing backslash dot-segments can escape the boundary set by the prefix and rewritePrefix options. An unauthenticated network attacker can use this to reach upstream paths that were meant to stay hidden behind the proxy, resulting in disclosure of internal endpoints. This is a path traversal issue (CWE-22). Users should upgrade to @fastify/http-proxy 11.6.2 or later.

Affected versions

@fastify/http-proxy:

Package Affected Fixed in
@fastify/http-proxy < 11.6.2 11.6.2

Kernels: any Linux kernel supported by shirudo with cgroup_skb/ingress support.

Sources

More references from NVD (2)

Mitigation

The program attaches to cgroup_skb/ingress at the root of the unified cgroup hierarchy and inspects incoming IPv4 and IPv6 TCP packets that carry at least 16 bytes of payload:

Hook Refused
cgroup_skb/ingress Incoming TCP packets starting with an HTTP request line whose request path contains \.., .., %5c.., %5C.., ..%5c, or ..%5C

When a matching packet is seen, the program increments key 0 of the refused per-CPU array map and returns 0 to drop the packet before the application socket receives it. All other packets return 1.

Side effects

  • Plain-text HTTP requests whose first packet contains \.., .., %5c.., %5C.., ..%5c, or ..%5C in the request path (within the first 96 bytes of the TCP payload) are dropped by the kernel and time out at the client.
  • Standard HTTP requests using normal paths and query strings are unaffected.
  • Not covered: HTTPS traffic terminated inside the Node.js process, HTTP/2 or HTTP/3 requests, or requests where the backslash dot-segment begins past the first 90 bytes of the HTTP request line.

Preemption model and cost

The program keeps no state beyond the refused per-CPU counter map, which it updates with an atomic fetch-and-add, so it is safe under every kernel preemption model including PREEMPT_LAZY and PREEMPT_RT. Non-TCP packets and TCP acknowledgements without payload exit after header checks; non-HTTP TCP segments exit on the first non-uppercase byte of the payload.

The policy

160 lines of BPF C, attached at cgroup_skb/ingress.

// SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause

#include "vmlinux.h"
#include <bpf/bpf_helpers.h>
#include <bpf/bpf_endian.h>

#define ETH_P_IP	0x0800
#define ETH_P_IPV6	0x86DD
#define IPPROTO_TCP	6
#define ASCII_LF	0x0a
#define ASCII_CR	0x0d
#define ASCII_BSLASH	0x5c

char _license[] SEC("license") = "Dual BSD/GPL";

struct {
	__uint(type, BPF_MAP_TYPE_PERCPU_ARRAY);
	__uint(max_entries, 1);
	__type(key, __u32);
	__type(value, __u64);
} refused SEC(".maps");

static __always_inline void count_refused(void)
{
	__u32 key = 0;
	__u64 *val = bpf_map_lookup_elem(&refused, &key);

	if (val)
		__sync_fetch_and_add(val, 1);
}

static __always_inline bool tcp_payload_offset(struct __sk_buff *skb,
					       __u32 *payload_off)
{
	__u16 proto = bpf_ntohs(skb->protocol);
	__u32 l4_off = 0;
	__u8 ip_first = 0;
	__u8 ip_proto = 0;
	__u8 tcp_doff = 0;
	__u32 tcp_hdr_len;

	if (proto == ETH_P_IP) {
		if (bpf_skb_load_bytes(skb, 0, &ip_first, 1) < 0)
			return false;
		if (bpf_skb_load_bytes(skb, 9, &ip_proto, 1) < 0)
			return false;
		if (ip_proto != IPPROTO_TCP)
			return false;
		l4_off = (__u32)(ip_first & 0x0f) * 4;
		if (l4_off < 20 || l4_off > 60)
			return false;
	} else if (proto == ETH_P_IPV6) {
		if (bpf_skb_load_bytes(skb, 6, &ip_proto, 1) < 0)
			return false;
		if (ip_proto != IPPROTO_TCP)
			return false;
		l4_off = 40;
	} else {
		return false;
	}

	if (bpf_skb_load_bytes(skb, l4_off + 12, &tcp_doff, 1) < 0)
		return false;
	tcp_hdr_len = (__u32)(tcp_doff >> 4) * 4;
	if (tcp_hdr_len < 20 || tcp_hdr_len > 60)
		return false;

	*payload_off = l4_off + tcp_hdr_len;
	return true;
}

static __always_inline int http_path_start(const char *buf)
{
	int i;

	for (i = 0; i < 8; i++) {
		char c = buf[i];

		if (c == ' ') {
			if (i >= 3 && buf[i + 1] == '/')
				return i + 1;
			return -1;
		}
		if (c < 'A' || c > 'Z')
			return -1;
	}
	return -1;
}

static __always_inline bool is_hex_5c(char a, char b)
{
	return a == '5' && (b == 'c' || b == 'C');
}

static __always_inline bool has_backslash_dot_segment(const char *buf)
{
	int start = http_path_start(buf);
	int i;

	if (start < 0)
		return false;

	for (i = 4; i < 90; i++) {
		char c = buf[i];

		if (i < start)
			continue;
		if (c == 0 || c == ' ' || c == '?' || c == ASCII_CR ||
		    c == ASCII_LF)
			break;
		if (c == ASCII_BSLASH && buf[i + 1] == '.' && buf[i + 2] == '.')
			return true;
		if (c == '.' && buf[i + 1] == '.' && buf[i + 2] == ASCII_BSLASH)
			return true;
		if (c == '%' && is_hex_5c(buf[i + 1], buf[i + 2]) &&
		    buf[i + 3] == '.' && buf[i + 4] == '.')
			return true;
		if (c == '.' && buf[i + 1] == '.' && buf[i + 2] == '%' &&
		    is_hex_5c(buf[i + 3], buf[i + 4]))
			return true;
	}
	return false;
}

SEC("cgroup_skb/ingress")
int cve_2026_85124_backslash_block(struct __sk_buff *skb)
{
	char buf[96] = {};
	__u32 payload_off = 0;
	__u32 avail;

	if (!tcp_payload_offset(skb, &payload_off))
		return 1;
	if (skb->len <= payload_off)
		return 1;
	avail = skb->len - payload_off;
	if (avail < 16)
		return 1;

	if (avail >= 96) {
		if (bpf_skb_load_bytes(skb, payload_off, buf, 96) < 0)
			return 1;
	} else if (avail >= 64) {
		if (bpf_skb_load_bytes(skb, payload_off, buf, 64) < 0)
			return 1;
	} else if (avail >= 32) {
		if (bpf_skb_load_bytes(skb, payload_off, buf, 32) < 0)
			return 1;
	} else {
		if (bpf_skb_load_bytes(skb, payload_off, buf, 16) < 0)
			return 1;
	}

	if (has_backslash_dot_segment(buf)) {
		count_refused();
		return 0;
	}
	return 1;
}

Process

How this upatch was written, checked and reviewed, from the registry’s history.

  1. 3 Sept 2026CVECVE published
  2. 25 Nov 2026Pull requestPull request #63 openedAdd CVE-2026-85124: Drops HTTP requests with backslash dot-segments to mitigate CVE-2026-85124 inromanlab
  3. 25 Nov 2026CIUpdate upatch.devpassed
  4. 25 Nov 2026CICIpassed
  5. 25 Nov 2026MergeMerged #63romanlab

No human review is recorded on GitHub for this upatch yet.

Evidence

While loaded, the upatch dropped incoming HTTP requests containing backslash dot-segments at cgroup_skb/ingress while normal proxied requests succeeded. With the transitive @fastify/reply-from dependency rejecting the path with HTTP 400 before and after loading, the test shows the kernel refusal.

Tested
25 Nov 2026
Target
@fastify/http-proxy 11.6.1 on Fastify 5.2.0 and Node.js 22.14.0 with prefix /pub and rewritePrefix /internal, loopback only
Kernel
7.4-shirudo-ci-20261123
Architecture
x86_64
Machine
shirudo test VM
Results
StateBackslash dot-segment request (/pub/dir%5c..%5c..%5csecret)Normal proxied request (/pub/probe)
Before loadingHTTP 400 (unsupported)HTTP 200
Upatch loadeddropped (blocked)HTTP 200
After unloadingHTTP 400 (unsupported)HTTP 200
tools-test.log Output of tools/test --setup before, while and after the upatch was loaded.
tools/test --setup, 2026-11-25T13:48:52Z
Target: shirudo test VM, Linux 7.4-shirudo-ci-20261123, x86_64, swtpm
cve-2026-85124
  setup   done         FASTIFY_PROXY_URL=http://127.0.0.1:18080
  before  unsupported  the proxy rejected the backslash dot-segment path with HTTP 400: this @fastify/http-proxy is fixed
  loaded  blocked      the kernel dropped the backslash dot-segment request while normal proxy requests succeeded
  after   unsupported  the proxy rejected the backslash dot-segment path with HTTP 400: this @fastify/http-proxy is fixed
  PASS: blocked while loaded; this machine lacks the vulnerable feature, so only the refusal was shown

Use it

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
git clone https://github.com/copper-helm/upatch-registry
cd upatch-registry
tools/build <shirudo-checkout> <keys-dir> 1.0.0 upatches/cve-2026-85124
Publish and roll out
shirudo bpm push build/packages/cve-2026-85124-1.0.0.bee oci://<registry>/<namespace>/cve-2026-85124 --keys-dir <keys-dir>
shirudo bpm tree append build/packages/cve-2026-85124-1.0.0.bee oci://<registry>/<namespace>/<tree> --tree-id <tree-id> --keys-dir <keys-dir>