CVE-2026-50219: libexpat use-after-free via insufficient handler call depth tracking

CVE-2026-50219 · Severity: medium · CVSS 4.9 · Published 2026-06-04

libexpat is a widely used library for processing XML data in various software applications. A vulnerability exists where the library fails to properly track the depth of internal function calls during certain error conditions. This can lead to a memory corruption issue known as a use-after-free, potentially causing the application to crash or allowing an attacker to execute unauthorized code.

Technologies: Libexpat Project Expat. Vendors: Libexpat Project.

Quick answers

Is CVE-2026-50219 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-50219 being exploited in the wild.
How severe is CVE-2026-50219?
Medium severity, with a CVSS score of 4.9, published 4 June 2026.
Which products and versions are affected?
Libexpat Project Expat before 2.8.2.
Is there a fix for CVE-2026-50219?
No fixed version is recorded yet. Check the vendor's advisory in the references below. If you run it, Junglewise drafts a mitigation that fits your setup and applies it once you approve, with senior security engineers behind it.
How is CVE-2026-50219 attacked?
It is attacked with local access, in a software library.
Am I affected by CVE-2026-50219?
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 use-after-free vulnerability exists in libexpat versions prior to 2.8.2 due to insufficient handler call depth tracking. When specific functions (XML_GetBuffer, XML_Parse, XML_ParseBuffer, XML_ParserFree, or XML_ParserReset) are called from within handlers during a policy violation, the parser state may become inconsistent. This lack of tracking allows for memory to be accessed after it has been freed. The attack vector is local with high complexity, as it requires specific timing or conditions within the XML parsing flow to trigger the memory corruption. The issue is addressed in version 2.8.2 by introducing proper depth tracking guards.

Affected products

  • libexpat project libexpat before 2.8.2

Timeline

  • 2026-05-26: other: Initial pull request submitted to libexpat repository
  • 2026-06-04: disclosed: CVE-2026-50219 published to NVD

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.