Integer Overflow in Expat (libexpat) before 2.4.5

expat Updated 02 Oct 2025

Summary

18/02/2022
N/A
Yes i
Critical
9.8

CVE-2022-25315: In Expat (aka libexpat) before 2.4.5, there is an integer overflow in storeRawNames. Affects expat across 2 version ranges.

< 2.2.10-r2 < 97a4840578693a346e79302909b67d97492e1880

Fixed in 2.2.10-r2. 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 (libexpat) is an open-source XML parsing library that is widely used in various applications. It provides a set of functions and APIs for parsing XML documents. The library is written in C and is known for its simplicity, efficiency, and portability. However, a vulnerability has been discovered in versions before 2.4.5 that can lead to an integer overflow in the storeRawNames function.

Vulnerability Detail

The integer overflow vulnerability in Expat's storeRawNames function can be exploited by an attacker to cause a heap-based buffer overflow. By supplying a specially crafted XML document, an attacker can trigger the overflow and potentially execute arbitrary code or crash the application. The vulnerability arises due to a lack of proper input validation and bounds checking. The impact of this vulnerability can be severe, as it allows an attacker to gain unauthorized access or disrupt the normal operation of the affected application.

How To Fix

Minimum fixed version

2.2.10-r2

This is the first release that contains the fix.

sudo apk add --upgrade expat

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

Workaround

There is no known workaround for this vulnerability. It is crucial to apply the official patch or update to the fixed version as soon as possible.

Conclusion

The integer overflow vulnerability in Expat (libexpat) before version 2.4.5 can have severe consequences, including unauthorized access and application crashes. It is crucial to update to the fixed version or apply the official patch as soon as possible. For further assistance and support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for expat →

Share this vulnerability

FAQ

Expat (libexpat) is an open-source XML parsing library written in C. It is widely used in various applications for parsing XML documents.

The vulnerability can lead to a heap-based buffer overflow, potentially allowing an attacker to execute arbitrary code or crash the application.

To fix this vulnerability, update to Expat version 2.4.5 or later. Ensure that all dependencies and applications using Expat are also updated.

No, there is no known workaround. It is essential to apply the official patch or update to the fixed version.

The updated version of Expat can be obtained from the official Expat website or through your package manager.

Related vulnerabilities

Recent vulnerabilities recorded for expat.

How To Fix

Minimum fixed version

2.2.10-r2

This is the first release that contains the fix.

sudo apk add --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