CVE-2026-82035
massPath Traversal Arbitrary File Write in PyMuPDF extract_objects CLI
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.
| Artifex Software PyMuPDF | All versions through 1.28.2 (fixed in commit b2c8f3a; no fixed release version stated in the advisory) |
Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.
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 news0 stories
No ingested article mentions this CVE yet.