{"id":"CVE-2016-5851","aliases":["EUVD-2016-0027","GHSA-34wj-p5jm-2p96","PYSEC-2016-21"],"status":"published","title":"Improper Restriction of XML External Entity Reference in python-docx","description":"python-docx before 0.8.6 allows context-dependent attackers to conduct XML External Entity (XXE) attacks via a crafted document.","severity":{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","level":"high","assessor":"primary","from":"nvd"},"epss":{"day":"2026-11-08","score":0.02354,"percentile":0.83839,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-611"],"published":"2016-12-21T00:00:00Z","modified":"2026-10-20T10:47:29Z","fixes":[{"ecosystem":"PyPI","package":"python-docx","fixed_in":["0.8.6"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"PyPI","package":"python-docx","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"0.8.5"},{"fixed":"0.8.6"}]}]},{"source":"osv","ecosystem":"PyPI","package":"python-docx","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.8.6"}]}],"versions":["0.3.0a1","0.3.0a2","0.3.0a3","0.3.0a4","0.3.0a5","0.3.0dev1","0.4.0","0.5.0","0.5.1","0.5.2","0.5.3","0.6.0","0.7.0","0.7.1","0.7.2","0.7.3","0.7.4","0.7.5","0.7.6","0.8.0","0.8.1","0.8.2","0.8.3","0.8.4","0.8.5"]},{"source":"osv","ecosystem":"PyPI","package":"python-docx","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.8.6"}]}],"versions":["0.3.0a1","0.3.0a2","0.3.0a3","0.3.0a4","0.3.0a5","0.3.0dev1","0.4.0","0.5.0","0.5.1","0.5.2","0.5.3","0.6.0","0.7.0","0.7.1","0.7.2","0.7.3","0.7.4","0.7.5","0.7.6","0.8.0","0.8.1","0.8.2","0.8.3","0.8.4","0.8.5"]}],"products":[{"vendor":"python-openxml_project","product":"python-docx"}],"references":[{"url":"http://www.openwall.com/lists/oss-security/2016/06/28/7","tags":["mailing-list","x_transferred","Mailing List","Patch","Third Party Advisory","fix","web"]},{"url":"http://www.openwall.com/lists/oss-security/2016/06/28/8","tags":["mailing-list","x_transferred","Mailing List","Third Party Advisory","advisory","web"]},{"url":"https://github.com/python-openxml/python-docx/blob/v0.8.6/HISTORY.rst","tags":["x_transferred","Patch","Release Notes","Vendor Advisory","fix","web"]},{"url":"http://www.securityfocus.com/bid/91485","tags":["vdb-entry","x_transferred","Third Party Advisory","VDB Entry","advisory","web"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/6FFMOH7ZPOPQWNJGUZOS5LXX4MGNRXXT/","tags":["vendor-advisory","x_transferred","web"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/XU2WSYRNB7CLBBFCGSX34XHACTA2SWDZ/","tags":["vendor-advisory","x_transferred","web"]},{"url":"https://github.com/python-openxml/python-docx/commit/61b40b161b64173ab8e362aec1fd197948431beb","tags":["x_transferred","fix","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2016-5851","tags":["advisory"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/python-docx/PYSEC-2016-21.yaml","tags":["web"]},{"url":"https://web.archive.org/web/20170214030949/http://www.securityfocus.com/bid/91485","tags":["web"]},{"url":"https://github.com/advisories/GHSA-34wj-p5jm-2p96","tags":["advisory"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/6FFMOH7ZPOPQWNJGUZOS5LXX4MGNRXXT","tags":["web"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/XU2WSYRNB7CLBBFCGSX34XHACTA2SWDZ","tags":["web"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/6FFMOH7ZPOPQWNJGUZOS5LXX4MGNRXXT","tags":["web"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/XU2WSYRNB7CLBBFCGSX34XHACTA2SWDZ","tags":["web"]},{"url":"https://github.com/python-openxml/python-docx","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2016-5851","description":"python-docx before 0.8.6 allows context-dependent attackers to conduct XML External Entity (XXE) attacks via a crafted document.","status":"published","published":"2016-12-21T00:00:00Z","modified":"2024-08-06T01:15:10.802Z","updated_at":"2026-11-02T14:33:30.767029Z"}],"euvd":[{"id":"EUVD-2016-0027","description":"python-docx before 0.8.6 allows context-dependent attackers to conduct XML External Entity (XXE) attacks via a crafted document.","status":"published","published":"2016-12-21T00:00:00Z","modified":"2024-08-06T01:15:10Z","updated_at":"2026-11-03T02:22:41.580609Z"}],"ghsa":[{"id":"GHSA-34wj-p5jm-2p96","title":"Improper Restriction of XML External Entity Reference in python-docx","description":"python-docx before 0.8.6 allows context-dependent attackers to conduct XML External Entity (XXE) attacks via a crafted document.","status":"published","published":"2022-05-13T01:06:10Z","modified":"2024-10-25T21:18:54Z","cvss":[{"version":"4.0","score":8.7,"vector":"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","level":"high"},{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","level":"high"}],"cwes":["CWE-611"],"updated_at":"2026-11-02T14:38:13.09489Z"}],"nvd":[{"id":"CVE-2016-5851","description":"python-docx before 0.8.6 allows context-dependent attackers to conduct XML External Entity (XXE) attacks via a crafted document.","status":"published","published":"2016-12-21T22:59:00.17Z","modified":"2026-06-17T00:50:08.803Z","cvss":[{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","level":"high","assessor":"primary"},{"version":"2.0","score":6.8,"vector":"AV:N/AC:M/Au:N/C:P/I:P/A:P","level":"medium","assessor":"primary"}],"cwes":["CWE-611"],"updated_at":"2026-11-02T14:03:32.79141Z"}],"osv":[{"id":"CVE-2016-5851","description":"python-docx before 0.8.6 allows context-dependent attackers to conduct XML External Entity (XXE) attacks via a crafted document.","status":"published","published":"2016-12-21T22:59:00.17Z","modified":"2026-10-20T10:47:29.914617308Z","cvss":[{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","level":"high"}],"updated_at":"2026-11-02T15:44:02.776224Z"},{"id":"GHSA-34wj-p5jm-2p96","title":"Improper Restriction of XML External Entity Reference in python-docx","description":"python-docx before 0.8.6 allows context-dependent attackers to conduct XML External Entity (XXE) attacks via a crafted document.","status":"published","published":"2022-05-13T01:06:10Z","modified":"2024-10-25T21:25:18.720989Z","cvss":[{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","level":"high"},{"version":"4.0","score":8.7,"vector":"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","level":"high"}],"cwes":["CWE-611"],"updated_at":"2026-11-02T15:46:35.050232Z"},{"id":"PYSEC-2016-21","description":"python-docx before 0.8.6 allows context-dependent attackers to conduct XML External Entity (XXE) attacks via a crafted document.","status":"published","published":"2016-12-21T22:59:00Z","modified":"2023-11-08T03:58:32.00063Z","updated_at":"2026-11-02T15:52:51.645172Z"}]}}
