CVE-2026-54071 in BabelDOCinfo

Summary

by MITRE • 08/21/2026

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.

Statistical analysis made it clear that VulDB provides the best quality for vulnerability data.

Analysis

by VulDB Data Team • 08/21/2026

BabelDOC is a specialized software utility designed for translating documents, leveraging PDF parsing capabilities to extract and manipulate textual content across languages. A critical security vulnerability was identified within the application's vendored PDF parser component, specifically located in the file babeldoc/pdfminer/cmapdb.py prior to version 0.6.3. This flaw centers on the improper handling of untrusted data during the loading of Character Map files, which are essential for mapping character codes to Unicode values in PDF documents. The vulnerability arises because the application deserializes pickle data without adequate validation or sanitization, creating a direct pathway for remote code execution if an attacker can supply a maliciously crafted PDF file.

The technical root cause lies in how CMapDB._load_data() processes input derived from PDF files. Specifically, values such as Encoding and CMapName extracted from the document structure are processed through functions that fail to adequately restrict path traversal sequences. While the function _normalize_cmap_name() attempts to sanitize inputs by removing a leading slash character, it does not strip other dangerous characters or patterns associated with directory traversal, such as double dots (..) or absolute path indicators. Consequently, when these values are passed into os.path.join(), an attacker can construct file paths that escape the intended trusted CMap directories. By utilizing encoded path separators and carefully crafted input strings, a malicious actor can redirect the application to load arbitrary files from locations writable by the user running BabelDOC.

The operational impact of this vulnerability is severe, as it allows for Arbitrary Code Execution with the privileges of the BabelDOC process. Once an attacker successfully manipulates the file path resolution logic, they can point the parser toward a specially crafted .pickle.gz file hosted in a controlled directory. When CMapDB._load_data() attempts to load and decompress this file, it invokes pickle.loads(), which executes any Python code embedded within the serialized object. This effectively grants an attacker full control over the host system's environment running BabelDOC, potentially leading to data exfiltration, installation of persistent backdoors, or lateral movement within a network if the application is run with elevated permissions.

This vulnerability aligns with CWE-502, which describes Deserialization of Untrusted Data, as well as CWE-22, indicating Improper Limitation of a Pathname to a Restricted Directory. From an offensive security perspective, this attack vector corresponds to ATT&CK technique T1203, Exploitation for Client Execution, where malicious code is delivered via a trusted application's functionality. The failure to validate file paths and the reliance on insecure deserialization practices represent significant deviations from secure coding standards recommended by industry bodies such as OWASP.

To mitigate this risk, users must upgrade BabelDOC to version 0.6.3 or later, where the developers have addressed these flaws by implementing stricter input validation and preventing path traversal attacks within the CMap loading logic. In environments where upgrading is not immediately feasible, it is advisable to restrict file system permissions so that untrusted PDF files cannot influence paths leading to writable directories containing pickle archives. Additionally, employing application whitelisting or sandboxing can limit the impact of potential exploitation by restricting the actions BabelDOC can perform on the host operating system.

Disclosure

08/21/2026

Moderation

accepted

CPE

ready

EPSS

0.00137

KEV

no

Activities

very low

Sources

Are you interested in using VulDB?

Download the whitepaper to learn more about our service!