Denial of Service Vulnerability in libexpat

expat Updated 02 Oct 2025

Summary

04/02/2024
N/A
Yes i
High
7.5

CVE-2023-52425: libexpat through 2.5.0 allows a denial of service (resource consumption) because many full reparsings are required in the case of a large token for which multiple buffer fills are needed. Affects expat across 2 version ranges.

< 2.6.0-r0 < 654d2de0da85662fcc7644a7acd7c2dd2cfb21f0

Fixed in 2.6.0-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 Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

libexpat is a widely used open-source library for parsing XML documents. It provides a set of functions and APIs that allow developers to parse and process XML data efficiently. However, versions up to 2.5.0 of libexpat are vulnerable to a denial of service attack. This vulnerability can be exploited by an attacker to consume excessive system resources, leading to a degradation in performance or even a complete system crash.

Vulnerability Detail

The vulnerability in libexpat arises from the need for multiple full reparsings when processing a large token that requires multiple buffer fills. This can be exploited by an attacker to craft malicious XML data that triggers the repetitive reparsing process, causing a significant increase in resource consumption. As a result, the targeted system may become unresponsive or crash due to resource exhaustion.

How To Fix

Minimum fixed version

2.6.0-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 updating libexpat is not immediately feasible, a temporary workaround is to limit the size of the XML input or implement input validation to reject excessively large tokens. However, this workaround may impact the functionality or compatibility of the affected application, and it is strongly advised to update to the latest version of libexpat as soon as possible.

Conclusion

The denial of service vulnerability in libexpat can be mitigated by updating to version 2.6.0-r0 or later. It is important to promptly apply the necessary patches to ensure the security and stability of applications that rely on libexpat. For further assistance or support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for expat →

Share this vulnerability

FAQ

libexpat is an open-source library for parsing XML documents. It provides functions and APIs for efficient XML data processing.

The vulnerability allows an attacker to consume excessive system resources, leading to a denial of service condition. This can result in system slowdowns, unresponsiveness, or even crashes.

To fix this vulnerability, update libexpat to version 2.6.0-r0 or later. Rebuild your applications using the updated version.

A temporary workaround is to limit the size of XML input or implement input validation to reject excessively large tokens. However, updating to the latest version is strongly recommended.

For more information about this vulnerability, refer to the official CVE-2023-52425 entry or visit the Vulert playground at Vulert Scanner.

Related vulnerabilities

Recent vulnerabilities recorded for expat.

How To Fix

Minimum fixed version

2.6.0-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