CVE-2016-5851
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.
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
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 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - CVSS 2.0
- 6.8 Medium
AV: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 High
CVSS: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 High
CVSS: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 High
CVSS: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 High
CVSS: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 High
CVSS: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
| Package | Affected | Fixed |
|---|---|---|
python-docxPyPI |
through 0.8.5 | 0.8.6 |
python-docxPyPI |
before 0.8.6, plus listed versions 0.3.0a10.3.0a20.3.0a30.3.0a40.3.0a5 Show 20 moreShow less0.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
| Recorded | Changed | Sources |
|---|---|---|
| aliases | EUVD | |
| first indexed | CVE 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
openwall.com/lists/oss-security/2016/06/28/7
openwall.com/lists/oss-security/2016/06/28/8
github.com/python-openxml/python-docx/blob/v0.8.6/HISTORY.rst
securityfocus.com/bid/91485
lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/6FFMOH7ZPOPQWNJGUZOS5LXX4MGNRXXT
lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/XU2WSYRNB7CLBBFCGSX34XHACTA2SWDZ
Show 8 moreShow less
github.com/python-openxml/python-docx/commit/61b40b161b64173ab8e362aec1fd197948431beb
nvd.nist.gov/vuln/detail/CVE-2016-5851
github.com/pypa/advisory-database/tree/main/vulns/python-docx/PYSEC-2016-21.yaml
web.archive.org/web/20170214030949/http://www.securityfocus.com/bid/91485
github.com/advisories/GHSA-34wj-p5jm-2p96
lists.fedoraproject.org/archives/list/[email protected]/message/6FFMOH7ZPOPQWNJGUZOS5LXX4MGNRXXT
lists.fedoraproject.org/archives/list/[email protected]/message/XU2WSYRNB7CLBBFCGSX34XHACTA2SWDZ
github.com/python-openxml/python-docx