CVE-2016-5131
High · 8.8CVSS
8.8
EPSS
2.3%
Published
Jul 23, 2016
CISA due date
—
Cloudanix analysis
A bug in the way certain software reads special XML information can let an attacker crash the program or potentially take control of it.
- Exploitation
- Requires User Interaction
- Attacker needs
- User Interaction
- Complexity
- Moderate
- Impact
- Full Compromise
- Component
- Library
- Class
- Use After Free
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Use-after-free in libxml2 triggered by XPointer range-to function processing allows memory corruption that can lead to denial of service or arbitrary code execution.
Why it matters to the business
Applications processing untrusted XML, such as Kamailio, face service disruption or potential remote compromise; the issue has remained exploitable for years with low but steady public interest.
How an attack unfolds
An attacker supplies a crafted XML document containing a malicious XPointer range-to expression to a service that uses the vulnerable libxml2; the library frees an object while a reference remains, allowing the attacker to influence freed memory during subsequent operations and achieve code execution or a crash.
How to fix it
Update Kamailio to the commit 6d1e9f74d658942a0a5714ae452a6231e5f831e6 or later; rebuild against a patched libxml2 and verify the fix is present in the deployed binary.
How to confirm the fix worked
Confirm the running Kamailio binary was built from a tree containing commit 6d1e9f74d658942a0a5714ae452a6231e5f831e6; re-test with known XPointer range-to inputs to ensure no crash or corruption occurs.
Typical attack path
- Identify a network-accessible service that parses attacker-controlled XML via libxml2
- Craft an XML payload that exercises the XPointer range-to function to trigger the use-after-free
- Deliver the payload over the network or through an application interface
- Achieve memory corruption leading to denial of service or remote code execution
How to detect it
Search application and system logs for unexpected crashes or segmentation faults occurring during XML parsing; review any recorded stack traces that reference libxml2 XPointer handling functions.
What your security team should do
- Apply the referenced Kamailio commit immediately on all internet-facing instances
- Inventory other products that embed libxml2 and schedule upgrades
- Add XML parsing input validation or sandboxing as a defense-in-depth measure
- Monitor for libxml2-related crashes in application logs
The record
Use-after-free vulnerability in libxml2 through 2.9.4, as used in Google Chrome before 52.0.2743.82, allows remote attackers to cause a denial of service or possibly have unspecified other impact via vectors related to the XPointer range-to function.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Alpine:v3.10 | libxml2 | 0 | 2.9.4-r1 |
| Alpine:v3.11 | libxml2 | 0 | 2.9.4-r1 |
| Alpine:v3.12 | libxml2 | 0 | 2.9.4-r1 |
| Alpine:v3.13 | libxml2 | 0 | 2.9.4-r1 |
| Alpine:v3.14 | libxml2 | 0 | 2.9.4-r1 |
| Alpine:v3.15 | libxml2 | 0 | 2.9.4-r1 |
| Alpine:v3.16 | libxml2 | 0 | 2.9.4-r1 |
| Alpine:v3.17 | libxml2 | 0 | 2.9.4-r1 |
| Alpine:v3.18 | libxml2 | 0 | 2.9.4-r1 |
| Alpine:v3.19 | libxml2 | 0 | 2.9.4-r1 |
| Alpine:v3.2 | libxml2 | 0 | 2.9.4-r1 |
| Alpine:v3.20 | libxml2 | 0 | 2.9.4-r1 |
| Alpine:v3.21 | libxml2 | 0 | 2.9.4-r1 |
| Alpine:v3.22 | libxml2 | 0 | 2.9.4-r1 |
| Alpine:v3.3 | libxml2 | 0 | 2.9.4-r1 |
| Alpine:v3.4 | libxml2 | 0 | 2.9.4-r1 |
| Alpine:v3.5 | libxml2 | 0 | 2.9.4-r1 |
| Alpine:v3.6 | libxml2 | 0 | 2.9.4-r1 |
| Alpine:v3.7 | libxml2 | 0 | 2.9.4-r1 |
| Alpine:v3.8 | libxml2 | 0 | 2.9.4-r1 |
| Alpine:v3.9 | libxml2 | 0 | 2.9.4-r1 |
| Debian:11 | libxml2 | 0 | 2.9.4+dfsg1-2.1 |
| Debian:12 | libxml2 | 0 | 2.9.4+dfsg1-2.1 |
| Debian:13 | libxml2 | 0 | 2.9.4+dfsg1-2.1 |
| Debian:7 | libxml2 | 0 | 2.8.0+dfsg1-7+wheezy7 |
| Debian:8 | chromium-browser | 0 | 52.0.2743.82-1~deb8u1 |
| Debian:8 | libxml2 | 0 | 2.9.1+dfsg1-5+deb8u4 |
| Mageia:5 | libxml2 | 0 | 2.9.7-1.mga5 |
| Mageia:5 | perl-XML-LibXML | 0 | 2.12.100-1.2.mga5 |
| Red Hat:enterprise_linux:7::client | libxml2 | 0 | 0:2.9.1-6.el7.4 |
| Red Hat:enterprise_linux:7::client | libxml2-debuginfo | 0 | 0:2.9.1-6.el7.4 |
| Red Hat:enterprise_linux:7::client | libxml2-devel | 0 | 0:2.9.1-6.el7.4 |
| Red Hat:enterprise_linux:7::client | libxml2-python | 0 | 0:2.9.1-6.el7.4 |
| Red Hat:enterprise_linux:7::client | libxml2-static | 0 | 0:2.9.1-6.el7.4 |
| Red Hat:enterprise_linux:7::computenode | libxml2 | 0 | 0:2.9.1-6.el7.4 |
| Red Hat:enterprise_linux:7::computenode | libxml2-debuginfo | 0 | 0:2.9.1-6.el7.4 |
| Red Hat:enterprise_linux:7::computenode | libxml2-devel | 0 | 0:2.9.1-6.el7.4 |
| Red Hat:enterprise_linux:7::computenode | libxml2-python | 0 | 0:2.9.1-6.el7.4 |
| Red Hat:enterprise_linux:7::computenode | libxml2-static | 0 | 0:2.9.1-6.el7.4 |
| Red Hat:enterprise_linux:7::server | libxml2 | 0 | 0:2.9.1-6.el7.4 |
| Red Hat:enterprise_linux:7::server | libxml2-debuginfo | 0 | 0:2.9.1-6.el7.4 |
| Red Hat:enterprise_linux:7::server | libxml2-devel | 0 | 0:2.9.1-6.el7.4 |
| Red Hat:enterprise_linux:7::server | libxml2-python | 0 | 0:2.9.1-6.el7.4 |
| Red Hat:enterprise_linux:7::server | libxml2-static | 0 | 0:2.9.1-6.el7.4 |
| Red Hat:enterprise_linux:7::workstation | libxml2 | 0 | 0:2.9.1-6.el7.4 |
| Red Hat:enterprise_linux:7::workstation | libxml2-debuginfo | 0 | 0:2.9.1-6.el7.4 |
| Red Hat:enterprise_linux:7::workstation | libxml2-devel | 0 | 0:2.9.1-6.el7.4 |
| Red Hat:enterprise_linux:7::workstation | libxml2-python | 0 | 0:2.9.1-6.el7.4 |
| Red Hat:enterprise_linux:7::workstation | libxml2-static | 0 | 0:2.9.1-6.el7.4 |
| Red Hat:rhel_extras:6 | chromium-browser | 0 | 0:52.0.2743.82-1.el6 |
| Red Hat:rhel_extras:6 | chromium-browser-debuginfo | 0 | 0:52.0.2743.82-1.el6 |
| SUSE:Linux Enterprise Desktop 12 SP2 | libxml2 | 0 | 2.9.4-46.12.1 |
| SUSE:Linux Enterprise Desktop 12 SP2 | python-libxml2 | 0 | 2.9.4-46.12.1 |
| SUSE:Linux Enterprise Desktop 12 SP3 | libxml2 | 0 | 2.9.4-46.12.1 |
| SUSE:Linux Enterprise Desktop 12 SP3 | python-libxml2 | 0 | 2.9.4-46.12.1 |
| SUSE:Linux Enterprise Server 11 SP4 | libxml2 | 0 | 2.7.6-0.77.10.1 |
| SUSE:Linux Enterprise Server 11 SP4 | libxml2-python | 0 | 2.7.6-0.77.10.1 |
| SUSE:Linux Enterprise Server 12 SP2 | libxml2 | 0 | 2.9.4-46.12.1 |
| SUSE:Linux Enterprise Server 12 SP2 | python-libxml2 | 0 | 2.9.4-46.12.1 |
| SUSE:Linux Enterprise Server 12 SP3 | libxml2 | 0 | 2.9.4-46.12.1 |
| SUSE:Linux Enterprise Server 12 SP3 | python-libxml2 | 0 | 2.9.4-46.12.1 |
| SUSE:Linux Enterprise Server for Raspberry Pi 12 SP2 | libxml2 | 0 | 2.9.4-46.12.1 |
| SUSE:Linux Enterprise Server for Raspberry Pi 12 SP2 | python-libxml2 | 0 | 2.9.4-46.12.1 |
| SUSE:Linux Enterprise Server for SAP Applications 11 SP4 | libxml2 | 0 | 2.7.6-0.77.10.1 |
| SUSE:Linux Enterprise Server for SAP Applications 11 SP4 | libxml2-python | 0 | 2.7.6-0.77.10.1 |
| SUSE:Linux Enterprise Server for SAP Applications 12 SP2 | libxml2 | 0 | 2.9.4-46.12.1 |
| SUSE:Linux Enterprise Server for SAP Applications 12 SP2 | python-libxml2 | 0 | 2.9.4-46.12.1 |
| SUSE:Linux Enterprise Server for SAP Applications 12 SP3 | libxml2 | 0 | 2.9.4-46.12.1 |
| SUSE:Linux Enterprise Server for SAP Applications 12 SP3 | python-libxml2 | 0 | 2.9.4-46.12.1 |
| SUSE:Linux Enterprise Software Development Kit 11 SP4 | libxml2 | 0 | 2.7.6-0.77.10.1 |
| SUSE:Linux Enterprise Software Development Kit 12 SP2 | libxml2 | 0 | 2.9.4-46.12.1 |
| SUSE:Linux Enterprise Software Development Kit 12 SP3 | libxml2 | 0 | 2.9.4-46.12.1 |
| SUSE:Package Hub 12 | chromium | 0 | 52.0.2743.82-89.1 |
| Ubuntu:14.04:LTS | chromium-browser | 0 | 52.0.2743.116-0ubuntu0.14.04.1.1134 |
| Ubuntu:14.04:LTS | libxml2 | 0 | 2.9.1+dfsg1-3ubuntu4.9 |
| Ubuntu:14.04:LTS | oxide-qt | 0 | 1.16.5-0ubuntu0.14.04.1 |
| Ubuntu:16.04:LTS | chromium-browser | 0 | 52.0.2743.116-0ubuntu0.16.04.1.1250 |
| Ubuntu:16.04:LTS | libxml2 | 0 | 2.9.3+dfsg1-1ubuntu0.2 |
| Ubuntu:16.04:LTS | oxide-qt | 0 | 1.16.5-0ubuntu0.16.04.1 |
| openSUSE:Tumbleweed | chromium | 0 | 55.0.2883.75-3.1 |
| openSUSE:Tumbleweed | chromium | 0 | 113.0.5672.92-1.1 |
| 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.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
- CVE-2017-5969 libxml2 2.9.4, when used in recover mode, allows remote attackers to cause a denial of… Also affects libxml2
- CVE-2016-9318 libxml2 2.9.4 and earlier, as used in XMLSec 1.2.23 and earlier and other products, does… 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
- CVE-2025-32414 In libxml2 before 2.13.8 and 2.14.x before 2.14.2, out-of-bounds memory access can occur… Also affects libxml2
- CVE-2025-24928 libxml2 before 2.12.10 and 2.13.x before 2.13.6 has a stack-based buffer overflow in… Also affects libxml2
- CVE-2025-27113 libxml2 before 2.12.10 and 2.13.x before 2.13.6 has a NULL pointer dereference in… Also affects libxml2
- CVE-2024-56171 libxml2 before 2.12.10 and 2.13.x before 2.13.6 has a use-after-free in… Also affects libxml2
- CVE-2017-16931 parser.c in libxml2 before 2.9.5 mishandles parameter-entity references because the NEXTL… Also affects libxml2