A buffer overflow was discovered in libxml2 20904-GITv2.9.4-16-g0741801. The function xmlSnprintfElementContent in valid.c is supposed to recursively dump the element content definition into a char buffer 'buf' of size 'size'. The variable len is assigned strlen(buf). If the content->type is XML_ELEMENT_CONTENT_ELEMENT, then (i) the content->prefix is appended to buf (if it actually fits) whereupon (ii) content->name is written to the buffer. However, the check for whether the content->name actually fits also uses 'len' rather than the updated buffer length strlen(buf). This allows us to write about "size" many bytes beyond the allocated memory. This vulnerability causes programs that use libxml2, such as PHP, to crash.
CVSS Details
- CVSS 3.0 Base Score: 7.5
- CVSS 3.0 Vector: (CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H)
Covered by Rapid7
| Product | Vendor Advisory | Solution File | Added | Published |
|---|---|---|---|---|
| Debian | — | Upgrade libxml2 | Aug 23, 2017 | May 18, 2017 |
| Freebsd | — | Upgrade libxml2 | Dec 14, 2017 | Dec 13, 2017 |
| Gentoo Linux | — | Upgrade dev-libs/libxml2. | Nov 13, 2017 | May 18, 2017 |
| Huawei Euleros 2_0_sp1 | — | Upgrade libxml2Upgrade libxml2-develUpgrade libxml2-python | Nov 30, 2017 | May 18, 2017 |
| Huawei Euleros 2_0_sp2 | — | Upgrade libxml2Upgrade libxml2-develUpgrade libxml2-python | Nov 30, 2017 | May 18, 2017 |
| Ibm Aix | — | — | Jun 5, 2025 | Jun 4, 2025 |
| Oracle Solaris | — | Upgrade library/python/libxml2-27 to version 2.9.5-0.175.3.27.0.1.0 on Solaris 11.3Upgrade library/python/libxml2-34 to version 2.9.5-0.175.3.27.0.1.0 on Solaris 11.3Upgrade library/libxml2 to version 2.9.5-0.175.3.27.0.1.0 on Solaris 11.3 | Jan 19, 2021 | May 18, 2017 |
| Redhat_linux | — | No solution exists | Jul 9, 2025 | May 15, 2017 |
| Suse | — | Upgrade libxml2-2-32bitUpgrade libxml2-32bitUpgrade libxml2-docUpgrade python2-libxml2-pythonUpgrade libxml2-pythonUpgrade libxml2-toolsUpgrade python3-libxml2-pythonUpgrade libxml2Upgrade sles12-docker-imageUpgrade libxml2-x86Upgrade python-libxml2Upgrade sles12sp2-docker-imageUpgrade sles12sp1-docker-imageUpgrade libxml2-develUpgrade libxml2-2Upgrade libxml2-devel-32bit | May 31, 2017 | May 18, 2017 |
| Ubuntu | — | Upgrade libxml2 | Sep 19, 2017 | May 18, 2017 |
Prioritise with Active Threat Intelligence
With curated Threat Intelligence, you can see which vulnerabilities truly put you at risk, prioritize what matters most, and act before attackers do.
Explore Intelligence Hub