XXE Attack in Spring Framework

libspring-java Updated 02 Oct 2025

Summary

25/05/2017
N/A
Yes i
High
8.8

CVE-2014-0225: When processing user provided XML documents, the Spring Framework 4.0.0 to 4.0.4, 3.0.0 to 3.2.8, and possibly earlier unsupported versions did not disable by default the resolution of URI references in a DTD declaration... Affects libspring-java versions < 3.0.6.RELEASE-14. Fixed in 3.0.6.RELEASE-14. 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 Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

The Spring Framework is a popular open-source application framework for Java. It provides comprehensive infrastructure support for developing Java applications. The libspring-java package in Debian is an implementation of the Spring Framework for the Debian ecosystem. This package is widely used in Debian-based systems for developing Java applications. However, a vulnerability, known as CVE-2014-0225, has been identified in versions 3.0.0 to 3.2.8 and 4.0.0 to 4.0.4 of the Spring Framework. This vulnerability allows for XML External Entity (XXE) attacks, which can lead to unauthorized access to sensitive data and remote code execution.

Vulnerability Detail

The vulnerability (CVE-2014-0225) in the Spring Framework arises from the framework's default behavior of not disabling the resolution of URI references in a Document Type Definition (DTD) declaration when processing user-provided XML documents. This enables an attacker to launch an XXE attack by including malicious external entities in the XML document. By exploiting this vulnerability, an attacker can read arbitrary files, perform remote requests, and potentially execute arbitrary code on the server. The severity of this vulnerability is rated as high, with a CVSS score of 8.8.

How To Fix

Minimum fixed version

3.0.6.RELEASE-14

This is the first release that contains the fix.

sudo apt-get install --only-upgrade libspring-java

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

Workaround

If upgrading the libspring-java package is not immediately feasible, a temporary workaround is to explicitly disable the resolution of URI references in DTD declarations. This can be done by configuring the XML parser used by the application to disallow external entity resolution. Here is an example of how to disable external entity resolution using the Apache Xerces XML parser in a Spring application:

import org.apache.xerces.jaxp.DocumentBuilderFactoryImpl;

public class XXEWorkaround {

    public static void main(String[] args) {
        System.setProperty("javax.xml.parsers.DocumentBuilderFactory", DocumentBuilderFactoryImpl.class.getName());
        System.setProperty("javax.xml.parsers.SAXParserFactory", "org.apache.xerces.jaxp.SAXParserFactoryImpl");
        System.setProperty("org.apache.xerces.xni.parser.XMLParserConfiguration", "org.apache.xerces.parsers.XIncludeParserConfiguration");
    }

}

Conclusion

The XXE vulnerability in the Spring Framework (CVE-2014-0225) poses a significant risk to applications using the affected versions. It is crucial to promptly upgrade the libspring-java package to the fixed version or apply the recommended workaround to mitigate the risk of XXE attacks. Regularly monitoring for vulnerabilities using tools like Vulert can also help ensure the security of your software.

See every vulnerability recorded for libspring-java →

Share this vulnerability

FAQ

An XML External Entity (XXE) attack is a type of attack that exploits vulnerabilities in XML parsers. By including malicious external entities in XML documents, an attacker can read arbitrary files, perform remote requests, and potentially execute arbitrary code on the server.

If your application uses the affected versions of the Spring Framework, it is vulnerable to XXE attacks. An attacker can exploit this vulnerability to gain unauthorized access to sensitive data, perform remote code execution, and potentially compromise the entire system.

Yes, a fix is available for the XXE vulnerability in the Spring Framework. It is recommended to upgrade the libspring-java package to version 3.0.6.RELEASE-14 or later to mitigate the risk of XXE attacks.

Yes, if upgrading the libspring-java package is not immediately feasible, you can apply a temporary workaround by disabling the resolution of URI references in DTD declarations. This can be done by configuring the XML parser used by the application to disallow external entity resolution.

For further support on vulnerability remediation and assistance with securing your application, you can contact info@devnack.com. Our team of experts will be happy to help you.

Related vulnerabilities

Recent vulnerabilities recorded for libspring-java.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Minimum fixed version

3.0.6.RELEASE-14

This is the first release that contains the fix.

sudo apt-get install --only-upgrade libspring-java

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