CVE-2026-54071: CWE-502: Deserialization of Untrusted Data in funstory-ai BabelDOC
BabelDOC is a document translation tool. Prior to 0.6.3, BabelDOC's vendored PDF parser in babeldoc/pdfminer/cmapdb.py deserializes untrusted pickle data when CMapDB._load_data() loads CMap files. PDF-controlled Encoding or CMapName values and embedded PostScript usecmap operators can reach this sink after path separators are decoded, while _normalize_cmap_name() removes only a leading slash. Absolute paths or traversal sequences can escape the trusted CMap directories through os.path.join(), select an attacker-writable .pickle.gz file, and cause pickle.loads() to execute arbitrary Python code with the privileges of the BabelDOC process. This issue is fixed in version 0.6.3.
AI Analysis
Technical Summary
The vulnerability in BabelDOC's vendored PDF parser arises from unsafe deserialization of pickle data in the _load_data() method of babeldoc/pdfminer/cmapdb.py. The method strips only NUL bytes from a PDF-supplied CMap name, then constructs a filename and path using os.path.join(). Because os.path.join() discards preceding path components when an absolute path segment is present, an attacker can embed a hex-encoded absolute path in the PDF's /Encoding name to redirect the deserialization to any attacker-writable .pickle.gz file on the local system. The pickle data is then loaded unconditionally, enabling arbitrary Python code execution. The lack of path containment checks and absence of an allowlist or integrity verification for CMap names contribute to the exploitability of this flaw. A patch is available that enforces realpath resolution and commonpath containment checks to prevent path traversal and unauthorized file loading.
Potential Impact
Successful exploitation allows an attacker to execute arbitrary Python code with the privileges of the BabelDOC process by causing it to deserialize attacker-controlled pickle files. This can lead to full compromise of the host system or the environment in which BabelDOC is running. The vulnerability requires the attacker to supply a crafted PDF file that triggers the unsafe deserialization during processing.
Mitigation Recommendations
A patch is available for BabelDOC that fixes this vulnerability by resolving absolute paths and enforcing containment checks using os.path.realpath() and os.path.commonpath() to ensure that only files within trusted directories are deserialized. Users should upgrade to version 0.6.3 or later. Until patched, avoid processing untrusted PDF files with BabelDOC. There is no indication that the vulnerability is mitigated by default or that no action is required.
CVE-2026-54071: CWE-502: Deserialization of Untrusted Data in funstory-ai BabelDOC
Description
BabelDOC is a document translation tool. Prior to 0.6.3, BabelDOC's vendored PDF parser in babeldoc/pdfminer/cmapdb.py deserializes untrusted pickle data when CMapDB._load_data() loads CMap files. PDF-controlled Encoding or CMapName values and embedded PostScript usecmap operators can reach this sink after path separators are decoded, while _normalize_cmap_name() removes only a leading slash. Absolute paths or traversal sequences can escape the trusted CMap directories through os.path.join(), select an attacker-writable .pickle.gz file, and cause pickle.loads() to execute arbitrary Python code with the privileges of the BabelDOC process. This issue is fixed in version 0.6.3.
CVSS v3.1
Score 7.8high
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 in BabelDOC's vendored PDF parser arises from unsafe deserialization of pickle data in the _load_data() method of babeldoc/pdfminer/cmapdb.py. The method strips only NUL bytes from a PDF-supplied CMap name, then constructs a filename and path using os.path.join(). Because os.path.join() discards preceding path components when an absolute path segment is present, an attacker can embed a hex-encoded absolute path in the PDF's /Encoding name to redirect the deserialization to any attacker-writable .pickle.gz file on the local system. The pickle data is then loaded unconditionally, enabling arbitrary Python code execution. The lack of path containment checks and absence of an allowlist or integrity verification for CMap names contribute to the exploitability of this flaw. A patch is available that enforces realpath resolution and commonpath containment checks to prevent path traversal and unauthorized file loading.
Potential Impact
Successful exploitation allows an attacker to execute arbitrary Python code with the privileges of the BabelDOC process by causing it to deserialize attacker-controlled pickle files. This can lead to full compromise of the host system or the environment in which BabelDOC is running. The vulnerability requires the attacker to supply a crafted PDF file that triggers the unsafe deserialization during processing.
Mitigation Recommendations
A patch is available for BabelDOC that fixes this vulnerability by resolving absolute paths and enforcing containment checks using os.path.realpath() and os.path.commonpath() to ensure that only files within trusted directories are deserialized. Users should upgrade to version 0.6.3 or later. Until patched, avoid processing untrusted PDF files with BabelDOC. There is no indication that the vulnerability is mitigated by default or that no action is required.
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: 08/22/2026, 11:07:27 UTC
Last updated: 09/14/2026, 19:18:43 UTC
Views: 139
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.