upatch.dev

CVE-2026-85684

marker through 2.0.0 Path Traversal via upload filename

Refuses file creation, write-open and unlink outside the uploads directory by marker_server to mitigate CVE-2026-85684.

High 8.8Vetted

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

At a glance

CVE-2026-85684 is a high (CVSS 8.8) vulnerability in Marker, published 4 September 2026. A vetted upatch, cve-2026-85684-upload-block, blocks it on running Linux machines with shirudo until Marker is upgraded.

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

Overview

CVE-2026-85684, "marker through 2.0.0 Path Traversal via upload filename", was published on 4 September 2026. In marker-pdf through 2.0.0 (and up to 2.1.0), the FastAPI /marker/upload handler convert_pdf_upload in marker/scripts/server.py joins UPLOAD_DIRECTORY (./uploads) with the client-supplied multipart file.filename using os.path.join(UPLOAD_DIRECTORY, file.filename) without sanitizing directory traversal segments or absolute paths. It then opens that path with open(upload_path, "wb+"), writes the uploaded bytes, runs _convert_pdf, and deletes the path with os.remove(upload_path). An unauthenticated client can supply a filename containing .. or a leading / to create, overwrite or unlink files outside ./uploads.

Official description

marker through 2.0.0 contains a path traversal vulnerability in the FastAPI /marker/upload handler that fails to sanitize the file.filename parameter. Unauthenticated attackers can supply filenames containing directory traversal sequences to write arbitrary files to any location or delete existing files on the system.

Affected versions

Application vulnerability in marker-pdf:

Package Affected Fixed in
marker-pdf through 2.0.0 (and 2.1.0) 2.2.0 (a8c5b209d846)

Kernels: the lsm/inode_create program uses the four-argument inode_create LSM hook prototype that takes const struct mnt_idmap *idmap first, as Linux 7.4 and current mainline do.

Sources

More references from NVD (4)

Mitigation

Three BPF LSM programs return -EPERM to processes whose task comm is marker_server when the target dentry's immediate parent directory is not named uploads:

Hook Refused
lsm/inode_create Creating a new file whose parent dentry is not uploads
lsm/file_open Opening a file with FMODE_WRITE whose parent dentry is not uploads
lsm/inode_unlink Unlinking a file whose parent dentry is not uploads

When marker_server starts via its entrypoint script, the kernel sets the process comm to marker_server. On startup, marker/scripts/server.py creates ./uploads with os.makedirs, which uses inode_mkdir and is untouched. During normal /marker/upload requests with a plain filename, the uploaded file is created, opened for writing and removed directly inside uploads, which all three hooks allow. When a multipart filename traverses outside uploads, open(upload_path, "wb+") is refused with EPERM at inode_create (for a new file) or file_open (for an existing file), and os.remove(upload_path) is refused at inode_unlink. A refusal from an earlier BPF LSM program on the same hook is passed on.

Side effects

  • Any /marker/upload request whose file.filename resolves outside a directory named uploads fails with HTTP 500 (PermissionError) before writing or unlinking the file.
  • marker_server cannot create, open for writing or unlink regular files outside a directory named uploads (for example, temporary files in /tmp created directly in the marker_server process if tempfile is called there).
  • Normal uploads to /marker/upload with filenames that stay directly inside uploads, reading files anywhere on the filesystem, creating directories, and operations by any process not named marker_server continue to work.
  • Not covered: running marker.scripts.server via python -m or uvicorn directly (where comm is python or uvicorn rather than marker_server), or traversing into another writable directory that is also named uploads.

Preemption model and cost

The programs keep no state: no maps, no shared or per-CPU data. They are correct under every preemption model, including PREEMPT_LAZY, preemptible RCU and PREEMPT_RT. On file_open, read-only opens return after one f_mode bit test; on writes, creates and unlinks, non-target processes return after bpf_get_current_comm().

The policy

86 lines of BPF C, attached at lsm/inode_create and lsm/file_open and lsm/inode_unlink.

// 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
#define FMODE_WRITE	0x2

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

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

static __always_inline bool is_marker_server(void)
{
	char comm[16] = {};

	if (bpf_get_current_comm(comm, sizeof(comm)))
		return false;
	return comm[0] == 'm' && comm[1] == 'a' && comm[2] == 'r' &&
	       comm[3] == 'k' && comm[4] == 'e' && comm[5] == 'r' &&
	       comm[6] == '_' && comm[7] == 's' && comm[8] == 'e' &&
	       comm[9] == 'r' && comm[10] == 'v' && comm[11] == 'e' &&
	       comm[12] == 'r' && comm[13] == 0;
}

