Description
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.
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | libxml2 | 2.9.4+dfsg1-3.1 | — |
| Debian 13 | libxml2 | 2.9.4+dfsg1-3.1 | — |
| Debian 12 | libxml2 | 2.9.4+dfsg1-3.1 | — |
| Debian 9 | libxml2 | 2.9.4+dfsg1-2.2+deb9u1 | DSA-3952-1 |
| Debian 8 | libxml2 | 2.9.1+dfsg1-5+deb8u5 | DSA-3952-1 |
Show 1 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 7 | libxml2 | 2.8.0+dfsg1-7+wheezy8 | DLA-1008-1 |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 16.04 LTS | libxml2 | 2.9.3+dfsg1-1ubuntu0.3 | USN-3424-1 |
| Ubuntu 14.04 LTS | libxml2 | 2.9.1+dfsg1-3ubuntu4.10 | USN-3424-1 |
SUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLES 12 SP2 | libxml2 +1 | 2.9.4-36.1 | SUSE-SU-2017:1538-1, SUSE-SU-2017:1454-1 |
| SLES 12 SP1 | libxml2 +1 | 2.9.1-26.15.1 | SUSE-SU-2017:1587-1 |
| SLES 12 | libxml2 +1 | 2.9.1-26.15.1 | SUSE-SU-2017:1587-1 |
| SLES 11 SP4 | libxml2 | 2.7.6-0.69.1 | SUSE-SU-2017:1557-1 |
| SLES 11 SP4 | libxml2-python | 2.7.6-0.69.3 | SUSE-SU-2017:1557-1 |
| SLES 11 SP3 | libxml2 | 2.7.6-0.69.1 | SUSE-SU-2017:1557-1 |
| SLES 11 SP3 | libxml2-python | 2.7.6-0.69.3 | SUSE-SU-2017:1557-1 |
Show 5 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLES for SAP 12 SP2 | libxml2 +1 | 2.9.4-36.1 | SUSE-SU-2017:1538-1, SUSE-SU-2017:1454-1 |
| SLES for SAP 12 SP1 | libxml2 +1 | 2.9.1-26.15.1 | SUSE-SU-2017:1587-1 |
| SLES for SAP 12 | libxml2 +1 | 2.9.1-26.15.1 | SUSE-SU-2017:1587-1 |
| SLES for SAP 11 SP4 | libxml2 | 2.7.6-0.69.1 | SUSE-SU-2017:1557-1 |
| SLES for SAP 11 SP4 | libxml2-python | 2.7.6-0.69.3 | SUSE-SU-2017:1557-1 |
| SUSE Linux Enterprise Point of Sale 11 SP3 | libxml2 | 2.7.6-0.69.1 | SUSE-SU-2017:1557-1 |
| SUSE Linux Enterprise Point of Sale 11 SP3 | libxml2-python | 2.7.6-0.69.3 | SUSE-SU-2017:1557-1 |
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| openSUSE Tumbleweed | libxml2 | 2.9.12-1.2 | openSUSE-SU-2024:11016-1 |
Advisories 12
- SSA-398330 SSA-398330: Vulnerabilities in the additional GNU/Linux subsystem of the SIMATIC S7-1500 CPU 1518(F)-4 PN/DP MFP >= V3.1.0 and < V3.1.5 Siemens ProductCERT · Oct 13, 2026
- USN-3424-1 libxml2 vulnerabilities Ubuntu Security Notices (USN) · Apr 22, 2026
- DSA-3952-1 libxml2 - security update Debian Security (DSA / DLA) · Mar 9, 2026
- DLA-1008-1 libxml2 - security update Debian Security (DSA / DLA) · Mar 9, 2026
- SUSE-SU-2017:1538-1 Security update for libxml2 SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2017:1587-1 Security update for libxml2 SUSE / openSUSE Security Updates · Feb 4, 2026
- openSUSE-SU-2024:11016-1 libxml2-2-2.9.12-1.2 on GA media SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2017:1454-1 Security update for libxml2 SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2017:1557-1 Security update for libxml2 SUSE / openSUSE Security Updates · Feb 4, 2026
- ICSA-23-348-10 Siemens SIMATIC S7-1500 CISA ICS & IT advisories · Aug 12, 2025
- WID-SEC-2025-0426 libxml2: Mehrere Schwachstellen ermöglichen Denial of Service BSI CERT-Bund (WID) · Jul 6, 2025
- WID-SEC-2023-1614 Tenable Security Nessus Network Monitor: Mehrere Schwachstellen BSI CERT-Bund (WID) · Oct 25, 2023
References
- 98599 vdb-entry
- DSA-3952 vendor-advisory
- GLSA-201711-01 vendor-advisory
- http://www.openwall.com/lists/oss-security/2017/05/15/1
- [bookkeeper-issues] 20210628 [GitHub] [bookkeeper] padma81 opened a new issue #2746: Security Vulnerabilities in CentOS 7 image, Upgrade image to CentOS 8 mailing-list
- [bookkeeper-issues] 20210629 [GitHub] [bookkeeper] padma81 opened a new issue #2746: Security Vulnerabilities in CentOS 7 image, Upgrade image to CentOS 8 mailing-list