CVE-2016-5851 · mitre
CVE-2016-5851
python-docx before 0.8.6 allows context-dependent attackers to conduct XML External Entity (XXE) attacks via a crafted document.
Published 2016-12-21, last changed 2026-06-17. Weakness: CWE-611.
How to fix
Upgrade to a fixed version: python-docx 0.8.6 (PyPI). For the version that clears every advisory for your installed version, ask an agent for get_remediation.
Where the flaw is in the code
Fixed in python-openxml/python-docx by 61b40b161b. The fix changed source code, but no function could be located in it. Confidence: inferred (code changed near the fix, but no record names this exact commit as the fix).
Timeline
| 2016-12-21 | Published |
| 2016-12-21 | Package advisory PYSEC-2016-21 |
| 2022-05-13 | Package advisory GHSA-34wj-p5jm-2p96 |
| 2026-06-17 | Record last changed |
| 2026-11-30 | EPSS when our history starts: 2.35% |
| 2026-12-02 | Code-level analysis added |
Affected packages
| Advisory | Package | Fixed in |
|---|---|---|
| GHSA-34wj-p5jm-2p96 | python-docx (PyPI) | 0.8.6 |
| PYSEC-2016-21 | python-docx (PyPI) | 0.8.6 |
Also known as: GHSA-34wj-p5jm-2p96, PYSEC-2016-21
Related
| CVE | Published | CVSS | Summary |
|---|---|---|---|
| CVE-2026-123029 | 2026-11-05 | 7.5 | same weakness (CWE-611) from the same CNA (mitre) |
| CVE-2026-79572 | 2026-09-08 | 7.5 | same weakness (CWE-611) from the same CNA (mitre) |
| CVE-2026-50782 | 2026-07-29 | 7.5 | same weakness (CWE-611) from the same CNA (mitre) |
| CVE-2026-51080 | 2026-07-17 | 9.8 | same weakness (CWE-611) from the same CNA (mitre) |
| CVE-2026-39053 | 2026-05-15 | 6.5 | same weakness (CWE-611) from the same CNA (mitre) |
| CVE-2023-42346 | 2026-05-08 | 7.5 | same weakness (CWE-611) from the same CNA (mitre) |
| CVE-2023-42344 | 2026-05-08 | 7.3 | same weakness (CWE-611) from the same CNA (mitre) |
| CVE-2026-38429 | 2026-05-05 | 9.8 | same weakness (CWE-611) from the same CNA (mitre) |
Add it to your agent
One command for Claude Code; setup for Claude Desktop, Cursor and others. No signup or key.
claude mcp add --transport http keygraph-cve https://cve-mcp.keygraph.io/mcp
Then ask for triage_cve CVE-2016-5851, or call /api/v1/vulnerabilities/CVE-2016-5851. To prove whether it is exploitable in your running app, run Shannon, Keygraph's open-source AI pentester.