/

CVE-2026-115506

Severity:

HIGH RISK

(7.5)

XML Entity Expansion (CWE-776) in libexpat XML Parser

CVE-2026-115506

Analyzed

Vulnerability type

Category:

XML Entity Expansion

CWE:

CWE-776

Impact:

Denial of Service

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A denial-of-service vulnerability in libexpat allows specially structured XML documents to trigger excessive entity expansion and CPU consumption during parsing. An attacker who can submit XML to an affected parser may cause substantial processing delays or resource exhaustion, particularly when large DTDs and nested entities are accepted.

A denial-of-service vulnerability in libexpat allows specially structured XML documents to trigger excessive entity expansion and CPU consumption during parsing. An attacker who can submit XML to an affected parser may cause substantial processing delays or resource exhaustion, particularly when large DTDs and nested entities are accepted.

Affected context

The issue can occur in applications that use libexpat to parse attacker-influenced XML and permit DTD processing or entity expansion. Risk is higher when XML parsing occurs synchronously, resource limits are weak, or parser protections evaluate entity amplification only after significant computation has already taken place.

The issue can occur in applications that use libexpat to parse attacker-influenced XML and permit DTD processing or entity expansion. Risk is higher when XML parsing occurs synchronously, resource limits are weak, or parser protections evaluate entity amplification only after significant computation has already taken place.

Exploit preconditions

  • Attack surface: An application or service that parses XML through libexpat
  • Required access: Ability to submit, upload, relay, or otherwise influence XML input
  • Trigger point: XML parsing of DTDs and nested entity references
  • Why exploitation is possible: Entity expansion and amplification can consume substantial CPU before protective accounting detects the excessive growth
  • Attack surface: An application or service that parses XML through libexpat
  • Required access: Ability to submit, upload, relay, or otherwise influence XML input
  • Trigger point: XML parsing of DTDs and nested entity references
  • Why exploitation is possible: Entity expansion and amplification can consume substantial CPU before protective accounting detects the excessive growth

Why this happens

The underlying bug is insufficiently early resource accounting for XML entity expansion. In affected parsing logic, amplification protection in accountingDiffTolerated() may identify excessive expansion only after considerable processing has occurred. This maps to CWE-776: Improper Restriction of Recursive Entity References in DTDs, where nested entity processing can cause disproportionate resource consumption.

The underlying bug is insufficiently early resource accounting for XML entity expansion. In affected parsing logic, amplification protection in accountingDiffTolerated() may identify excessive expansion only after considerable processing has occurred. This maps to CWE-776: Improper Restriction of Recursive Entity References in DTDs, where nested entity processing can cause disproportionate resource consumption.

Potential impact

  • A service may experience severe CPU consumption
  • XML parsing requests could become slow or time out
  • An attacker could cause application-level denial of service
  • Shared compute resources may become unavailable to other workloads
  • Repeated requests could increase operational and infrastructure costs
  • A service may experience severe CPU consumption
  • XML parsing requests could become slow or time out
  • An attacker could cause application-level denial of service
  • Shared compute resources may become unavailable to other workloads
  • Repeated requests could increase operational and infrastructure costs

General mitigation guidance

Mitigation generally focuses on reducing trust in XML input and limiting parser resource consumption.

Defensive patterns include:

  • Disabling DTD processing and external entity resolution when application requirements permit
  • Applying strict limits on document size, nesting depth, entity count, and expansion ratio
  • Using parser configurations that enforce resource checks before substantial expansion work
  • Processing untrusted XML asynchronously with bounded CPU, memory, and execution time
  • Isolating XML parsing workloads and applying least-privilege runtime permissions
  • Rejecting unnecessary XML features through schema and input policy enforcement

Mitigation generally focuses on reducing trust in XML input and limiting parser resource consumption.

Defensive patterns include:

  • Disabling DTD processing and external entity resolution when application requirements permit
  • Applying strict limits on document size, nesting depth, entity count, and expansion ratio
  • Using parser configurations that enforce resource checks before substantial expansion work
  • Processing untrusted XML asynchronously with bounded CPU, memory, and execution time
  • Isolating XML parsing workloads and applying least-privilege runtime permissions
  • Rejecting unnecessary XML features through schema and input policy enforcement

How teams detect issues like this

Organizations can look for XML entity expansion risks through:

  • Static analysis of parser configuration and entity-resolution settings
  • Code review checks for untrusted XML entry points and unrestricted DTD support
  • Tests using oversized, deeply nested, or high-expansion XML structures in controlled environments
  • Runtime monitoring for abnormal CPU usage, parsing latency, request timeouts, and repeated XML submissions
  • Policy enforcement requiring bounded parser settings for externally supplied XML

Automated security review tools may help identify permissive XML parsing configurations and missing resource limits.

Organizations can look for XML entity expansion risks through:

  • Static analysis of parser configuration and entity-resolution settings
  • Code review checks for untrusted XML entry points and unrestricted DTD support
  • Tests using oversized, deeply nested, or high-expansion XML structures in controlled environments
  • Runtime monitoring for abnormal CPU usage, parsing latency, request timeouts, and repeated XML submissions
  • Policy enforcement requiring bounded parser settings for externally supplied XML

Automated security review tools may help identify permissive XML parsing configurations and missing resource limits.

Sources

SourceLink
github.comgithub.com/hannob/lololol
github.comgithub.com/libexpat/libexpat
github.comgithub.com/libexpat/libexpat/issues/1160
github.comgithub.com/libexpat/libexpat/pull/1433
vulncheck.comvulncheck.com/advisories/libexpat-through-2.9.0-denial-of-service-via-billion-laughs-detection-delay

Frequently asked

questions

It can be remotely exploitable when a network-facing application accepts attacker-controlled XML and passes it to an affected libexpat parser.

Authentication requirements depend on the application exposing the XML parsing functionality. Any authenticated or unauthenticated user able to submit XML may be relevant.

Disable unnecessary DTD and entity processing, enforce early limits on XML expansion and parsing resources, and isolate untrusted parsing work.

Treat external XML as untrusted, use restrictive parser defaults, apply bounded resource policies, and include adversarial XML cases in security testing.

It can be remotely exploitable when a network-facing application accepts attacker-controlled XML and passes it to an affected libexpat parser.

Authentication requirements depend on the application exposing the XML parsing functionality. Any authenticated or unauthenticated user able to submit XML may be relevant.

Disable unnecessary DTD and entity processing, enforce early limits on XML expansion and parsing resources, and isolate untrusted parsing work.

Treat external XML as untrusted, use restrictive parser defaults, apply bounded resource policies, and include adversarial XML cases in security testing.

Find out what's already
exploitable in your codebase.