upatch.dev

CVE-2026-85699

jina-ai reader server-side request forgery via redirect validation bypass

Refuses outbound connections from node processes to loopback, private, link-local and cloud metadata addresses to mitigate jina-ai/reader redirect SSRF CVE-2026-85699.

High 8.7Vetted

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

At a glance

CVE-2026-85699 is a high (CVSS 8.7) vulnerability in Jina Reader, published 4 September 2026. A vetted upatch, cve-2026-85699-ssrf-block, blocks it on running Linux machines with shirudo until Jina Reader is upgraded.

Severity
High 8.7 CVSS 4.0
Chance of exploitation
0.5% in the next 30 days (EPSS, 25 Nov 2026)
Known exploited
No, not on CISA’s KEV list
Weakness
CWE-918
Affected software
Jina Reader (jina-ai)
Upatch status
Vetted, merged into the registry
How to apply
Build, sign and roll out with shirudo

Overview

CVE-2026-85699, published on 4 September 2026, is a server-side request forgery (SSRF) vulnerability in jina-ai/reader through commit 1574bfd380d249c86c82db4dace0d9c8fe17e2b1 (0.5.0). When crawling a user-supplied URL, CrawlerHost validates the initial URL once with MiscService.assertNormalizedUrl (src/services/misc.ts), which checks the hostname and resolved IP addresses against isIPInNonPublicRange (src/utils/ip.ts) when privateIpNotAcceptable is enabled (NODE_ENV containing prod and GCLOUD_PROJECT set). However, in CurlControl.urlToFile and CurlControl.urlToBlob (src/services/curl.ts), urlToStream disables libcurl's FOLLOWLOCATION and follows up to 6 HTTP 301, 302, 303, 307 and 308 redirects manually in a do ... while loop (nextHopUrl = new URL(location || '', nextHopUrl)) without calling assertNormalizedUrl or isIPInNonPublicRange on the redirect target. In addition, the browser request interceptor in PuppeteerControl (src/services/puppeteer.ts) only checks whether parsedUrl.hostname === 'localhost' or parsedUrl.hostname.startsWith('127.'), leaving 169.254.0.0/16, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 100.64.0.0/10, 0.0.0.0 and IPv6 non-public ranges reachable. A public URL that responds with a 30x redirect to an internal address or cloud metadata endpoint (169.254.169.254) therefore makes Reader fetch and return the internal response body.

Official description

jina-ai reader contains a server-side request forgery vulnerability where URL validation is performed only on the initial request but not re-applied to subsequent redirect hops. Attackers can craft a public URL that redirects to internal network addresses or cloud metadata endpoints, allowing the server to fetch and return the target's response body to the attacker.

Affected versions

This is an application vulnerability in jina-ai/reader through commit 1574bfd380d249c86c82db4dace0d9c8fe17e2b1 (0.5.0). The upatch uses the lsm/socket_connect hook and CO-RE reads on struct sockaddr, struct sockaddr_in, struct sockaddr_in6, struct task_struct, struct file and struct dentry, which are present across Linux kernels supported by shirudo with BPF LSM and BTF enabled.

Sources

More references from NVD (5)

Mitigation

The BPF LSM program cve_2026_85699_ssrf_block attaches to lsm/socket_connect and returns -EPERM when a process whose executable or command name is node attempts to connect an AF_INET or AF_INET6 socket to any of the non-public ranges defined in src/utils/ip.ts:

  • 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 (including 169.254.169.254), 172.16.0.0/12, 192.168.0.0/16, 224.0.0.0/4, and 255.255.255.255/32.
  • AF_INET6: ::/128, ::1/128, ::127.0.0.0/104 and IPv4-compatible or IPv4-mapped (::ffff:0:0/96) addresses in the blocked IPv4 ranges, fc00::/7, fe80::/10, and ff00::/8.

The program inspects address->sa_family and the destination IP address first, and reads the current task's executable dentry or command name only when the destination falls in a non-public range. Because lsm/socket_connect runs in the kernel on every connect() call made by node (including @nomagick/node-libcurl-impersonate threads inside the node process), every redirect hop to a loopback, private, or link-local metadata address is refused before a packet is sent. A refusal from an earlier BPF LSM program on the same hook is preserved. Refusals are counted in the refused per-CPU array map at key 0.

