Safeguard
Vulnerability Analysis•

CVE-2026-82035: High Path Traversal in PyMuPDF extract_objects

PyMuPDF through 1.28.2 can write files outside the output folder when extracting fonts from a crafted PDF. Update past the fix and sandbox extraction.

Safeguard Security Team
4 min read

CVE-2026-82035 is a high severity (CVSS 7.1) path traversal flaw in PyMuPDF through 1.28.2. The font branch of extract_objects() builds filenames from a name inside the document, so a crafted PDF, EPUB, XPS or FB2 file can write outside the chosen directory. The fix is in commit b2c8f3a.

What's affected

The record says PyMuPDF through 1.28.2, with the fix in commit b2c8f3a. The vulnerable code is the font branch of extract_objects() in src/main.py, the command line entry point that dumps objects from a document. It joins the BaseFont name from the document straight onto the output directory you supply, without removing path separators or dot-dot sequences. Crafted PDF, EPUB, XPS or FB2 files can therefore cause files to be written outside the intended folder.

Version note: the VulnCheck advisory I fetched lists the affected range as 1.8.2 and below, which looks like a typo for 1.28.2 given the description beside it. I have used 1.28.2, as the record does. VulnCheck rates it high, 7.1, in line with the record.

I could not confirm a released fixed version. The sources point to the commit, so check the PyMuPDF release notes for the first release that contains it.

How to check if you're exposed

Find the installed version and where it comes from:

pip show pymupdf
pip list | grep -i mupdf

For a project that pins dependencies, search the lock files:

grep -ri pymupdf requirements*.txt poetry.lock Pipfile.lock pyproject.toml

A version of 1.28.2 or lower is in scope. Then ask the more useful question: do you call the extract_objects command or function on files that came from someone else? Many installs of PyMuPDF only render pages or read text and never use that code path. If your code never runs the font extraction branch, the practical exposure is lower, though you should still upgrade.

What to do now

  1. Check the PyMuPDF release notes and upgrade to the first release that includes commit b2c8f3a.
  2. Find every place you run object extraction. If it handles uploaded or downloaded documents, treat it as the priority.
  3. Run extraction as a low privilege user, in a container or temporary directory, so a stray write cannot reach anything that matters.
  4. Never point the output directory at a location that other services read or execute from.
  5. Add a dependency scan to CI so the next PyMuPDF advisory reaches you without anyone having to watch for it.

Why it matters

Path traversal, tracked as CWE-22, is the classic mistake of trusting a name that came from the data. A font name inside a PDF is not a filename, but the code used it as one. Anything that decodes to a parent directory marker or an absolute path then moves the write outside the folder you chose.

Documents are untrusted input in most pipelines: invoices, resumes, user uploads, scraped files. A tool that unpacks parts of them to disk needs to treat every embedded name as hostile. The record does not list this CVE as exploited in the wild. The exposure depends on whether your own code uses this particular function.

Try it yourself

Click through it at your own pace, or open it full screen.

Quick check

Does a crafted file need a login to abuse this?

The record says no authentication or elevated privileges are needed. The file only has to reach a process that runs the font extraction.

Is reading or rendering a PDF affected?

The record describes only the font branch of extract_objects(). Normal page rendering is not described as affected, but check the advisory.

Sources

Last reviewed: 18 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.