upatch.dev

CVE-2026-85668

Xinference 3.3.0 Unauthenticated Arbitrary-Path File Read via /v1/models/llm/auto-register

Refuses Xinference opening model configuration files outside .xinference to mitigate CVE-2026-85668.

High 8.7Vetted

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

At a glance

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

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

Overview

CVE-2026-85668, published on 4 September 2026, is an unauthenticated arbitrary-path file read in Xinference (xorbitsai/inference, v3.x up to 3.3.0, commit 4a94832). In xinference/model/llm/config_parser.py, build_llm_registration_from_local_config() handles POST /v1/models/llm/auto-register by taking a caller-supplied model_path without path confinement and reading config.json, tokenizer_config.json, and chat_template.jinja at that path. Numeric model fields parsed from config.json (such as max_position_embeddings and num_parameters) and capabilities inferred from tokenizer_config.json and chat_template.jinja are reflected in the HTTP response, letting an unauthenticated caller probe directories across the server filesystem.

Official description

Xinference (affected commit 4a94832, v3.x) contains an unauthenticated arbitrary-path file read vulnerability in the POST /v1/models/llm/auto-register endpoint, which accepts a caller-supplied model_path parameter without authentication or path confinement. The endpoint reads and parses config.json, tokenizer_config.json, and chat_template.jinja files at the supplied path and reflects the parsed content back to the caller, allowing an unauthenticated attacker to probe the server filesystem and extract content of files with those names in any directory.

