CVE-2026-40991
Published:June 09, 2026
Updated:June 11, 2026
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.
Affected Packages
https://github.com/spring-projects/spring-restdocs.git (GITHUB):
Affected version(s) =v4.0.0 <v4.0.1Fix Suggestion:
Update to version v4.0.1https://github.com/spring-projects/spring-restdocs.git (GITHUB):
Affected version(s) >=v1.0.0.M1 <v3.0.6Fix Suggestion:
Update to version v3.0.6org.springframework.restdocs:spring-restdocs-core (JAVA):
Affected version(s) >=2.0.0.RELEASE <2.0.9.RELEASEFix Suggestion:
Update to version 2.0.9.RELEASEorg.springframework.restdocs:spring-restdocs-webtestclient (JAVA):
Affected version(s) >=3.0.0 <3.0.6Fix Suggestion:
Update to version 3.0.6org.springframework.restdocs:spring-restdocs-webtestclient (JAVA):
Affected version(s) =4.0.0 <4.0.1Fix Suggestion:
Update to version 4.0.1org.springframework.restdocs:spring-restdocs-core (JAVA):
Affected version(s) >=3.0.0 <3.0.6Fix Suggestion:
Update to version 3.0.6org.springframework.restdocs:spring-restdocs-webtestclient (JAVA):
Affected version(s) >=2.0.0.RELEASE <2.0.9.RELEASEFix Suggestion:
Update to version 2.0.9.RELEASEorg.springframework.restdocs:spring-restdocs-restassured (JAVA):
Affected version(s) >=3.0.0 <3.0.6Fix Suggestion:
Update to version 3.0.6org.springframework.restdocs:spring-restdocs-core (JAVA):
Affected version(s) =4.0.0 <4.0.1Fix Suggestion:
Update to version 4.0.1org.springframework.restdocs:spring-restdocs-restassured (JAVA):
Affected version(s) >=2.0.0.RELEASE <2.0.9.RELEASEFix Suggestion:
Update to version 2.0.9.RELEASERelated Resources (1)
Do you need more information?
Contact UsCVSS v4
Base Score:
6
Attack Vector
NETWORK
Attack Complexity
HIGH
Attack Requirements
NONE
Privileges Required
NONE
User Interaction
PASSIVE
Vulnerable System Confidentiality
HIGH
Vulnerable System Integrity
NONE
Vulnerable System Availability
LOW
Subsequent System Confidentiality
NONE
Subsequent System Integrity
NONE
Subsequent System Availability
NONE
CVSS v3
Base Score:
5.9
Attack Vector
NETWORK
Attack Complexity
HIGH
Privileges Required
NONE
User Interaction
REQUIRED
Scope
UNCHANGED
Confidentiality
HIGH
Integrity
NONE
Availability
LOW
Weakness Type (CWE)
Improper Restriction of XML External Entity Reference
EPSS
Base Score:
0.04