CVE-2026-54071

BabelDOC: Arbitrary Code Execution via CMap Pickle Deserialization in babeldoc/pdfminer/cmapdb.py

Published Aug 21, 2026 CVSS 3.1 · 7.8 High EPSS < 1% KEV · Not listed
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.

Analysis

AI-generated

Technical impact

BabelDOC, a document translation tool, contains an untrusted pickle deserialization flaw in its bundled PDF parser. The flaw is triggered when the CMapDB module loads CMap files without properly validating the path name. An attacker can craft a PDF that includes a specially crafted CMap or usecmap operator which, once decoded, points to an attacker-controlled .pickle.gz file placed in the CMap directories. The pickle loader will then execute arbitrary Python code with the permissions of the running BabelDOC process, allowing full system compromise in that environment. The issue is fixed in version 0.6.3, and the vulnerability is now contained to older releases.

Affected Systems

The vulnerability affects funstory-ai’s BabelDOC product. Any installation of BabelDOC older than version 0.6.3 is susceptible, as the code path that deserializes external pickle data remains unpatched in those releases.

Risk and Exploitability

The CVSS score of 7.8 indicates a high severity level. EPSS is not available, so the likelihood of exploitation cannot be quantified, but the lack of a KEV listing suggests no widespread active exploitation has been reported yet. The likely attack vector is via a malicious PDF processed by BabelDOC, which can be delivered locally or potentially over a network if BabelDOC is exposed to external PDF uploads.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade BabelDOC to version 0.6.3 or newer, which removes the vulnerable pickle deserialization logic.
  • Run the BabelDOC process with the least privileges necessary and restrict file system access to the CMap directories so that even if a malicious pickle is loaded, it cannot be written to writable locations that could be leveraged by the attacker.
  • Ensure that only trusted PDFs are processed by BabelDOC; if possible, pre-sanitize or validate incoming PDFs to disallow usecmap operations or to reject any documents that reference external CMap files.

Generated by OpenCVE AI on August 21, 2026 at 20:21 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-m8gf-v64p-gfmg BabelDOC: Arbitrary Code Execution via CMap Pickle Deserialization in babeldoc/pdfminer/cmapdb.py
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Funstory-ai
Funstory-ai babeldoc
Vendors & Products Funstory-ai
Funstory-ai babeldoc
Type Values Removed Values Added
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.
Title BabelDOC: Arbitrary Code Execution via CMap Pickle Deserialization in babeldoc/pdfminer/cmapdb.py
Weaknesses CWE-502
References
Metrics cvssV3_1

{'score': 7.8, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H'}

Weaknesses
  • CWE-502

    Deserialization of Untrusted Data

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Aug 21, 2026, 9:43 PM
Reserved
Jun 11, 2026, 6:24 PM
Status
Deferred
Published
Aug 21, 2026, 7:17 PM
Modified
Oct 14, 2026, 7:10 PM