# CVE-2026-56132: libexpat heap buffer overflow in doProlog

Source: https://junglewise.ai/threats/cve-2026-56132-libexpat-heap-buffer-overflow-in-doprolog  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-06-19. Updated: 2026-06-21  
License: CC BY 4.0 with a link back

CVE-2026-56132 · Severity: medium · CVSS 6.9 · Published 2026-06-19

libexpat is a widely used software library for parsing XML data. A vulnerability was found where processing specially crafted XML files could cause the library to crash or potentially allow unauthorized access to data. This occurs when the library incorrectly manages memory while sharing data structures between different parts of the parsing process.

Technologies: [Libexpat Project Expat](https://junglewise.ai/threats/technologies/expat). Vendors: [Libexpat Project](https://junglewise.ai/threats/vendors/libexpat-project).

## Quick answers

**Is CVE-2026-56132 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-56132 being exploited in the wild.

**How severe is CVE-2026-56132?** Medium severity, with a CVSS score of 6.9, published 19 June 2026.

**Which products and versions are affected?** Libexpat Project Expat before 2.8.2.

**Is there a fix for CVE-2026-56132?** A patch was published on 2026-06-20: Fix merged into master branch for version 2.8.2 Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-56132 attacked?** It is attacked with local access, in a software library.

**Am I affected by CVE-2026-56132?** Check whether you run Libexpat Project Expat at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## Technical details

A heap-based buffer overflow exists in the doProlog function within xmlparse.c of libexpat before version 2.8.2. The vulnerability is caused by the mishandling of scaffold backing array reallocations when data structures (specifically the DTD struct) are shared between a parent parser and an external parameter-entity sub-parser. A sub-parser with shallower nesting can trigger a REALLOC that shrinks the shared scaffIndex buffer; when the parent parser resumes, it may attempt to write to the buffer based on its own (larger) tracking variable, leading to an out-of-bounds write. This issue is tracked as CWE-821 (Incorrect Synchronization) and has been patched in version 2.8.2.

## Affected products

- libexpat project libexpat before 2.8.2

## Timeline

- 2026-06-11: disclosed: Pull request submitted to fix the issue
- 2026-06-19: advisory: CVE published and NVD record created
- 2026-06-20: patched: Fix merged into master branch for version 2.8.2

## References

- [https://github.com/libexpat/libexpat/pull/1272](https://github.com/libexpat/libexpat/pull/1272)

## Related threats

- [libexpat use-after-free in doCdataSection](https://junglewise.ai/threats/cve-2026-56412-libexpat-use-after-free-in-docdatasection)
- [libexpat integer overflow in xmlwf endDoctypeDecl](https://junglewise.ai/threats/cve-2026-56411-libexpat-integer-overflow-in-xmlwf-enddoctypedecl)
- [libexpat xmlwf integer overflow in resolveSystemId](https://junglewise.ai/threats/cve-2026-56410-libexpat-xmlwf-integer-overflow-in-resolvesystemid)
- [libexpat xmlwf integer overflow in output filename handling](https://junglewise.ai/threats/cve-2026-56409-libexpat-xmlwf-integer-overflow-in-output-filename-handling)
- [libexpat integer overflow in copyString](https://junglewise.ai/threats/cve-2026-56408-libexpat-integer-overflow-in-copystring)
