Denial of Service and Data Exposure Vulnerability in Expat Package

expat Updated 02 Oct 2025

Summary

21/01/2014
N/A
Yes i
Unrated
Not published

DEBIAN-CVE-2013-0340: expat 2.1.0 and earlier does not properly handle entities expansion unless an application developer uses the XML_SetEntityDeclHandler function, which allows remote attackers to cause a denial of service (resource consump... Affects expat versions < 2.4.1-2. Fixed in 2.4.1-2. 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

Expat is a widely used XML parsing library that allows applications to read and manipulate XML data efficiently. It is known for its speed and simplicity, making it a popular choice among developers for handling XML documents. However, certain versions of Expat, specifically 2.1.0 and earlier, have a vulnerability that can be exploited if developers do not implement proper entity declaration handling in their applications.

Vulnerability Detail

The vulnerability, identified as DEBIAN-CVE-2013-0340, arises from Expat's improper handling of entity expansion in XML documents. If an application does not use the XML_SetEntityDeclHandler function, it can lead to a denial of service through resource consumption, unauthorized HTTP requests to intranet servers, or even reading arbitrary files. This issue is classified as an XML External Entity (XXE) vulnerability, which poses significant risks to applications that process untrusted XML input.

How To Fix

Minimum fixed version

2.4.1-2

This is the first release that contains the fix.

sudo apt-get install --only-upgrade expat

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

Workaround

As a temporary workaround, developers can disable external entity expansion in their applications by ensuring that they implement the XML_SetEntityDeclHandler function correctly. This will prevent the exploitation of the vulnerability until an update can be applied.

Conclusion

The vulnerability in the Expat package poses significant risks to applications that process XML data. By understanding the nature of the vulnerability and taking the necessary steps to update the package, developers can protect their applications from potential exploitation. Utilizing tools like Vulert can further enhance security by providing real-time monitoring for vulnerabilities.

See every vulnerability recorded for expat →

Share this vulnerability

FAQ

The vulnerability allows for denial of service and potential data exposure due to improper handling of entity expansion in XML documents.

Expat versions 2.1.0 and earlier are affected by this vulnerability.

You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without requiring any signup.

You should update the Expat package to version 2.4.1-2 or later to mitigate this vulnerability.

Vulert monitors and alerts for open-source vulnerabilities in software using just a manifest file like package-lock.json, providing real-time insights into potential risks.

Related vulnerabilities

Recent vulnerabilities recorded for expat.

How To Fix

Minimum fixed version

2.4.1-2

This is the first release that contains the fix.

sudo apt-get install --only-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