XXE Vulnerability in Spring MVC

libspring-java Updated 02 Oct 2025

Summary

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

CVE-2013-7315: The Spring MVC in Spring Framework before 3.2.4 and 4.0.0.M1 through 4.0.0.M2 does not disable external entity resolution for the StAX XMLInputFactory, which allows context-dependent attackers to read arbitrary files, ca... Affects libspring-java versions < 3.0.6.RELEASE-10. Fixed in 3.0.6.RELEASE-10. 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 Spring MVC is a component of the Spring Framework, which is a popular Java-based framework used for building web applications. It provides a model-view-controller architecture and various features for handling HTTP requests and responses. The vulnerability described here affects versions before 3.2.4 and 4.0.0.M1 through 4.0.0.M2 of the Spring Framework. This vulnerability specifically relates to the StAX XMLInputFactory used in Spring MVC, which does not disable external entity resolution. This allows context-dependent attackers to exploit the vulnerability by crafting malicious XML with JAXB, leading to various security issues.

Vulnerability Detail

The vulnerability, known as CVE-2013-7315, is an XML External Entity (XXE) issue. It allows attackers to read arbitrary files, cause denial of service, and conduct Cross-Site Request Forgery (CSRF) attacks. By exploiting this vulnerability, an attacker can potentially gain unauthorized access to sensitive information, disrupt the application's functionality, and manipulate user sessions. This vulnerability is different from CVE-2013-4152, although they share some similarities.

How To Fix

Minimum fixed version

3.0.6.RELEASE-10

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 to a fixed version is not immediately feasible, a temporary workaround is to disable external entity resolution for the StAX XMLInputFactory manually. This can be done by configuring the XMLInputFactory to disallow external entities. Here is an example of how to disable external entity resolution in Spring MVC:

XMLInputFactory xmlInputFactory = XMLInputFactory.newInstance();
xmlInputFactory.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, false);
xmlInputFactory.setProperty(XMLInputFactory.SUPPORT_DTD, false);

It is important to note that this workaround may have implications on the application's functionality and should be thoroughly tested before deployment.

Conclusion

The XXE vulnerability in Spring MVC can have serious security implications, allowing attackers to read arbitrary files, cause denial of service, and conduct CSRF attacks. It is crucial to upgrade to a fixed version of the Spring Framework to mitigate this vulnerability. If immediate upgrade is not possible, the workaround of disabling external entity resolution should be considered, but with caution. Regular security assessments and input validation practices can help prevent XXE attacks. For further support and assistance in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for libspring-java →

Share this vulnerability

FAQ

This vulnerability allows attackers to read arbitrary files, cause denial of service, and conduct CSRF attacks. It can lead to unauthorized access to sensitive information, disruption of application functionality, and manipulation of user sessions.

Versions before 3.2.4 and 4.0.0.M1 through 4.0.0.M2 of the Spring Framework are affected by this vulnerability.

Yes, the vulnerability has been fixed in versions 3.2.4 and 4.0.0.M3 onwards of the Spring Framework. It is recommended to upgrade to the latest stable release to ensure the application is not exposed to this vulnerability.

If immediate upgrade is not feasible, a temporary workaround is to disable external entity resolution for the StAX XMLInputFactory manually. However, this workaround may have implications on the application's functionality and should be thoroughly tested before deployment.

To mitigate the risk of XXE attacks, it is important to validate and sanitize user input before processing it as XML. Use secure coding practices and input validation techniques to ensure that user-supplied XML is safe and does not contain malicious content.

Related vulnerabilities

Recent vulnerabilities recorded for libspring-java.

How To Fix

Minimum fixed version

3.0.6.RELEASE-10

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