# CVE-2026-85684: marker through 2.0.0 Path Traversal via upload filename

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

## At a glance

CVE-2026-85684 is rated High 8.8 (CVSS 4.0, CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:H/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 Marker (datalab-to) and was published on 4 Sept 2026. It is not in CISA's Known Exploited Vulnerabilities catalog. Its EPSS score is 1.1%: the estimated chance it is exploited in the next 30 days, as of 24 Nov 2026. The upatch `cve-2026-85684-upload-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-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.

## What the upatch does

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.

The policy: [`cve-2026-85684-upload-block.bpf.c`](https://github.com/copper-helm/upatch-registry/tree/main/upatches/cve-2026-85684), 86 lines of BPF C attached at `lsm/inode_create`, `lsm/file_open` and `lsm/inode_unlink`, licensed GPL-2.0 OR BSD-2-Clause.

## 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()`.

## 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.

## How it was tested

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

| State           | Traversal upload outside uploads (../\<probe>.pdf) blocked |
| --------------- | ---------------------------------------------------------- |
| Before loading  | no (HTTP 200, file overwritten and unlinked)               |
| Upatch loaded   | yes (HTTP 500, file untouched)                             |
| After unloading | no (HTTP 200, file overwritten and unlinked)               |

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

Publish and roll out:

```sh
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>
```

## Review

- Contributors: romanlab.
- Reviewers: none recorded yet.

## Sources and links

- [CVE-2026-85684 record (CVE API)](https://cveawg.mitre.org/api/cve/CVE-2026-85684)
- [VulnCheck advisory: marker through 2.0.0 Path Traversal via upload filename](https://www.vulncheck.com/advisories/marker-through-2.0.0-path-traversal-via-upload-filename)
- [GitHub issue #1047](https://github.com/datalab-to/marker/issues/1047)
- [Vulnerable code in marker v2.0.0 (`marker/scripts/server.py`)](https://github.com/datalab-to/marker/blob/v2.0.0/marker/scripts/server.py)
- [Fix commit a8c5b209d846](https://github.com/datalab-to/marker/commit/a8c5b209d846c9ac95545e57b26b8919450bd73d)

### Links

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

### More references from NVD (4)

- [github.com](https://github.com/datalab-to/marker)
- [github.com](https://github.com/datalab-to/marker/blob/v2.0.0/marker/scripts/server.py)
- [github.com](https://github.com/datalab-to/marker/issues/1047)
- [vulncheck.com](https://www.vulncheck.com/advisories/marker-through-2.0.0-path-traversal-via-upload-filename)
