Cloudanix VulnDB

CVE-2017-9048

High · 7.5

CVSS

7.5

EPSS

4.8%

Published

May 18, 2017

CISA due date

—

Cloudanix analysis

Monitor only SSVC: Track

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.

Exploit Available
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

  1. Identify a target application that links against vulnerable libxml2
  2. Prepare malicious XML containing oversized element content definitions
  3. Submit the XML through any input path that triggers validation or parsing
  4. Trigger xmlSnprintfElementContent recursion until the buffer check fails
  5. 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