Critical Vulnerability in Expat Package: XML_ParseBuffer Negative Length Issue

expat Updated 03 Oct 2025

Summary

30/08/2024
N/A
Yes i
Critical
9.8

UBUNTU-CVE-2024-45490: An issue was discovered in libexpat before 2.6.3. xmlparse.c does not reject a negative length for XML_ParseBuffer. Affects expat versions < 2.1.0-4ubuntu1.4+esm9. Fixed in 2.1.0-4ubuntu1.4+esm9. How to fix ↓

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Expat is an XML parsing library that is widely used in various applications for processing XML data. It provides a fast and efficient way to parse XML documents, making it a popular choice among developers. The library is known for its simplicity and performance, but it has recently been found to have a critical vulnerability that can lead to severe security risks.

Vulnerability Detail

The vulnerability identified as CVE-2024-45490 affects Expat versions prior to 2.6.3. The issue arises in the xmlparse.c file, where the library fails to reject a negative length for the XML_ParseBuffer function. This oversight can lead to potential buffer overflows, allowing attackers to exploit the vulnerability to execute arbitrary code, crash applications, or manipulate XML data in harmful ways. The CVSS score for this vulnerability is 9.8, indicating a critical level of severity.

How To Fix

Minimum fixed version

2.1.0-4ubuntu1.4+esm9

This is the first release that contains the fix.

sudo apt-get install --only-upgrade 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 avoid using the XML_ParseBuffer function with negative lengths. However, this is not a permanent solution and should only be considered until the package is updated.

Conclusion

The vulnerability in the Expat package, identified as CVE-2024-45490, poses a critical risk due to its potential for buffer overflow attacks. Users are strongly advised to update to the latest version to secure their applications. Utilizing tools like Vulert can help monitor for such vulnerabilities in real-time.

See every vulnerability recorded for expat →

Share this vulnerability

FAQ

CVE-2024-45490 is a critical vulnerability in the Expat XML parsing library that allows for potential buffer overflows due to the failure to reject negative lengths in the XML_ParseBuffer function.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software. By using the Vulert playground, you can check if your application is affected by this vulnerability without any signup.

The vulnerability can lead to arbitrary code execution, application crashes, or manipulation of XML data, posing significant security risks to affected applications.

Yes, a patch is available. Users should update to Expat version 2.6.3 or later to mitigate the vulnerability.

If an immediate update is not possible, avoid using the XML_ParseBuffer function with negative lengths as a temporary workaround until the package can be updated.

Related vulnerabilities

Recent vulnerabilities recorded for expat.

How To Fix

Minimum fixed version

2.1.0-4ubuntu1.4+esm9

This is the first release that contains the fix.

sudo apt-get install --only-upgrade expat

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback

Follow Vulert in Google

Get more Vulert vulnerability and dependency-security updates in Google Search and AI results.