CVE-2026-40991: CWE-611: Improper Restriction of XML External Entity Reference in Spring Spring REST Docs
When using spring-restdocs-webtestclient or spring-restdocs-restassured to document a remote API accessed over HTTP, an attacker who compromises the API or tricks the user into documenting a malicious API can perform an XXE injection attack when the documentation-generating tests are next executed. Affected versions: Spring REST Docs 4.0.0; 3.0.0 through 3.0.5; 2.0.0.RELEASE through 2.0.8.RELEASE.
AI Analysis
Technical Summary
This vulnerability (CVE-2026-40991) involves improper restriction of XML External Entity references (CWE-611) in Spring REST Docs. Specifically, when using spring-restdocs-webtestclient or spring-restdocs-restassured to document a remote API accessed over HTTP, an attacker who either compromises the API or deceives the user into documenting a malicious API can perform an XXE injection attack. This attack occurs when the documentation-generating tests are executed, potentially allowing the attacker to cause high confidentiality impact without affecting integrity and with low availability impact. The affected versions are Spring REST Docs 4.0.0, 3.0.0 through 3.0.5, and 2.0.0.RELEASE through 2.0.8.RELEASE. No official patch or remediation level has been provided at this time.
Potential Impact
The vulnerability allows an attacker to perform an XML External Entity injection attack during the execution of documentation-generating tests that access a remote API over HTTP. This can lead to a high confidentiality impact, potentially exposing sensitive data. The integrity of the system is not impacted, and availability impact is low. There are no known exploits in the wild currently.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is available, users should exercise caution when documenting remote APIs accessed over HTTP, especially if the API source is untrusted or potentially compromised. Avoid documenting untrusted or suspicious APIs using spring-restdocs-webtestclient or spring-restdocs-restassured to mitigate risk.
CVE-2026-40991: CWE-611: Improper Restriction of XML External Entity Reference in Spring Spring REST Docs
Description
When using spring-restdocs-webtestclient or spring-restdocs-restassured to document a remote API accessed over HTTP, an attacker who compromises the API or tricks the user into documenting a malicious API can perform an XXE injection attack when the documentation-generating tests are next executed. Affected versions: Spring REST Docs 4.0.0; 3.0.0 through 3.0.5; 2.0.0.RELEASE through 2.0.8.RELEASE.
CVSS v3.1
Score 5.9medium
Affected software
pkg:maven/org.springframework.restdocs/spring-restdocs-webtestclientpkg:maven/org.springframework.restdocs/spring-restdocs-restassuredRun on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
This vulnerability (CVE-2026-40991) involves improper restriction of XML External Entity references (CWE-611) in Spring REST Docs. Specifically, when using spring-restdocs-webtestclient or spring-restdocs-restassured to document a remote API accessed over HTTP, an attacker who either compromises the API or deceives the user into documenting a malicious API can perform an XXE injection attack. This attack occurs when the documentation-generating tests are executed, potentially allowing the attacker to cause high confidentiality impact without affecting integrity and with low availability impact. The affected versions are Spring REST Docs 4.0.0, 3.0.0 through 3.0.5, and 2.0.0.RELEASE through 2.0.8.RELEASE. No official patch or remediation level has been provided at this time.
Potential Impact
The vulnerability allows an attacker to perform an XML External Entity injection attack during the execution of documentation-generating tests that access a remote API over HTTP. This can lead to a high confidentiality impact, potentially exposing sensitive data. The integrity of the system is not impacted, and availability impact is low. There are no known exploits in the wild currently.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is available, users should exercise caution when documenting remote APIs accessed over HTTP, especially if the API source is untrusted or potentially compromised. Avoid documenting untrusted or suspicious APIs using spring-restdocs-webtestclient or spring-restdocs-restassured to mitigate risk.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- vmware
- Date Reserved
- 2026-04-16T02:19:09.389Z
- Cvss Version
- 3.1
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a28a8028dd33fbd8595ef57
Added to database: 06/09/2026, 23:55:46 UTC
Last enriched: 06/28/2026, 20:59:16 UTC
Last updated: 07/31/2026, 19:22:58 UTC
Views: 63
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
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
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.