Docling's METS GBS backend is vulnerable to XML Entity Expansion (XXE) attacks
Date: 2026-05
Affected: pip/docling
Attack vector: dos
Category: vulnerability-disclosure
Severity: High
CVE: CVE-2026-31247
CVE-2026-31248
CWE: CWE-400
CWE-776
CVSS: 7.5 (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H)

Docling's METS GBS backend is vulnerable to XML Entity Expansion (XXE) attacks thru 2.61.0. The backend extracts and validates XML files from .tar.gz archives using etree.fromstring() without disabling entity resolution. An attacker can craft a malicious XML file with nested entity definitions (XML Bomb) and package it into a .tar.gz archive. When processed by Docling, the exponential expansion of entities during XML parsing leads to excessive resource consumption, resulting in a denial of service (DoS) condition on the system running the Docling parser.


Mitigations:

Architectural layers (MAESTRO):