ZeroHour

CVE-2026-82035

mass

Path Traversal Arbitrary File Write in PyMuPDF extract_objects CLI

CVSS 4.0
7.1 high
EPSS
Published
()
Modified
AI analysis

PyMuPDF through 1.28.2 contains a path traversal flaw (CWE-22) in the font branch of extract_objects() in src/__main__.py, where extracted font filenames are built by joining a document-controlled BaseFont name directly onto the user-supplied output directory without stripping path separators or dot-dot sequences. An attacker crafts a PDF, EPUB, XPS, or FB2 file whose BaseFont name contains encoded separators that decode to ../ sequences or absolute paths; when a victim runs PyMuPDF's extract command on the file, the tool writes attacker-chosen files outside the intended output directory. Successful exploitation yields arbitrary file writes with the victim's privileges — no authentication or elevated rights are required — which can be used to overwrite configuration files, startup scripts, or other sensitive paths and potentially achieve code execution. The flaw affects any user or automated pipeline that invokes extraction on untrusted documents using PyMuPDF through 1.28.2, with the fix landing in commit b2c8f3a. There is no known public proof of concept and no evidence of exploitation in the wild, though the CVSS 4.0 base score of 7.1 (high) reflects high impact on integrity.

What to do: Upgrade PyMuPDF to a build that includes fix commit b2c8f3a (any release newer than 1.28.2 once published). Until then, do not run `pymupdf extract` / `python -m fitz extract` on untrusted PDF, EPUB, XPS, or FB2 files; if extraction of untrusted input is required, run it in a sandboxed container as an unprivileged user with write access restricted to a dedicated output directory. Check pipelines and automated services that batch-extract embedded fonts from user-supplied documents for files written outside expected output paths.

Affected
Artifex Software PyMuPDFAll versions through 1.28.2 (fixed in commit b2c8f3a; no fixed release version stated in the advisory)
Estimated exposure
massMillions of installations potentially exposed at the library level (PyMuPDF records millions of monthly PyPI downloads), but only the subset invoking the… — Estimated from PyMuPDF's multi-million monthly PyPI download volume indicating a large installed base, discounted because the vulnerable code path is limited to the extract_objects()/extract command-line workflow.

Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.

Description

PyMuPDF through 1.28.2, fixed in commit b2c8f3a, contains a path traversal vulnerability in the font branch of extract_objects() in src/__main__.py, where the output filename is constructed by joining a document-controlled BaseFont name directly onto the user-supplied output directory without stripping path separators or dot-dot sequences. Attackers can supply a crafted PDF, EPUB, XPS, or FB2 file with a BaseFont name containing encoded path separators that decode to ../ sequences or absolute paths, causing arbitrary file writes outside the intended output directory without requiring authentication or elevated privileges.

Weakness
CWE-22
Vector
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:H/VA:L/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

In the news

No ingested article mentions this CVE yet.