Critical Integer Overflow Vulnerability in Expat Package

expat Updated 02 Oct 2025

Summary

10/01/2022
N/A
Yes i
Critical
9.8

ALPINE-CVE-2022-22822: addBinding in xmlparse.c in Expat (aka libexpat) before 2.4.3 has an integer overflow. Affects expat versions < 2.2.10-r0. Fixed in 2.2.10-r0. 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 MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

Expat is a widely used XML parsing library that enables applications to read and process XML data efficiently. It is known for its speed and simplicity, making it a popular choice among developers. However, the library has been found to be vulnerable to an integer overflow issue, which can lead to severe security risks if not addressed promptly.

Vulnerability Detail

The vulnerability, identified as CVE-2022-22822, originates from the addBinding function in xmlparse.c within Expat versions prior to 2.4.3. This integer overflow can be exploited by attackers to manipulate XML data, potentially leading to denial of service or arbitrary code execution. The severity of this vulnerability is underscored by its CVSS score of 9.8, indicating a critical risk level that necessitates immediate attention.

How To Fix

Minimum fixed version

2.2.10-r0

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

If immediate updating is not feasible, consider implementing input validation to sanitize XML data before processing it with Expat. This can help reduce the risk of exploitation until the package is updated.

Conclusion

The integer overflow vulnerability in the Expat package poses a significant risk to applications that utilize this library. It is crucial to update to the patched versions to safeguard against potential exploits. Regular monitoring and vulnerability assessments, such as those provided by Vulert, can help maintain the security of your software.

See every vulnerability recorded for expat →

Share this vulnerability

FAQ

CVE-2022-22822 is a critical integer overflow vulnerability found in the Expat XML parsing library, affecting versions prior to 2.4.3.

Exploitation of this vulnerability can lead to denial of service or arbitrary code execution, compromising the security of your application.

The CVSS score for CVE-2022-22822 is 9.8, indicating a critical risk level.

You can use the Vulert platform to check if your application is affected by this vulnerability by analyzing your manifest file.

Vulert is a tool that monitors and alerts in real-time for open-source vulnerabilities in software by using a manifest file like package-lock.json.

Related vulnerabilities

Recent vulnerabilities recorded for expat.

How To Fix

Minimum fixed version

2.2.10-r0

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