GHSA-m8gf-v64p-gfmg: BabelDOC: Arbitrary Code Execution via CMap Pickle Deserialization in babeldoc/pdfminer/cmapdb.py
BabelDOC versions prior to 0.6.3 contain a vulnerability in the PDF parser component where untrusted pickle data is deserialized without proper path validation. An attacker can craft a PDF with a specially encoded CMap name that causes the software to load and deserialize arbitrary pickle files from attacker-controlled locations, leading to arbitrary code execution with the privileges of the BabelDOC process.
AI Analysis
Technical Summary
The vulnerability exists in BabelDOC's vendored PDF parser (babeldoc/pdfminer/cmapdb.py) in the _load_data() method, which deserializes pickle data from CMap files. The method strips only NUL bytes from a PDF-controlled CMap name and constructs a filename that is joined with trusted directories using os.path.join(). However, if the CMap name is an absolute path (achieved via PDF hex-encoding), os.path.join() discards the trusted directory and uses the absolute path directly. This allows an attacker to redirect deserialization to any attacker-writable .pickle.gz file on the local system. Since pickle.loads() is called unconditionally on this file, arbitrary Python code execution can occur. There is no path containment check or allowlist of CMap names, and no integrity verification of the pickle data. The vulnerability is identified as CWE-502 (Deserialization of Untrusted Data).
Potential Impact
Successful exploitation allows an attacker to execute arbitrary Python code with the privileges of the BabelDOC process by controlling the deserialized pickle data. This can lead to full compromise of the host system or further attacks depending on the environment and privileges of BabelDOC.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. The recommended patch involves validating that the resolved file path is contained within trusted directories by using os.path.realpath() and os.path.commonpath() before deserializing pickle data. Until a patch is applied, avoid processing untrusted PDFs with BabelDOC or run BabelDOC with minimal privileges and in isolated environments to limit impact.
GHSA-m8gf-v64p-gfmg: BabelDOC: Arbitrary Code Execution via CMap Pickle Deserialization in babeldoc/pdfminer/cmapdb.py
Description
BabelDOC versions prior to 0.6.3 contain a vulnerability in the PDF parser component where untrusted pickle data is deserialized without proper path validation. An attacker can craft a PDF with a specially encoded CMap name that causes the software to load and deserialize arbitrary pickle files from attacker-controlled locations, leading to arbitrary code execution with the privileges of the BabelDOC process.
CVSS v3.1
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability exists in BabelDOC's vendored PDF parser (babeldoc/pdfminer/cmapdb.py) in the _load_data() method, which deserializes pickle data from CMap files. The method strips only NUL bytes from a PDF-controlled CMap name and constructs a filename that is joined with trusted directories using os.path.join(). However, if the CMap name is an absolute path (achieved via PDF hex-encoding), os.path.join() discards the trusted directory and uses the absolute path directly. This allows an attacker to redirect deserialization to any attacker-writable .pickle.gz file on the local system. Since pickle.loads() is called unconditionally on this file, arbitrary Python code execution can occur. There is no path containment check or allowlist of CMap names, and no integrity verification of the pickle data. The vulnerability is identified as CWE-502 (Deserialization of Untrusted Data).
Potential Impact
Successful exploitation allows an attacker to execute arbitrary Python code with the privileges of the BabelDOC process by controlling the deserialized pickle data. This can lead to full compromise of the host system or further attacks depending on the environment and privileges of BabelDOC.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. The recommended patch involves validating that the resolved file path is contained within trusted directories by using os.path.realpath() and os.path.commonpath() before deserializing pickle data. Until a patch is applied, avoid processing untrusted PDFs with BabelDOC or run BabelDOC with minimal privileges and in isolated environments to limit impact.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-m8gf-v64p-gfmg
- Osv Schema Version
- 1.4.0
- Aliases
- ["CVE-2026-54071"]
- Ecosystems
- ["PyPI"]
- Database Specific Severity
- HIGH
- Cvss Version
- 3.1
Threat ID: 6a520eb368715ace438f526a
Added to database: 07/11/2026, 09:36:51 UTC
Last enriched: 07/11/2026, 09:49:47 UTC
Last updated: 07/12/2026, 03:34:20 UTC
Views: 10
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.