Integer Overflow Vulnerability in Expat Package: CVE-2022-22827

expat Updated 02 Oct 2025

Summary

10/01/2022
N/A
Yes i
High
8.8

ALPINE-CVE-2022-22827: storeAtts 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 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 widely used in various applications for its efficiency and ease of use. It provides a simple interface for parsing XML documents and is known for its performance and reliability. However, like any software, it can be susceptible to vulnerabilities. The specific issue at hand is an integer overflow that can lead to severe consequences if exploited, affecting the integrity and security of applications relying on this library.

Vulnerability Detail

The vulnerability identified as CVE-2022-22827 exists in the storeAtts function within xmlparse.c of the Expat library prior to version 2.4.3. This integer overflow can be exploited by attackers to manipulate memory, potentially leading to arbitrary code execution or denial of service. The ramifications of this vulnerability are significant, as it can compromise the security of applications that utilize Expat for XML parsing, allowing attackers to gain unauthorized access or disrupt services.

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 mitigate the risk of exploitation until the package can be updated.

Conclusion

CVE-2022-22827 represents a significant security risk for applications utilizing the Expat XML parsing library. It is crucial for developers and system administrators to update to the patched version to mitigate potential threats. Utilizing tools like Vulert can aid in monitoring and managing vulnerabilities effectively.

See every vulnerability recorded for expat →

Share this vulnerability

FAQ

CVE-2022-22827 is an integer overflow vulnerability in the Expat XML parsing library that can lead to memory manipulation and potential security breaches.

You can use Vulert, which monitors open-source vulnerabilities in your software by analyzing your manifest file. Visit Vulert Scanner to check your application without needing to sign up.

Exploitation of this vulnerability can lead to arbitrary code execution, denial of service, or unauthorized access to sensitive data within applications using the Expat library.

The best way to protect your application is to update the Expat package to the latest patched version. Regularly monitor for vulnerabilities using tools like Vulert.

The CVSS score for CVE-2022-22827 is 8.8, indicating a high severity level that requires prompt attention.

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