Side effects

  • Any node process on the machine is refused outbound AF_INET and AF_INET6 connections to loopback, RFC 1918 private, CGNAT, link-local, and multicast addresses. Inbound HTTP connections to Reader on loopback or private interfaces continue to work because accept does not call socket_connect.
  • Outbound connections from node to public IP addresses (such as the initial hop or redirects to public origins) continue to work.
  • If PuppeteerControl launches a local headless Chrome over a loopback TCP WebSocket rather than a pipe, or if node connects to a database or proxy on 127.0.0.1 or an RFC 1918 address, those outbound connections from node will also be refused with EPERM.

Preemption model and cost

The program holds no shared state other than the refused per-CPU array map, which it updates with __sync_fetch_and_add, making it safe under all kernel preemption models including PREEMPT_LAZY, PREEMPT_DYNAMIC and PREEMPT_RT. On every socket_connect call to a Unix domain socket or a public IPv4/IPv6 address, the program checks only sa_family and the destination address words and returns 0 without inspecting the current task.

The policy

144 lines of BPF C, attached at lsm/socket_connect.

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

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

#define EPERM 1
#define AF_INET 2
#define AF_INET6 10

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 *value = bpf_map_lookup_elem(&refused, &key);

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

static __always_inline int earlier_verdict(int ret)
{
	return ret >= -4095 && ret < 0 ? ret : -EPERM;
}

static __always_inline bool name_is_node(const struct dentry *dentry)
{
	const unsigned char *name = BPF_CORE_READ(dentry, d_name.name);
	char buf[8] = {};

	if (!dentry || BPF_CORE_READ(dentry, d_name.len) != 4)
		return false;
	if (bpf_probe_read_kernel_str(buf, sizeof(buf), name) < 0)
		return false;
	return buf[0] == 'n' && buf[1] == 'o' && buf[2] == 'd' &&
	       buf[3] == 'e' && buf[4] == '\0';
}

static __always_inline bool current_is_node(void)
{
	struct task_struct *task = bpf_get_current_task_btf();
	const struct dentry *exe = BPF_CORE_READ(task, mm, exe_file, f_path.dentry);
	char comm[16] = {};

	if (name_is_node(exe))
		return true;
	if (bpf_get_current_comm(&comm, sizeof(comm)) == 0 &&
	    comm[0] == 'n' && comm[1] == 'o' && comm[2] == 'd' &&
	    comm[3] == 'e' && comm[4] == '\0')
		return true;
	return false;
}

static __always_inline bool ipv4_is_blocked(__u32 ip)
{
	if ((ip & 0xff000000U) == 0x00000000U)
		return true;
	if ((ip & 0xff000000U) == 0x0a000000U)
		return true;
	if ((ip & 0xffc00000U) == 0x64400000U)
		return true;
	if ((ip & 0xff000000U) == 0x7f000000U)
		return true;
	if ((ip & 0xffff0000U) == 0xa9fe0000U)
		return true;
	if ((ip & 0xfff00000U) == 0xac100000U)
		return true;
	if ((ip & 0xffff0000U) == 0xc0a80000U)
		return true;
	if ((ip & 0xe0000000U) == 0xe0000000U)
		return true;
	if (ip == 0xffffffffU)
		return true;
	return false;
}

static __always_inline bool ipv6_is_blocked(const struct in6_addr *addr6)
{
	__u32 w0 = bpf_ntohl(BPF_CORE_READ(addr6, in6_u.u6_addr32[0]));
	__u32 w1 = bpf_ntohl(BPF_CORE_READ(addr6, in6_u.u6_addr32[1]));
	__u32 w2 = bpf_ntohl(BPF_CORE_READ(addr6, in6_u.u6_addr32[2]));
	__u32 w3 = bpf_ntohl(BPF_CORE_READ(addr6, in6_u.u6_addr32[3]));

	if (w0 == 0 && w1 == 0 && w2 == 0)
		return ipv4_is_blocked(w3) || w3 == 1;
	if (w0 == 0 && w1 == 0 && w2 == 0x0000ffffU)
		return ipv4_is_blocked(w3);
	if ((w0 & 0xfe000000U) == 0xfc000000U)
		return true;
	if ((w0 & 0xffc00000U) == 0xfe800000U)
		return true;
	if ((w0 & 0xff000000U) == 0xff000000U)
		return true;
	return false;
}

