Vulnerability in Expat (libexpat) Package - CVE-2022-25235

expat Updated 02 Oct 2025

Summary

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

CVE-2022-25235: xmltok_impl.c in Expat (aka libexpat) before 2.4.5 lacks certain validation of encoding, such as checks for whether a UTF-8 character is valid in a certain context. 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 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

The Expat (libexpat) package is an open-source XML parsing library that is widely used in various applications. It provides functionality for parsing XML documents and extracting data from them. The package is an integral part of the Alpine Linux distribution, specifically versions 3.12 to 3.18. However, it has been discovered that the package is vulnerable to CVE-2022-25235, which can lead to potential security issues.

Vulnerability Detail

CVE-2022-25235 is a vulnerability in the Expat (libexpat) package that exists in versions prior to 2.4.5. The vulnerability arises from a lack of certain encoding validation checks in the xmltok_impl.c file. Specifically, the package fails to validate whether a UTF-8 character is valid in a given context. This can potentially allow an attacker to exploit the vulnerability and execute arbitrary code or perform other malicious actions. The severity of this vulnerability is rated as critical with a CVSS score of 9.8.

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 essential to update the Expat (libexpat) package to the fixed version as soon as possible.

Conclusion

In conclusion, the Expat (libexpat) package is vulnerable to CVE-2022-25235, which can lead to potential security risks. It is crucial to update the package to version 2.4.5 or later to mitigate the vulnerability and enhance the security of the system or application. For further support and assistance in vulnerability remediation, you can contact DevNack.com.

See every vulnerability recorded for expat →

Share this vulnerability

FAQ

The vulnerability can allow an attacker to execute arbitrary code or perform other malicious actions, potentially leading to a compromise of the affected system or application.

Versions prior to 2.4.5 of the Expat (libexpat) package are affected. This includes versions in the Alpine Linux distribution from 3.12 to 3.18.

No, there is no known workaround for this vulnerability. Updating the Expat (libexpat) package to the fixed version is the recommended solution.

To update the Expat (libexpat) package, you can use the package manager of your operating system or distribution. For Alpine Linux, you can use the 'apk' package manager and install the fixed version (2.4.5 or later) of the package.

You can find more information about this vulnerability, including technical details and the CVE identifier (CVE-2022-25235), in the National Vulnerability Database (NVD) or the Expat (libexpat) package's official documentation.

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