High, CVSS 7.8PyPIAmendedPublished
BabelDOC: Arbitrary Code Execution via CMap Pickle Deserialization in babeldoc/pdfminer/cmapdb.py
CVE-2026-54071 · GHSA-m8gf-v64p-gfmg
- Affected
- PyPI babeldoc <= 0.6.2
- Fixed in
- 0.6.3· Vendor fix available
- Issue
- Arbitrary Code Execution via CMap Pickle Deserialization in babeldoc/pdfminer/cmapdb.py Summary BabelDOC's vendored PDF parser (babeldoc/pdfminer/cmapdb.py) deserializes untrusted pickle data when loading CMap files. The loaddata() method strips only NUL bytes from a PDF-controlled CMap name, then passes it directly to os.path.join() and pickle.loads(). Because Python's os.path.join() discards all preceding path components when it encounters an absolute path segment, an attacker who embeds a hex-encoded absolute path in a crafted PDF's /Encoding name (e.g., /#2Ftmp#2Fattacker#2Fevil) can redirect deserialization to any attacker-writable .pickle.gz file on the local system. Processing such a PDF results in arbitrary Python code execution with the privileges of the BabelDOC process. Details The vulnerable function is CMapDB.loaddata() at babeldoc/pdfminer/cmapdb.py:232–245: Path injection via PDF name hex-encoding. The PDF specification allows name objects to encode arbitrary bytes as…
Recommended action: Upgrade to 0.6.3 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.