Skip to content
OpenAdvisories
Unscored CVE-2017-9047 EUVD-2017-17987GHSA-m5m9-w72w-8c23

A buffer overflow was discovered in libxml2 20904-GITv2.9.4-16-g0741801. The function xmlSnprintfElementContent in valid.c is supposed to r…

Published May 18, 2017 · Updated Oct 14, 2026 · Assigned by mitre

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.

ReleasePackageFixed inAdvisory
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)
ReleasePackageFixed inAdvisory
Debian 7 libxml2 2.8.0+dfsg1-7+wheezy8 DLA-1008-1
ReleasePackageFixed inAdvisory
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
ReleasePackageFixed inAdvisory
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)
ReleasePackageFixed inAdvisory
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
ReleasePackageFixed inAdvisory
openSUSE Tumbleweed libxml2 2.9.12-1.2 openSUSE-SU-2024:11016-1

Advisories 12

References