CVE-2026-40991 Spring REST Docs
| Affected software | Spring REST Docs |
|---|---|
| Severity | 5.9 Medium CVSS 3.1 |
| Fixed in | 4.0.1, 3.0.6 |
| Weakness | XML external entity (XXE) (CWE-611) |
| Published | 10 Jun 2026 |
| Updated | 23 Jul 2026 |
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.
Exploitation status
No public exploit
No exploit has been reported in the sources we check.
Exploitation status
- CISA KEV not listed
- VulnCheck KEV not listed
- CISA Vulnrichment exploitation: none
- Indexed PoC none indexed
- EPSS 0.22% chance in 30 days
Waratek protection
Waratek has a rule that blocks attacks on this vulnerability.
- Protection full XXE
- Action available security rule
- Review automated Inferred
- Record active
| Decided by | A vulnerability class already blocked by an ARMR security rule |
|---|---|
| Finding | Protected by Waratek's ARMR xxe security rule, which blocks this class of attack at the JVM level without a rule written for this CVE specifically. The CVE's weakness is CWE-611: XML External Entity Reference. |
How to mitigate CVE-2026-40991
Upgrade Spring REST Docs to a release that fixes it: 4.0.1 or 3.0.6. Until you can, Waratek RASP blocks exploitation with its XXE rule. It runs inside the Java application, with no code changes.
Affected software and releases
Maven packages
Affected and fixed versions, from OSV.dev| Package | Introduced | Fixed | Last affected |
|---|---|---|---|
org.springframework.restdocs:spring-restdocs-webtestclient |
4.0.0 | 4.0.1 |
unbounded |
org.springframework.restdocs:spring-restdocs-webtestclient |
3.0.0 | 3.0.6 |
unbounded |
org.springframework.restdocs:spring-restdocs-webtestclient |
0 | none | 2.0.8.RELEASE |
org.springframework.restdocs:spring-restdocs-restassured |
4.0.0 | 4.0.1 |
unbounded |
org.springframework.restdocs:spring-restdocs-restassured |
3.0.0 | 3.0.6 |
unbounded |
org.springframework.restdocs:spring-restdocs-restassured |
0 | none | 2.0.8.RELEASE |
Products and versions
3 products, 9 version entries| Source | Vendor | Product | Scheme | Affected versions |
|---|---|---|---|---|
| nvd | broadcom | spring rest docs | generic | ≥ 2.0.0 and < 2.0.9 · ≥ 3.0.0 and < 3.0.5.1 · 4.0.0 |
| osv | org.springframework.restdocs | spring-restdocs-restassured | generic | ≤ 2.0.8 · ≥ 3.0.0 and < 3.0.6 · ≥ 4.0.0 and < 4.0.1 |
| osv | org.springframework.restdocs | spring-restdocs-webtestclient | generic | ≤ 2.0.8 · ≥ 3.0.0 and < 3.0.6 · ≥ 4.0.0 and < 4.0.1 |
References
Timeline
Timeline
| Published | 2026-06-10 | By the CVE Program. |
|---|---|---|
| NVD record modified | 2026-07-23 | NVD's own last-modified date for this record. |