CVE-2017-9048
High · 7.5CVSS
7.5
EPSS
4.8%
Published
May 18, 2017
CISA due date
—
Cloudanix analysis
A bug in a widely used library that reads data files can make programs using it suddenly stop working when they receive certain kinds of input.
- Exploitation
- Remote Unauthenticated
- Attacker needs
- None
- Complexity
- Low
- Impact
- Denial Of Service
- Component
- Library
- Class
- Memory Corruption
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Stack-based buffer overflow in xmlSnprintfElementContent allows strcat of two characters without checking if strlen(buf) + 2 fits in the provided size, leading to memory corruption.
Why it matters to the business
Applications using libxml2 for XML handling can crash, causing denial of service and interrupting services that process untrusted or complex XML data.
How an attack unfolds
An attacker crafts XML with element content definitions that exceed the assumed buffer capacity during recursive dumping in validation; when processed by libxml2, the unchecked strcat overflows the stack buffer and terminates the process.
How to fix it
Upgrade libxml2 to a version containing the corrected buffer-length check in xmlSnprintfElementContent; rebuild and redeploy dependent applications such as PHP after the library update.
How to confirm the fix worked
Confirm the running libxml2 shared library reports a version newer than the vulnerable 2.9.4-era commit; fuzz or replay XML containing deeply nested element content to verify absence of crashes.
Typical attack path
- Identify a target application that links against vulnerable libxml2
- Prepare malicious XML containing oversized element content definitions
- Submit the XML through any input path that triggers validation or parsing
- Trigger xmlSnprintfElementContent recursion until the buffer check fails
- Induce application crash via stack corruption
How to detect it
Review application logs and core dumps for segmentation faults or abrupt terminations occurring inside libxml2 validation routines when processing XML; correlate with inbound XML traffic containing complex element declarations.
What your security team should do
- Prioritize patching libxml2 across all systems given public exploit availability
- Scan software bill of materials for any xmlsoft libxml2 usage and schedule upgrades
- Add runtime monitoring for unexpected process terminations in XML-handling services
- Consider sandboxing or input-size limits for XML parsers until patches are applied
The record
libxml2 20904-GITv2.9.4-16-g0741801 is vulnerable to a stack-based buffer overflow. The function xmlSnprintfElementContent in valid.c is supposed to recursively dump the element content definition into a char buffer 'buf' of size 'size'. At the end of the routine, the function may strcat two more characters without checking whether the current strlen(buf) + 2 < size. This vulnerability causes programs that use libxml2, such as PHP, to crash.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Debian:11 | libxml2 | 0 | 2.9.4+dfsg1-3.1 |
| Debian:12 | libxml2 | 0 | 2.9.4+dfsg1-3.1 |
| Debian:13 | libxml2 | 0 | 2.9.4+dfsg1-3.1 |
| Debian:14 | libxml2 | 0 | 2.9.4+dfsg1-3.1 |
| Debian:7 | libxml2 | 0 | 2.8.0+dfsg1-7+wheezy8 |
| Debian:8 | libxml2 | 0 | 2.9.1+dfsg1-5+deb8u5 |
| Debian:9 | libxml2 | 0 | 2.9.4+dfsg1-2.2+deb9u1 |
| Mageia:5 | libxml2 | 0 | 2.9.7-1.mga5 |
| Mageia:5 | perl-XML-LibXML | 0 | 2.12.100-1.2.mga5 |
| SUSE:Linux Enterprise Desktop 12 SP2 | libxml2 | 0 | 2.9.4-36.1 |
| SUSE:Linux Enterprise Desktop 12 SP2 | libxml2 | 0 | 2.9.4-39.2 |
| SUSE:Linux Enterprise Desktop 12 SP2 | python-libxml2 | 0 | 2.9.4-36.1 |
| SUSE:Linux Enterprise Desktop 12 SP2 | python-libxml2 | 0 | 2.9.4-39.2 |
| SUSE:Linux Enterprise Point of Sale 11 SP3 | libxml2 | 0 | 2.7.6-0.69.1 |
| SUSE:Linux Enterprise Point of Sale 11 SP3 | libxml2-python | 0 | 2.7.6-0.69.3 |
| SUSE:Linux Enterprise Server 11 SP3-LTSS | libxml2 | 0 | 2.7.6-0.69.1 |
| SUSE:Linux Enterprise Server 11 SP3-LTSS | libxml2-python | 0 | 2.7.6-0.69.3 |
| SUSE:Linux Enterprise Server 11 SP3-TERADATA | libxml2 | 0 | 2.7.6-0.69.1 |
| SUSE:Linux Enterprise Server 11 SP3-TERADATA | libxml2-python | 0 | 2.7.6-0.69.3 |
| SUSE:Linux Enterprise Server 11 SP4 | libxml2 | 0 | 2.7.6-0.69.1 |
| SUSE:Linux Enterprise Server 11 SP4 | libxml2-python | 0 | 2.7.6-0.69.3 |
| SUSE:Linux Enterprise Server 12 SP1-LTSS | libxml2 | 0 | 2.9.1-26.15.1 |
| SUSE:Linux Enterprise Server 12 SP1-LTSS | python-libxml2 | 0 | 2.9.1-26.15.1 |
| SUSE:Linux Enterprise Server 12 SP2 | libxml2 | 0 | 2.9.4-36.1 |
| SUSE:Linux Enterprise Server 12 SP2 | libxml2 | 0 | 2.9.4-39.2 |
| SUSE:Linux Enterprise Server 12 SP2 | python-libxml2 | 0 | 2.9.4-36.1 |
| SUSE:Linux Enterprise Server 12 SP2 | python-libxml2 | 0 | 2.9.4-39.2 |
| SUSE:Linux Enterprise Server 12-LTSS | libxml2 | 0 | 2.9.1-26.15.1 |
| SUSE:Linux Enterprise Server 12-LTSS | python-libxml2 | 0 | 2.9.1-26.15.1 |
| SUSE:Linux Enterprise Server for Raspberry Pi 12 SP2 | libxml2 | 0 | 2.9.4-36.1 |
| SUSE:Linux Enterprise Server for Raspberry Pi 12 SP2 | libxml2 | 0 | 2.9.4-39.2 |
| SUSE:Linux Enterprise Server for Raspberry Pi 12 SP2 | python-libxml2 | 0 | 2.9.4-36.1 |
| SUSE:Linux Enterprise Server for Raspberry Pi 12 SP2 | python-libxml2 | 0 | 2.9.4-39.2 |
| SUSE:Linux Enterprise Server for SAP Applications 11 SP4 | libxml2 | 0 | 2.7.6-0.69.1 |
| SUSE:Linux Enterprise Server for SAP Applications 11 SP4 | libxml2-python | 0 | 2.7.6-0.69.3 |
| SUSE:Linux Enterprise Server for SAP Applications 12 | libxml2 | 0 | 2.9.1-26.15.1 |
| SUSE:Linux Enterprise Server for SAP Applications 12 | python-libxml2 | 0 | 2.9.1-26.15.1 |
| SUSE:Linux Enterprise Server for SAP Applications 12 SP1 | libxml2 | 0 | 2.9.1-26.15.1 |
| SUSE:Linux Enterprise Server for SAP Applications 12 SP1 | python-libxml2 | 0 | 2.9.1-26.15.1 |
| SUSE:Linux Enterprise Server for SAP Applications 12 SP2 | libxml2 | 0 | 2.9.4-36.1 |
| SUSE:Linux Enterprise Server for SAP Applications 12 SP2 | libxml2 | 0 | 2.9.4-39.2 |
| SUSE:Linux Enterprise Server for SAP Applications 12 SP2 | python-libxml2 | 0 | 2.9.4-36.1 |
| SUSE:Linux Enterprise Server for SAP Applications 12 SP2 | python-libxml2 | 0 | 2.9.4-39.2 |
| SUSE:Linux Enterprise Software Development Kit 11 SP4 | libxml2 | 0 | 2.7.6-0.69.1 |
| SUSE:Linux Enterprise Software Development Kit 12 SP2 | libxml2 | 0 | 2.9.4-36.1 |
| SUSE:Linux Enterprise Software Development Kit 12 SP2 | libxml2 | 0 | 2.9.4-39.2 |
| Ubuntu:14.04:LTS | libxml2 | 0 | 2.9.1+dfsg1-3ubuntu4.10 |
| Ubuntu:16.04:LTS | libxml2 | 0 | 2.9.3+dfsg1-1ubuntu0.3 |
| nuget | libxml2 | 2.9.4 | No fix |
| openSUSE:Tumbleweed | libxml2 | 0 | 2.9.12-1.2 |
Related vulnerabilities
- CVE-2025-9714 Uncontrolled recursion in XPath evaluation in libxml2 up to and including version 2.9.14… Also affects libxml2
- CVE-2025-8732 A vulnerability was found in libxml2 up to 2.14.5. Also affects libxml2
- CVE-2025-6170 A flaw was found in the interactive shell of the xmllint command-line tool, used for… Also affects libxml2
- CVE-2025-49796 A vulnerability was found in libxml2. Also affects libxml2
- CVE-2025-49795 A NULL pointer dereference vulnerability was found in libxml2 when processing XPath XML… Also affects libxml2
- CVE-2025-49794 A use-after-free vulnerability was found in libxml2. Also affects libxml2
- CVE-2025-6021 A flaw was found in libxml2's xmlBuildQName function, where integer overflows in buffer… Also affects libxml2
- CVE-2025-32415 In libxml2 before 2.13.8 and 2.14.x before 2.14.2, xmlSchemaIDCFillNodeTables in… Also affects libxml2