Skip to main content
EPSS 0.2%top 87%

CVE-2026-40991: CWE-611: Improper Restriction of XML External Entity Reference in Spring Spring REST Docs

0
Medium
Published: 06/10/2026 (06/10/2026, 00:31:51 UTC)
Source: CVE Database V5
Vendor/Project: Spring
Product: Spring REST Docs

Description

CVE-2026-40991 is an XML External Entity (XXE) injection vulnerability in Spring REST Docs when using spring-restdocs-webtestclient or spring-restdocs-restassured to document remote APIs accessed over HTTP. An attacker who compromises or tricks the user into documenting a malicious API can exploit this vulnerability during the execution of documentation-generating tests. The vulnerability affects Spring REST Docs versions 4.0.0, 3.0.0 through 3.0.5, and 2.0.0.RELEASE through 2.0.8.RELEASE. The CVSS score is 5.9 (medium severity). A patch is available for this vulnerability.

CVSS v3.1

Score 5.9medium

Attack Vector
Network
Attack Complexity
High
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
Low
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:L

Affected software

Spring

Spring REST Docs

Affected versions
>=4.0.0 <4.0.0.1>=3.0.0 <3.0.5.1>=2.0.0.RELEASE <2.0.9.RELEASE
org.springframework.restdocs/spring-restdocs-webtestclient
pkg:maven/org.springframework.restdocs/spring-restdocs-webtestclient
Affected versions
=4.0.03.0.0 <3.0.62.0.0.RELEASE <=2.0.8.RELEASE
org.springframework.restdocs/spring-restdocs-restassured
pkg:maven/org.springframework.restdocs/spring-restdocs-restassured
Affected versions
=4.0.03.0.0 <3.0.62.0.0.RELEASE <=2.0.8.RELEASE

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 08/12/2026, 16:20:12 UTC

Technical Analysis

This vulnerability arises from improper restriction of XML External Entity references (CWE-611) in Spring REST Docs components spring-restdocs-webtestclient and spring-restdocs-restassured. When these components document a remote API accessed over HTTP, an attacker who either compromises the API or deceives the user into documenting a malicious API can cause an XXE injection attack during the next execution of the documentation-generating tests. This can lead to high confidentiality impact with limited integrity and availability impact. The affected versions explicitly include 4.0.0, 3.0.0 through 3.0.5, and 2.0.0.RELEASE through 2.0.8.RELEASE. The vendor has confirmed a patch is available, although no specific remediation details or advisories were provided in the input data.

Potential Impact

Successful exploitation can result in disclosure of confidential information due to XXE injection when documenting a malicious or compromised remote API. The CVSS vector indicates network attack vector, high attack complexity, no privileges required, user interaction required, unchanged scope, high confidentiality impact, no integrity impact, and low availability impact. There are no known exploits in the wild at this time.

Mitigation Recommendations

A patch is available for this vulnerability. Users should apply the official fix from the Spring project to the affected versions of Spring REST Docs. Since the vendor advisory content is not provided, check the Spring project or official Spring REST Docs release notes for the exact patched versions and update accordingly. Avoid documenting untrusted or potentially malicious remote APIs until patched.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Data Version
5.2
Assigner Short Name
vmware
Date Reserved
2026-04-16T02:19:09.389Z
Cvss Version
3.1
State
PUBLISHED

Threat ID: 6a28a8028dd33fbd8595ef57

Added to database: 06/09/2026, 23:55:46 UTC

Last enriched: 08/12/2026, 16:20:12 UTC

Last updated: 09/13/2026, 10:01:30 UTC

Views: 87

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses