Critical XXE Vulnerability in libxml2: Potential for Remote Attacks

libxml2 Updated 02 Oct 2025

Summary

16/11/2016
N/A
Yes i
Medium
5.5

ALPINE-CVE-2016-9318: libxml2 2.9.4 and earlier, as used in XMLSec 1.2.23 and earlier and other products, does not offer a flag directly indicating that the current document may be read but other files may not be opened, which makes it easier... Affects libxml2 versions < 2.9.4-r2. Fixed in 2.9.4-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 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

libxml2 is a widely-used XML parsing library that provides a range of functionalities for processing XML documents. It is integral to many applications, including XMLSec, which relies on libxml2 for secure XML processing. The library is known for its performance and compliance with XML standards, making it a popular choice among developers. However, it has been found to be vulnerable to XML External Entity (XXE) attacks, which can lead to unauthorized access to sensitive files and data.

Vulnerability Detail

The vulnerability identified as CVE-2016-9318 affects libxml2 versions 2.9.4 and earlier. It arises from the lack of a flag that indicates whether the current document can be read while preventing the opening of other files. This oversight allows remote attackers to exploit crafted XML documents to conduct XXE attacks, potentially leading to the exposure of sensitive information or system compromise. The vulnerability has a CVSS score of 5.5, indicating a moderate severity level.

How To Fix

Minimum fixed version

2.9.4-r2

This is the first release that contains the fix.

sudo apk add --upgrade libxml2

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

Workaround

As a temporary workaround, consider disabling external entity processing in your XML parser configuration. This can help mitigate the risk of XXE attacks until the library is updated. For example, in your XML parsing code, you can set the appropriate flags to disable DTD processing.

Conclusion

The vulnerability in libxml2, identified as CVE-2016-9318, poses a significant risk due to its potential for enabling XXE attacks. It is crucial for developers using this library to update to the patched version to mitigate risks. Utilizing tools like Vulert can further enhance security by providing real-time alerts for vulnerabilities.

See every vulnerability recorded for libxml2 →

Share this vulnerability

FAQ

An XXE (XML External Entity) attack is a type of security vulnerability that allows an attacker to interfere with the processing of XML data. It can lead to the disclosure of confidential data, server-side request forgery, and other malicious activities.

You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability. It requires no signup and uses your manifest file to monitor for vulnerabilities.

Failing to address this vulnerability can expose your application to remote attacks, leading to data breaches, unauthorized access to sensitive files, and potential system compromise.

Yes, you can prevent XXE attacks by disabling DTD processing in your XML parser and validating XML input against a strict schema.

Vulert is a tool that monitors and alerts for open-source vulnerabilities in your software using just a manifest file. It helps developers stay informed about potential security risks without needing to access the code directly.

Related vulnerabilities

Recent vulnerabilities recorded for libxml2.

How To Fix

Minimum fixed version

2.9.4-r2

This is the first release that contains the fix.

sudo apk add --upgrade libxml2

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