Cloudanix VulnDB

CVE-2017-16931

Critical · 9.8

CVSS

9.8

EPSS

4.6%

Published

Nov 23, 2017

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

A flaw in a widely used XML library lets attackers send specially crafted documents that can take over or crash affected software over the network.

Exploitation
Remote Unauthenticated
Attacker needs
None
Complexity
Low
Impact
Remote Code Execution
Component
Library
Class
Memory Corruption
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

Mishandling of parameter-entity references in DTD parsing via the NEXTL macro invoking xmlParserHandlePEReference on '%' characters, resulting in memory corruption.

Why it matters to the business

Attackers could remotely execute arbitrary code or crash XML-processing applications, leading to service outages, data exposure, or system compromise in any environment using the vulnerable library.

How an attack unfolds

An attacker supplies a crafted XML document containing a DTD with a '%' character in a parameter-entity reference; the parser mishandles it during entity resolution, corrupting memory and enabling code execution or denial of service.

How to fix it

Upgrade libxml2 to version 2.9.5 or later. Rebuild and redeploy all dependent applications after the library update. Disable external DTD resolution where feasible as a temporary mitigation.

How to confirm the fix worked

Verify installed libxml2 version is 2.9.5 or newer via package manager or xml2-config --version. Test parsing of sample DTD-containing XML documents to confirm no crash or corruption occurs.

Typical attack path

  1. Identify a target application that parses untrusted XML using the vulnerable libxml2 version
  2. Craft a malicious XML payload containing a DTD with parameter-entity reference using '%'
  3. Deliver the payload via network request, file upload, or document processing
  4. Trigger parsing to invoke the flawed NEXTL macro path
  5. Achieve memory corruption leading to RCE or crash

How to detect it

Review application logs for XML parsing errors or crashes around DTD processing; inspect inbound XML documents containing DTDs with parameter entities; correlate with process crashes or memory-related faults in libxml2-linked binaries.

What your security team should do

  • Prioritize inventory of all systems using libxml2 and schedule immediate upgrades to 2.9.5+
  • Apply network controls to restrict untrusted XML input until patches are deployed
  • Monitor vulnerability scanners and dependency reports for remaining instances of versions before 2.9.5
  • Review and harden XML parsing configurations to disable unnecessary entity expansion

The record

parser.c in libxml2 before 2.9.5 mishandles parameter-entity references because the NEXTL macro calls the xmlParserHandlePEReference function in the case of a '%' character in a DTD name.

Affected packages

Ecosystem Package Introduced Fixed
Alpine:v3.4 libxml2 0 2.9.5-r0
Alpine:v3.5 libxml2 0 2.9.5-r0
Alpine:v3.6 libxml2 0 2.9.5-r0
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+wheezy11
Ubuntu:14.04:LTS libxml2 0 2.9.1+dfsg1-3ubuntu4.10
Ubuntu:16.04:LTS libxml2 0 2.9.3+dfsg1-1ubuntu0.3

Related vulnerabilities