Critical Memory Allocation Vulnerability in Expat Package
Summary
ALSA-2025:22175: Important: expat security update. Affects expat versions < 2.5.0-5.el9_7.1. Fixed in 2.5.0-5.el9_7.1. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
Expat is a widely-used C library designed for parsing XML documents. It is known for its efficiency and flexibility, making it a popular choice among developers for handling XML data. However, the library has been identified to have a security vulnerability that can be exploited by attackers to trigger large dynamic memory allocations, potentially leading to denial of service or other malicious activities.
Vulnerability Detail
The vulnerability, identified as CVE-2025-59375, allows attackers to submit a small XML document that can cause the libexpat library to allocate excessive amounts of memory dynamically. This can lead to resource exhaustion, causing applications that rely on Expat to crash or become unresponsive. The issue arises from improper handling of memory allocation requests, making it critical for users of the library to address this vulnerability promptly.
How To Fix
Minimum fixed version
2.5.0-5.el9_7.1
This is the first release that contains the fix.
sudo dnf update expat
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary workaround, users can limit the size of XML documents being processed by the Expat library to prevent excessive memory allocation. This can be done by implementing checks in the application code that restrict the size of incoming XML data.
Conclusion
The Expat library has a critical vulnerability that can be exploited to cause significant memory allocation issues. It is crucial for users to update to the latest patched version to protect their applications from potential attacks. Implementing workarounds can provide temporary relief, but a permanent fix through updates is highly recommended.
See every vulnerability recorded for expat →
FAQ
CVE-2025-59375 is a security vulnerability in the Expat library that allows attackers to trigger large dynamic memory allocations through small XML documents.
You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without requiring any signup.
The vulnerability can lead to denial of service, causing applications that use the Expat library to crash or become unresponsive due to excessive memory allocation.
Yes, a patch is available in version 2.5.0-5.el9_7.1 of the Expat package. Users should update to this version or later to mitigate the vulnerability.
If an immediate update is not possible, implement size restrictions on XML documents being processed to limit memory allocation until a proper update can be applied.
Related vulnerabilities
Recent vulnerabilities recorded for expat.