VYPR
Unrated severityNVD Advisory· Published Jun 21, 2026

CVE-2026-56404

CVE-2026-56404

Description

libexpat before 2.8.2 has an integer overflow in addBinding.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

Affected products

2

Patches

Vulnerability mechanics

Root cause

"Signed integer overflow in the addBinding function when incrementing a loop counter past a NUL terminator in the uri string."

Attack vector

An attacker can trigger a signed integer overflow in the `addBinding` function by crafting XML input that causes the `uri` length to reach the boundary of the pool block size. The overflow occurs when the loop counter `len` is incremented past the NUL terminator, leading to undefined behavior [ref_id=1]. This is a sibling of issue #1232, which involves the same pattern of an integer counter walking past a NUL terminator [ref_id=1]. The attack vector is network-based, requiring the attacker to send specially crafted XML data to an application using libexpat.

Affected code

The vulnerability is in the `addBinding` function in `expat/lib/xmlparse.c`. The integer overflow occurs in two locations: the `for (len = 0; uri[len]; len++)` loop at line 4370 and the `if (parser->m_namespaceSeparator) len++;` increment at line 4411. The `uri` length is bounded by the pool block size, but the post-increment operation can still trigger signed undefined behavior at the boundary [ref_id=1].

What the fix does

The patch protects the `addBinding` function from signed integer overflow. While the exact diff is not shown in the reference, the fix addresses the signed undefined behavior that occurs when the loop counter `len` is incremented past the NUL terminator in the `uri` string [ref_id=1]. The fix ensures that the integer operations do not result in undefined behavior at the boundary of the pool block size [ref_id=1].

Preconditions

  • configThe application must use libexpat before version 2.8.2 to parse XML input
  • inputThe attacker must be able to supply crafted XML data that causes the uri length to reach the pool block size boundary
  • networkThe attack is network-based, requiring the attacker to send the malicious XML to the target application

Generated on Jun 22, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

1

News mentions

0

No linked articles in our index yet.