SEC("lsm/socket_connect")
int BPF_PROG(cve_2026_85699_ssrf_block, struct socket *sock,
	     struct sockaddr *address, int addrlen, int ret)
{
	__u16 family;

	if (ret)
		return earlier_verdict(ret);
	if (!address || addrlen < (int)sizeof(family))
		return 0;
	family = BPF_CORE_READ(address, sa_family);
	if (family == AF_INET) {
		const struct sockaddr_in *sin;
		__u32 ip;

		if (addrlen < (int)sizeof(*sin))
			return 0;
		sin = (const struct sockaddr_in *)address;
		ip = bpf_ntohl(BPF_CORE_READ(sin, sin_addr.s_addr));
		if (!ipv4_is_blocked(ip) || !current_is_node())
			return 0;
		count_refused();
		return -EPERM;
	}
	if (family == AF_INET6) {
		const struct sockaddr_in6 *sin6;

		if (addrlen < (int)sizeof(*sin6))
			return 0;
		sin6 = (const struct sockaddr_in6 *)address;
		if (!ipv6_is_blocked(&sin6->sin6_addr) || !current_is_node())
			return 0;
		count_refused();
		return -EPERM;
	}
	return 0;
}

Process

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

  1. 4 Sept 2026CVECVE published
  2. 25 Nov 2026Pull requestPull request #98 openedAdd CVE-2026-85699: Refuses outbound connections from node processes to loopback, private,romanlab
  3. 25 Nov 2026CICheck entriespassed
  4. 25 Nov 2026CIingestpassed
  5. 25 Nov 2026CICompile with clang 23passed
  6. 25 Nov 2026ReviewReviewedqodo-code-review[bot] (automated)
  7. 25 Nov 2026MergeMerged #98romanlab

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

Evidence

On jina-ai/reader 0.5.0 (commit 1574bfd380d249c86c82db4dace0d9c8fe17e2b1), an HTTP 302 redirect from a public origin to a link-local metadata listener reached the internal listener before and after the upatch was loaded, and was refused at lsm/socket_connect (HTTP 502) while loaded.

Tested
25 Nov 2026
Target
jina-ai/reader 0.5.0 (commit 1574bfd380d249c86c82db4dace0d9c8fe17e2b1) with privateIpNotAcceptable enabled
Kernel
7.4-shirudo-ci-20261123
Architecture
x86_64
Distribution
Ubuntu 26.04
Results
StateRedirect SSRF to link-local metadata listener blockedDirect crawl of public origin works
Before loadingnoyes
Upatch loadedyesyes
After unloadingnoyes
tools-test.log Output of tools/test --setup showing the redirect SSRF probe reached before, blocked while loaded, and reached again after.
tools/test --setup, 2026-11-25T15:52:07Z
Target: shirudo test VM, Linux 7.4-shirudo-ci-20261123, x86_64, swtpm
cve-2026-85699
  setup   done         READER_URL=http://127.0.0.1:3000 PUBLIC_URL=http://198.51.100.10:8081/article REDIRECT_URL=http://198.51.100.10:8081/redirect METADATA_URL=http://169.254.169.250:8082/latest/meta-data/iam/security-credentials
  before  reached      Reader followed the HTTP 302 redirect and returned the link-local metadata body
  loaded  blocked      Reader redirect hop to http://169.254.169.250:8082/latest/meta-data/iam/security-credentials was refused (HTTP 502: Request failed: Could not connect to server)
  after   reached      Reader followed the HTTP 302 redirect and returned the link-local metadata body
  PASS: reached before, blocked while loaded, reached again after

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-85699
Publish and roll out
shirudo bpm push build/packages/cve-2026-85699-1.0.0.bee oci://<registry>/<namespace>/cve-2026-85699 --keys-dir <keys-dir>
shirudo bpm tree append build/packages/cve-2026-85699-1.0.0.bee oci://<registry>/<namespace>/<tree> --tree-id <tree-id> --keys-dir <keys-dir>