MODERATE 5.9

CVE-2026-40991

Spring REST Docs REST Assured & WebFlux are vulnerable to Improper Restriction of XML External Entity Reference

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.

Affected Maven artifacts (2)

ArtifactAffected versionsFixed in
org.springframework.restdocs » spring-restdocs-restassured
<= 2.0.8.RELEASE>= 3.0.0, < 3.0.6>= 4.0.0, < 4.0.1
3.0.6, 4.0.1
org.springframework.restdocs » spring-restdocs-webtestclient
<= 2.0.8.RELEASE>= 3.0.0, < 3.0.6>= 4.0.0, < 4.0.1
3.0.6, 4.0.1

Blast radius

2affected artifacts
47affected versions
12dependent artifacts (est.)
206dependent versions

41% of the dependent artifacts (5) still pull an affected version in their latest release.

DepthDependent versions
Direct
204
2 hops
2

Most used dependents

Computed from the dependency graph of build 20261124.0621 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.