Every CVE Search/ Get API key

CVE-2016-5851

Improper Restriction of XML External Entity Reference in python-docx

8.8 HighFix available

python-docx before 0.8.6 allows context-dependent attackers to conduct XML External Entity (XXE) attacks via a crafted document.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
Low
Privileges needed
None
User interaction
Required

What an attacker can affect

Confidentiality
High
Integrity
High
Availability
High

Exploit likelihood

2.35%Up 1.2 points since Feb 4, 2022
90%50%10%1%

What each source reports

NVD Score used 8.8

python-docx before 0.8.6 allows context-dependent attackers to conduct XML External Entity (XXE) attacks via a crafted document.

Record
CVE-2016-5851
CVSS 3.1
8.8 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
CVSS 2.0
6.8 MediumAV:N/AC:M/Au:N/C:P/I:P/A:P
Weakness
CWE-611
Updated
2026-11-02
CVE List No score

python-docx before 0.8.6 allows context-dependent attackers to conduct XML External Entity (XXE) attacks via a crafted document.

Record
CVE-2016-5851
Updated
2026-11-02
EUVDEUVD-2016-0027 No score

python-docx before 0.8.6 allows context-dependent attackers to conduct XML External Entity (XXE) attacks via a crafted document.

Record
EUVD-2016-0027
Updated
2026-11-03
GitHub AdvisoriesGHSA-34wj-p5jm-2p96 8.7

Improper Restriction of XML External Entity Reference in python-docx

python-docx before 0.8.6 allows context-dependent attackers to conduct XML External Entity (XXE) attacks via a crafted document.

Record
GHSA-34wj-p5jm-2p96
CVSS 4.0
8.7 HighCVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
CVSS 3.1
8.8 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Weakness
CWE-611
Updated
2026-11-02
OSV 8.8

python-docx before 0.8.6 allows context-dependent attackers to conduct XML External Entity (XXE) attacks via a crafted document.

Record
CVE-2016-5851
CVSS 3.1
8.8 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Updated
2026-11-02
OSVGHSA-34wj-p5jm-2p96 8.7

Improper Restriction of XML External Entity Reference in python-docx

python-docx before 0.8.6 allows context-dependent attackers to conduct XML External Entity (XXE) attacks via a crafted document.

Record
GHSA-34wj-p5jm-2p96
CVSS 4.0
8.7 HighCVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
CVSS 3.1
8.8 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Weakness
CWE-611
Updated
2026-11-02
OSVPYSEC-2016-21 No score

python-docx before 0.8.6 allows context-dependent attackers to conduct XML External Entity (XXE) attacks via a crafted document.

Record
PYSEC-2016-21
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
python-docx
PyPI
through 0.8.5
0.8.6
python-docx
PyPI
before 0.8.6, plus listed versions
0.3.0a10.3.0a20.3.0a30.3.0a40.3.0a5
Show 20 moreShow less
0.3.0dev10.4.00.5.00.5.10.5.20.5.30.6.00.7.00.7.10.7.20.7.30.7.40.7.50.7.60.8.00.8.10.8.20.8.30.8.40.8.5
0.8.6

History

History
RecordedChangedSources
aliasesEUVD
first indexedCVE List, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2016-5851 is a high vulnerability (CVSS 8.8) in Python-openxml Project Python-docx, published December 21, 2016. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 2.35%, the 83rd percentile. Fixed in python-docx 0.8.6.

References

Show 8 moreShow less
MoveEnter Open