CVE-2026-40991: Spring REST Docs REST Assured & WebFlux are vulnerable to Improper Restriction of XML External Entity Reference
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.
Published Jun 10, 2026 · Updated Aug 12, 2026
Affected packages
org.springframework.restdocs:spring-restdocs-webtestclient
- Ecosystem
- Maven
- Affected
- = 4.0.0
- Fixed in
- 4.0.1
- Check
mvn dependency:tree -Dincludes=org.springframework.restdocs:spring-restdocs-webtestclient
org.springframework.restdocs:spring-restdocs-webtestclient
- Ecosystem
- Maven
- Affected
- >= 3.0.0, <= 3.0.5
- Fixed in
- 3.0.6
- Check
mvn dependency:tree -Dincludes=org.springframework.restdocs:spring-restdocs-webtestclient
org.springframework.restdocs:spring-restdocs-webtestclient
- Ecosystem
- Maven
- Affected
- <= 2.0.8.RELEASE
- Fixed in
- No patched version yet
- Check
mvn dependency:tree -Dincludes=org.springframework.restdocs:spring-restdocs-webtestclient
org.springframework.restdocs:spring-restdocs-restassured
- Ecosystem
- Maven
- Affected
- = 4.0.0
- Fixed in
- 4.0.1
- Check
mvn dependency:tree -Dincludes=org.springframework.restdocs:spring-restdocs-restassured
org.springframework.restdocs:spring-restdocs-restassured
- Ecosystem
- Maven
- Affected
- >= 3.0.0, <= 3.0.5
- Fixed in
- 3.0.6
- Check
mvn dependency:tree -Dincludes=org.springframework.restdocs:spring-restdocs-restassured
org.springframework.restdocs:spring-restdocs-restassured
- Ecosystem
- Maven
- Affected
- <= 2.0.8.RELEASE
- Fixed in
- No patched version yet
- Check
mvn dependency:tree -Dincludes=org.springframework.restdocs:spring-restdocs-restassured
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
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.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
