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)
| Artifact | Affected versions | Fixed 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
41% of the dependent artifacts (5) still pull an affected version in their latest release.
| Depth | Dependent versions |
|---|---|
| Direct | 204 |
| 2 hops | 2 |
Most used dependents
- io.github.bgmsound » documentify-core5 usages
- com.epages » restdocs-api-spec-restassured3 usages
- com.epages » restdocs-api-spec-webtestclient2 usages
- io.github.bgmsound » documentify-mvc1 usages
- io.github.bgmsound » documentify-reactive1 usages
- org.springframework.boot » spring-boot-docs0 usages
- io.github.bgmsound » documentify-starter-mvc0 usages
- io.github.bgmsound » documentify-starter-reactive0 usages
- org.tuxdevelop » spring-batch-lightmin-documentation0 usages
- com.dtstack » dt-uic-web0 usages
- com.thowimmer » restdocs-api-spec-restassured0 usages
- com.thowimmer » restdocs-api-spec-webtestclient0 usages
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.
References
| Advisory | NVD CVE-2026-40991 | nvd.nist.gov |
| Package | spring-projects/spring-restdocs | github.com |
| Web | spring-projects/spring-restdocs release v3.0.6 | github.com |
| Web | spring-projects/spring-restdocs release v4.0.1 | github.com |
| Web | security/cve-2026-40991 | spring.io |
