CVE-2016-5851: Improper Restriction of XML External Entity Reference in python-docx
8.8
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.74662%
CWE
Published
5/13/2022
Updated
10/25/2024
KEV Status
No
Technology
Python
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
python-docx | pip | <= 0.8.5 | 0.8.6 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability arises from the use of XML parsers configured to resolve external entities in two files: 'docx/opc/oxml.py' and 'docx/oxml/init.py'. In versions ≤0.8.5, these parsers were initialized with resolve_entities=True (the default), enabling XXE attacks. The patch explicitly sets resolve_entities=False in both locations. These parsers are used to process XML content in DOCX files, and their insecure configuration allowed malicious documents to trigger entity resolution, leading to the XXE vulnerability.