/

CVE-2026-85684

Severity:

CRITICAL RISK

(9.1)

Path Traversal (CWE-73) in Marker FastAPI Upload Handler

CVE-2026-85684

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-73

Impact:

Arbitrary File Write and File Deletion

Severity:

CRITICAL RISK

(9.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A path traversal vulnerability in Marker's FastAPI /marker/upload handler allows unauthenticated attackers to submit filenames containing directory traversal sequences. If the server processes these filenames without enforcing a safe storage location, an attacker may write arbitrary files or delete existing files.

Affected context

The vulnerability occurs in deployments that expose the FastAPI /marker/upload endpoint and use the client-controlled file.filename value when constructing filesystem paths. Risk is higher when the service runs with permissions to modify sensitive directories or when uploaded files are processed before their names are normalized and constrained to an intended storage directory.

Exploit preconditions

  • Attack surface: The publicly reachable FastAPI /marker/upload endpoint
  • Required access: No authentication may be required
  • Trigger point: Upload handling when the supplied filename is used in a filesystem operation
  • Why exploitation is possible: Directory traversal sequences can cause the resolved path to escape the intended upload directory, enabling unauthorized file writes or deletion where process permissions allow

Why this happens

The underlying bug is reliance on an externally supplied filename without securely resolving and validating its filesystem path. This is an instance of CWE-73: External Control of File Name or Path, where attacker-controlled input influences a file operation and can alter the target location. The insecure pattern is treating a client-provided name as a trusted path component instead of reducing it to a safe identifier and enforcing containment within an approved directory.

Potential impact

  • An attacker may overwrite application, configuration, or operational files
  • An attacker could delete files accessible to the service account
  • The application may experience denial of service or startup failures
  • File writes could enable follow-on code execution depending on file type, location, and runtime permissions
  • Sensitive data may be altered or operational integrity compromised

General mitigation guidance

Mitigation generally focuses on removing trust from client-controlled filenames and enforcing filesystem boundaries.

Common defensive patterns include:

  • Generate server-side filenames or use opaque object identifiers rather than preserving client-supplied paths
  • Normalize and validate names before any filesystem operation
  • Resolve the final path and verify that it remains within a dedicated upload directory
  • Reject absolute paths, traversal components, unexpected separators, and ambiguous encodings
  • Separate uploaded content from executable, configuration, and system directories
  • Apply least-privilege permissions to the service account and filesystem
  • Use controlled file APIs and explicit allowlists for permitted storage locations
  • Avoid destructive file operations based solely on request-supplied names

How teams detect issues like this

High-level detection approaches include:

  • Static analysis rules that identify request filename values flowing into path joins, open, rename, unlink, or delete operations
  • Code review checks for direct use of multipart filename fields in filesystem paths
  • Tests covering traversal markers, absolute paths, encoded separators, and platform-specific path syntax
  • Runtime logging of normalized and rejected upload names without recording sensitive content
  • Web application firewall or API policy rules that reject suspicious path components
  • File-integrity monitoring for unexpected changes outside the designated upload area
  • Automated security review tools that flag externally controlled path construction

Sources

SourceLink
github.comgithub.com/datalab-to/marker
github.comgithub.com/datalab-to/marker/blob/v2.0.0/marker/scripts/server.py
github.comgithub.com/datalab-to/marker/issues/1047
vulncheck.comvulncheck.com/advisories/marker-through-2.0.0-path-traversal-via-upload-filename

Frequently asked

questions

Yes. If the /marker/upload endpoint is reachable without authentication, an attacker may be able to submit a crafted filename remotely. The resulting impact depends on filesystem permissions and deployment controls.

The attacker generally needs network access to the upload endpoint. No authenticated account may be necessary when the endpoint is exposed anonymously.

Do not use client-provided filenames as filesystem paths. Generate server-side names, constrain all resolved paths to a dedicated upload directory, and reject inputs that cannot be safely normalized.

Apply strict path-handling policies, use least-privilege service accounts, isolate uploaded content from executable and configuration locations, and include traversal-focused tests and static analysis in the development pipeline.

Find out what's already
exploitable in your codebase.