static __always_inline bool parent_is_uploads(const struct dentry *dentry)
{
	const struct dentry *parent = BPF_CORE_READ(dentry, d_parent);
	const unsigned char *name;
	char buf[8] = {};

	if (!parent || BPF_CORE_READ(parent, d_name.len) != 7)
		return false;
	name = BPF_CORE_READ(parent, d_name.name);
	if (!name || bpf_probe_read_kernel(buf, 7, name))
		return false;
	return buf[0] == 'u' && buf[1] == 'p' && buf[2] == 'l' &&
	       buf[3] == 'o' && buf[4] == 'a' && buf[5] == 'd' &&
	       buf[6] == 's';
}

SEC("lsm/inode_create")
int BPF_PROG(cve_2026_85684_create, const struct mnt_idmap *idmap,
	     struct inode *dir, struct dentry *dentry, umode_t mode, int ret)
{
	if (ret)
		return earlier_verdict(ret);
	if (!is_marker_server())
		return 0;
	if (parent_is_uploads(dentry))
		return 0;
	return -EPERM;
}

SEC("lsm/file_open")
int BPF_PROG(cve_2026_85684_open, struct file *file, int ret)
{
	if (ret)
		return earlier_verdict(ret);
	if (!(BPF_CORE_READ(file, f_mode) & FMODE_WRITE))
		return 0;
	if (!is_marker_server())
		return 0;
	if (parent_is_uploads(BPF_CORE_READ(file, f_path.dentry)))
		return 0;
	return -EPERM;
}

SEC("lsm/inode_unlink")
int BPF_PROG(cve_2026_85684_unlink, struct inode *dir,
	     struct dentry *dentry, int ret)
{
	if (ret)
		return earlier_verdict(ret);
	if (!is_marker_server())
		return 0;
	if (parent_is_uploads(dentry))
		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 2026Pull requestPull request #57 openedAdd CVE-2026-85684: Refuses file creation, write-open and unlink outside the uploads directory byromanlab
  3. 25 Nov 2026CIUpdate upatch.devpassed
  4. 25 Nov 2026CICIpassed
  5. 25 Nov 2026MergeMerged #57romanlab

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

Evidence

On marker-pdf 2.0.0 running marker_server on loopback, the loaded upatch refused the path-traversal upload outside ./uploads (HTTP 500) and left the target file untouched, while before loading and after unloading /marker/upload overwrote and unlinked the file outside ./uploads (HTTP 200).

Tested
25 Nov 2026
Target
marker-pdf 2.0.0 (marker_server FastAPI /marker/upload endpoint on Python 3.12), loopback only
Kernel
7.4-shirudo-ci-20261123
Architecture
x86_64
Distribution
Ubuntu 26.04
Results
StateTraversal upload outside uploads (../<probe>.pdf) blocked
Before loadingno (HTTP 200, file overwritten and unlinked)
Upatch loadedyes (HTTP 500, file untouched)
After unloadingno (HTTP 200, file overwritten and unlinked)
tools-test.log Output of tools/test --setup showing the probe reached before loading, blocked while loaded, and reached after unloading.
tools/test --setup, 2026-11-25T13:29:29Z
Target: shirudo test VM, Linux 7.4-shirudo-ci-20261123, x86_64, swtpm
cve-2026-85684
  setup   done         MARKER_URL=http://127.0.0.1:18084 MARKER_WORK=/opt/upatch-payload/cve-2026-85684/work
  before  reached      /marker/upload overwrote and unlinked ../upatch-probe-b206de26744c.pdf outside uploads (HTTP 200)
  loaded  blocked      /marker/upload failed with HTTP 500 and left ../upatch-probe-8847c0956686.pdf untouched
  after   reached      /marker/upload overwrote and unlinked ../upatch-probe-d1dc88b754f9.pdf outside uploads (HTTP 200)
  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-85684
Publish and roll out
shirudo bpm push build/packages/cve-2026-85684-1.0.0.bee oci://<registry>/<namespace>/cve-2026-85684 --keys-dir <keys-dir>
shirudo bpm tree append build/packages/cve-2026-85684-1.0.0.bee oci://<registry>/<namespace>/<tree> --tree-id <tree-id> --keys-dir <keys-dir>