Affected versions

  • Xinference (xorbitsai/inference): v3.x through v3.3.0 (including commit 4a94832, 3.4.0, 3.5.0, 4.0.0, and 4.0.1).
  • Fixed in commit 90c3b59e86fc95530e0adbe459c0fd0ea567ea1b (fix(models): restrict auto-registration paths and flexible launchers (#5766)), shipped in v4.1.0.

Sources

More references from NVD (4)

Mitigation

The BPF LSM program cve_2026_85668_config_block attaches to lsm/file_open and returns -EPERM when all of the following hold:

  1. The file being opened is named config.json, tokenizer_config.json, or chat_template.jinja.
  2. None of its ancestor directories (up to 8 levels) is named .xinference, where Xinference stores its model and cache directories by default.
  3. The current task's command name starts with xinference or its executable name starts with python.

Any refusal from an earlier BPF LSM program on the hook is preserved.

Side effects

  • POST /v1/models/llm/auto-register fails with HTTP 500 when model_path points outside a .xinference directory, matching the upstream fix that restricts auto-registration to allowed model roots.
  • Python processes on the host cannot open files literally named config.json, tokenizer_config.json, or chat_template.jinja unless the file sits under a .xinference directory.
  • Model registration and loading from ~/.xinference/model and ~/.xinference/cache continue to work when located within 8 directory levels of .xinference.

Preemption model and cost

The program is stateless and uses no maps or locks, so it is safe under every kernel preemption model, including PREEMPT_LAZY, preemptible RCU, and PREEMPT_RT. On every file_open event whose file name length is not 11, 19, or 21 bytes, the program reads dentry->d_name.len and returns immediately.

The policy

110 lines of BPF C, attached at lsm/file_open.

// 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>

#define EPERM 1

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

static __always_inline bool dentry_name_equals(const struct dentry *dentry,
					       const char *want, __u32 want_len)
{
	const unsigned char *name;
	char buf[24] = {};

	if (!dentry || BPF_CORE_READ(dentry, d_name.len) != want_len ||
	    want_len >= sizeof(buf))
		return false;
	name = BPF_CORE_READ(dentry, d_name.name);
	if (!name || bpf_probe_read_kernel(buf, want_len, name))
		return false;
	for (__u32 i = 0; i < sizeof(buf) - 1; i++) {
		if (i == want_len)
			return true;
		if (buf[i] != want[i])
			return false;
	}
	return false;
}

static __always_inline bool is_guarded_model_file(const struct dentry *dentry)
{
	__u32 len;

	if (!dentry)
		return false;
	len = BPF_CORE_READ(dentry, d_name.len);
	if (len == 11)
		return dentry_name_equals(dentry, "config.json", 11);
	if (len == 19)
		return dentry_name_equals(dentry, "chat_template.jinja", 19);
	if (len == 21)
		return dentry_name_equals(dentry, "tokenizer_config.json", 21);
	return false;
}

static __always_inline bool under_xinference_home(const struct dentry *dentry)
{
	const struct dentry *cur = dentry;

	for (int i = 0; i < 8; i++) {
		const struct dentry *parent = BPF_CORE_READ(cur, d_parent);

		if (!parent || parent == cur)
			return false;
		if (dentry_name_equals(parent, ".xinference", 11))
			return true;
		cur = parent;
	}
	return false;
}

static __always_inline bool current_is_xinference(void)
{
	struct task_struct *task = bpf_get_current_task_btf();
	const struct dentry *exe;
	const unsigned char *name;
	char comm[16] = {};
	char exe_buf[8] = {};

	if (bpf_get_current_comm(&comm, sizeof(comm)) == 0) {
		if (comm[0] == 'x' && comm[1] == 'i' && comm[2] == 'n' &&
		    comm[3] == 'f' && comm[4] == 'e' && comm[5] == 'r' &&
		    comm[6] == 'e' && comm[7] == 'n' && comm[8] == 'c' &&
		    comm[9] == 'e')
			return true;
	}
	exe = BPF_CORE_READ(task, mm, exe_file, f_path.dentry);
	if (!exe || BPF_CORE_READ(exe, d_name.len) < 6)
		return false;
	name = BPF_CORE_READ(exe, d_name.name);
	if (!name || bpf_probe_read_kernel(exe_buf, 6, name))
		return false;
	return exe_buf[0] == 'p' && exe_buf[1] == 'y' && exe_buf[2] == 't' &&
	       exe_buf[3] == 'h' && exe_buf[4] == 'o' && exe_buf[5] == 'n';
}

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

SEC("lsm/file_open")
int BPF_PROG(cve_2026_85668_config_block, struct file *file, int ret)
{
	const struct dentry *dentry = file->f_path.dentry;

	if (ret)
		return earlier_verdict(ret);
	if (!is_guarded_model_file(dentry))
		return 0;
	if (under_xinference_home(dentry))
		return 0;
	if (!current_is_xinference())
		return 0;
	return -EPERM;
}

Process

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

  1. 4 Sept 2026CVECVE published
  2. 25 Nov 2026CommitCommitted directlyAdd CVE-2026-85668romanlab

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

Evidence

On a vulnerable Xinference 3.3.0 server, POST /v1/models/llm/auto-register read config.json from an arbitrary directory before and after the upatch was loaded, and was blocked with HTTP 500 while the upatch was loaded.

Tested
25 Nov 2026
Target
Xinference 3.3.0 on Python 3.12, listening on 127.0.0.1:9997 with XINFERENCE_AUTH_ADVANCED=0
Kernel
7.4-shirudo-ci-20261123
Architecture
x86_64
Distribution
Ubuntu 26.04
Results
StatePOST /v1/models/llm/auto-register arbitrary-path config.json read
Before loadingreached (HTTP 200)
Upatch loadedblocked (HTTP 500)
After unloadingreached (HTTP 200)
tools-test.log Output of tools/test --setup showing the probe reached before, blocked while loaded, and reached after unloading.
tools/test --setup, 2026-11-25T13:37:58Z
Target: shirudo test VM, Linux 7.4-shirudo-ci-20261123, x86_64, swtpm
cve-2026-85668
  setup   done         XINFERENCE_URL=http://127.0.0.1:9997 XINFERENCE_PROBE_DIR=/opt/upatch-payload/cve-2026-85668/probe
  before  reached      POST /v1/models/llm/auto-register read config.json outside .xinference
  loaded  blocked      opening config.json outside .xinference failed with HTTP 500
  after   reached      POST /v1/models/llm/auto-register read config.json outside .xinference
  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-85668
Publish and roll out
shirudo bpm push build/packages/cve-2026-85668-1.0.0.bee oci://<registry>/<namespace>/cve-2026-85668 --keys-dir <keys-dir>
shirudo bpm tree append build/packages/cve-2026-85668-1.0.0.bee oci://<registry>/<namespace>/<tree> --tree-id <tree-id> --keys-dir <keys-dir>