PyPI: python-docx

CVE-2016-5851

Safety vulnerability ID: SFTY-20161221-17629

Safety legacy ID: pyup.io-26081

Python-docx 0.8.6 includes a fix for CVE-2016-5851: context-dependent attackers were able to conduct XML External Entity (XXE) attacks via a crafted document.

Created at: May 7, 2026Updated at: May 7, 2026

Overview

Improper Restriction of XML External Entity Reference in python-docx

Advisory

Python-docx 0.8.6 includes a fix for CVE-2016-5851: context-dependent attackers were able to conduct XML External Entity (XXE) attacks via a crafted document.

Affected Package

Affecting python-docx package, versions
<0.8.6

Also affects

---

How to Fix

Upgrade
python-docx
to
0.8.6
or higher.

Mitigation and Workarounds

---

Vulnerable Functions

Functions linked to known vulnerabilities.

Vulnerable function data is available for Enterprise customers

Book a call with us to see Safety in action.

References

Safety

Verified by Safety

Our Cybersecurity Intelligence Team reviewed this vulnerability. We combine public data with our own research to find issues not yet reported to public sources.

Learn more