CVE-2015-5312
NoneCVSS
—
EPSS
4.5%
Published
Dec 15, 2015
CISA due date
—
Cloudanix analysis
Attackers can send specially formatted data to slow down or crash programs that read XML files, interrupting normal operations.
- Exploitation
- Remote Unauthenticated
- Attacker needs
- None
- Complexity
- Moderate
- Impact
- Denial Of Service
- Component
- Library
- Class
- Improper Input Validation
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
The xmlStringLenDecodeEntities function in libxml2 fails to limit recursive entity expansion during XML parsing, allowing crafted input to trigger unbounded CPU consumption and denial of service.
Why it matters to the business
Services and applications that parse untrusted XML can experience sudden resource exhaustion, leading to outages, degraded performance, and operational disruption across many operating systems and products that bundle the library.
How an attack unfolds
An attacker identifies an endpoint or process that accepts XML data, crafts a malicious document containing recursive entity references, and submits it to the vulnerable parser; the parser expands the entities repeatedly, exhausting CPU resources and causing denial of service.
How to fix it
Upgrade libxml2 to version 2.9.3 or later on all affected systems; rebuild or reinstall dependent packages after the library update and verify the new version is in use.
How to confirm the fix worked
Query the installed libxml2 version string and compare against 2.9.3; run regression tests with known entity-expansion test cases to confirm the parser now terminates expansion.
Typical attack path
- Locate a service or application that accepts and parses XML input
- Construct an XML document containing deeply nested or recursive entity definitions
- Submit the crafted XML through the normal input channel
- Observe sustained high CPU usage and service degradation or unavailability
How to detect it
Monitor process CPU utilization and XML parsing logs for sudden spikes or repeated large entity expansions; correlate with inbound XML traffic volumes.
What your security team should do
- Prioritize patching libxml2 to 2.9.3 or newer on all systems
- Apply network or application-level XML schema validation to reject excessive entity references
- Enable resource limits or timeouts on XML-parsing processes to contain CPU exhaustion
- Review and replace any remaining uses of outdated XML libraries in the environment
The record
The xmlStringLenDecodeEntities function in parser.c in libxml2 before 2.9.3 does not properly prevent entity expansion, which allows context-dependent attackers to cause a denial of service (CPU consumption) via crafted XML data, a different vulnerability than CVE-2014-3660.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| RubyGems | nokogiri | 1.6.0 | 1.6.7.1 |
| Debian:11 | libxml2 | 0 | 2.9.3+dfsg1-1 |
| Debian:12 | libxml2 | 0 | 2.9.3+dfsg1-1 |
| Debian:13 | libxml2 | 0 | 2.9.3+dfsg1-1 |
| Debian:6.0 | libxml2 | 0 | 2.7.8.dfsg-2+squeeze16 |
| Debian:7 | libxml2 | 0 | 2.8.0+dfsg1-7+wheezy5 |
| Debian:8 | libxml2 | 0 | 2.9.1+dfsg1-5+deb8u1 |
| Mageia:5 | libxml2 | 0 | 2.9.3-1.mga5 |
| Red Hat:enterprise_linux:6::client | libxml2 | 0 | 0:2.7.6-20.el6_7.1 |
| Red Hat:enterprise_linux:6::client | libxml2-debuginfo | 0 | 0:2.7.6-20.el6_7.1 |
| Red Hat:enterprise_linux:6::client | libxml2-devel | 0 | 0:2.7.6-20.el6_7.1 |
| Red Hat:enterprise_linux:6::client | libxml2-python | 0 | 0:2.7.6-20.el6_7.1 |
| Red Hat:enterprise_linux:6::client | libxml2-static | 0 | 0:2.7.6-20.el6_7.1 |
| Red Hat:enterprise_linux:6::computenode | libxml2 | 0 | 0:2.7.6-20.el6_7.1 |
| Red Hat:enterprise_linux:6::computenode | libxml2-debuginfo | 0 | 0:2.7.6-20.el6_7.1 |
| Red Hat:enterprise_linux:6::computenode | libxml2-devel | 0 | 0:2.7.6-20.el6_7.1 |
| Red Hat:enterprise_linux:6::computenode | libxml2-python | 0 | 0:2.7.6-20.el6_7.1 |
| Red Hat:enterprise_linux:6::computenode | libxml2-static | 0 | 0:2.7.6-20.el6_7.1 |
| Red Hat:enterprise_linux:6::server | libxml2 | 0 | 0:2.7.6-20.el6_7.1 |
| Red Hat:enterprise_linux:6::server | libxml2-debuginfo | 0 | 0:2.7.6-20.el6_7.1 |
| Red Hat:enterprise_linux:6::server | libxml2-devel | 0 | 0:2.7.6-20.el6_7.1 |
| Red Hat:enterprise_linux:6::server | libxml2-python | 0 | 0:2.7.6-20.el6_7.1 |
| Red Hat:enterprise_linux:6::server | libxml2-static | 0 | 0:2.7.6-20.el6_7.1 |
| Red Hat:enterprise_linux:6::workstation | libxml2 | 0 | 0:2.7.6-20.el6_7.1 |
| Red Hat:enterprise_linux:6::workstation | libxml2-debuginfo | 0 | 0:2.7.6-20.el6_7.1 |
| Red Hat:enterprise_linux:6::workstation | libxml2-devel | 0 | 0:2.7.6-20.el6_7.1 |
| Red Hat:enterprise_linux:6::workstation | libxml2-python | 0 | 0:2.7.6-20.el6_7.1 |
| Red Hat:enterprise_linux:6::workstation | libxml2-static | 0 | 0:2.7.6-20.el6_7.1 |
| Red Hat:enterprise_linux:7::client | libxml2 | 0 | 0:2.9.1-6.el7_2.2 |
| Red Hat:enterprise_linux:7::client | libxml2-debuginfo | 0 | 0:2.9.1-6.el7_2.2 |
| Red Hat:enterprise_linux:7::client | libxml2-devel | 0 | 0:2.9.1-6.el7_2.2 |
| Red Hat:enterprise_linux:7::client | libxml2-python | 0 | 0:2.9.1-6.el7_2.2 |
| Red Hat:enterprise_linux:7::client | libxml2-static | 0 | 0:2.9.1-6.el7_2.2 |
| Red Hat:enterprise_linux:7::computenode | libxml2 | 0 | 0:2.9.1-6.el7_2.2 |
| Red Hat:enterprise_linux:7::computenode | libxml2-debuginfo | 0 | 0:2.9.1-6.el7_2.2 |
| Red Hat:enterprise_linux:7::computenode | libxml2-devel | 0 | 0:2.9.1-6.el7_2.2 |
| Red Hat:enterprise_linux:7::computenode | libxml2-python | 0 | 0:2.9.1-6.el7_2.2 |
| Red Hat:enterprise_linux:7::computenode | libxml2-static | 0 | 0:2.9.1-6.el7_2.2 |
| Red Hat:enterprise_linux:7::server | libxml2 | 0 | 0:2.9.1-6.el7_2.2 |
| Red Hat:enterprise_linux:7::server | libxml2-debuginfo | 0 | 0:2.9.1-6.el7_2.2 |
| Red Hat:enterprise_linux:7::server | libxml2-devel | 0 | 0:2.9.1-6.el7_2.2 |
| Red Hat:enterprise_linux:7::server | libxml2-python | 0 | 0:2.9.1-6.el7_2.2 |
| Red Hat:enterprise_linux:7::server | libxml2-static | 0 | 0:2.9.1-6.el7_2.2 |
| Red Hat:enterprise_linux:7::workstation | libxml2 | 0 | 0:2.9.1-6.el7_2.2 |
| Red Hat:enterprise_linux:7::workstation | libxml2-debuginfo | 0 | 0:2.9.1-6.el7_2.2 |
| Red Hat:enterprise_linux:7::workstation | libxml2-devel | 0 | 0:2.9.1-6.el7_2.2 |
| Red Hat:enterprise_linux:7::workstation | libxml2-python | 0 | 0:2.9.1-6.el7_2.2 |
| Red Hat:enterprise_linux:7::workstation | libxml2-static | 0 | 0:2.9.1-6.el7_2.2 |
| SUSE:Linux Enterprise Desktop 11 SP3 | libxml2 | 0 | 2.7.6-0.34.1 |
| SUSE:Linux Enterprise Desktop 11 SP3 | libxml2-python | 0 | 2.7.6-0.34.4 |
| SUSE:Linux Enterprise Desktop 11 SP4 | libxml2 | 0 | 2.7.6-0.34.1 |
| SUSE:Linux Enterprise Desktop 11 SP4 | libxml2-python | 0 | 2.7.6-0.34.4 |
| SUSE:Linux Enterprise Desktop 12 | libxml2 | 0 | 2.9.1-13.1 |
| SUSE:Linux Enterprise Desktop 12 | python-libxml2 | 0 | 2.9.1-13.1 |
| SUSE:Linux Enterprise Desktop 12 SP1 | libxml2 | 0 | 2.9.1-13.1 |
| SUSE:Linux Enterprise Desktop 12 SP1 | python-libxml2 | 0 | 2.9.1-13.1 |
| SUSE:Linux Enterprise Server 11 SP3 | libxml2 | 0 | 2.7.6-0.34.1 |
| SUSE:Linux Enterprise Server 11 SP3 | libxml2-python | 0 | 2.7.6-0.34.4 |
| SUSE:Linux Enterprise Server 11 SP3-TERADATA | libxml2 | 0 | 2.7.6-0.34.1 |
| SUSE:Linux Enterprise Server 11 SP3-TERADATA | libxml2-python | 0 | 2.7.6-0.34.4 |
| SUSE:Linux Enterprise Server 11 SP4 | libxml2 | 0 | 2.7.6-0.34.1 |
| SUSE:Linux Enterprise Server 11 SP4 | libxml2-python | 0 | 2.7.6-0.34.4 |
| SUSE:Linux Enterprise Server 12 | libxml2 | 0 | 2.9.1-13.1 |
| SUSE:Linux Enterprise Server 12 | python-libxml2 | 0 | 2.9.1-13.1 |
| SUSE:Linux Enterprise Server 12 SP1 | libxml2 | 0 | 2.9.1-13.1 |
| SUSE:Linux Enterprise Server 12 SP1 | python-libxml2 | 0 | 2.9.1-13.1 |
| SUSE:Linux Enterprise Server for SAP Applications 11 SP3 | libxml2 | 0 | 2.7.6-0.34.1 |
| SUSE:Linux Enterprise Server for SAP Applications 11 SP3 | libxml2-python | 0 | 2.7.6-0.34.4 |
| SUSE:Linux Enterprise Server for SAP Applications 11 SP4 | libxml2 | 0 | 2.7.6-0.34.1 |
| SUSE:Linux Enterprise Server for SAP Applications 11 SP4 | libxml2-python | 0 | 2.7.6-0.34.4 |
| SUSE:Linux Enterprise Server for SAP Applications 12 | libxml2 | 0 | 2.9.1-13.1 |
| SUSE:Linux Enterprise Server for SAP Applications 12 | python-libxml2 | 0 | 2.9.1-13.1 |
| SUSE:Linux Enterprise Server for SAP Applications 12 SP1 | libxml2 | 0 | 2.9.1-13.1 |
| SUSE:Linux Enterprise Server for SAP Applications 12 SP1 | python-libxml2 | 0 | 2.9.1-13.1 |
| SUSE:Linux Enterprise Software Development Kit 11 SP3 | libxml2 | 0 | 2.7.6-0.34.1 |
| SUSE:Linux Enterprise Software Development Kit 11 SP4 | libxml2 | 0 | 2.7.6-0.34.1 |
| SUSE:Linux Enterprise Software Development Kit 12 | libxml2 | 0 | 2.9.1-13.1 |
| SUSE:Linux Enterprise Software Development Kit 12 SP1 | libxml2 | 0 | 2.9.1-13.1 |
| Ubuntu:14.04:LTS | libxml2 | 0 | 2.9.1+dfsg1-3ubuntu4.6 |
| gem | nokogiri | 1.6.0.rc1 | 1.6.7.1 |
| openSUSE:Tumbleweed | libxml2 | 0 | 2.9.4-1.22 |
| openSUSE:Tumbleweed | ruby3.2-rubygem-nokogiri | 0 | 1.13.9-1.7 |
| openSUSE:Tumbleweed | rubygem-nokogiri | 0 | 1.13.3-1.1 |
| openSUSE:Tumbleweed | rubygem-nokogiri | 0 | 1.6.8.1-1.3 |
| openSUSE:Tumbleweed | rubygem-nokogiri | 0 | 1.15.5-1.5 |
| openSUSE:Tumbleweed | rubygem-nokogiri | 0 | 1.18.2-1.1 |
| openSUSE:Tumbleweed | rubygem-nokogiri | 0 | 1.18.9-1.4 |
Related vulnerabilities
- GHSA-vcc3-rw6f-jv97 Duplicate Advisory: Use-after-free in libxml2 via Nokogiri::XML::Reader Also affects nokogiri
- GHSA-pxvg-2qj5-37jq Nokogiri updates packaged libxml2 to v2.10.4 to resolve multiple CVEs Also affects nokogiri
- GHSA-2qc6-mcvw-92cw Update bundled libxml2 to v2.10.3 to resolve multiple CVEs Also affects nokogiri
- GHSA-cgx6-hpwq-fhv5 Integer Overflow or Wraparound in libxml2 affects Nokogiri Also affects nokogiri
- GHSA-gx8x-g87m-h5q6 Denial of Service (DoS) in Nokogiri on JRuby Also affects nokogiri
- GHSA-xxx9-3xcr-gjj3 XML Injection in Xerces Java affects Nokogiri Also affects nokogiri
- GHSA-v6gp-9mmm-c6p5 Out-of-bounds Write in zlib affects Nokogiri Also affects nokogiri
- GHSA-fq42-c5rg-92c2 Vulnerable dependencies in Nokogiri Also affects nokogiri