CVE-2026-40991: When using spring-restdocs-webtestclient or spring-restdocs-restassured to document a remote API accessed over
CVE-2026-40991 is a medium-severity flaw (CVSS 5.9) affecting spring rest docs. Below: why it ranks where it does, which versions are affected, what to do, and the exact commands.
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.
Why this priority
- No elevated risk signals yet
A fixed release or distro patch exists.
Risk facts
| CVSS score | 5.9 (Medium) |
| Attack vector | Network (remote) |
| Attack complexity | High |
| Privileges needed | None |
| User interaction | Required |
| EPSS exploit chance | 0.2% (top 87%) |
| CISA exploited list | No |
| Weakness | CWE-611 |
| Published | 2026-06-10 |
| Last modified | 2026-07-23 |
Last updated 2026-07-23 · Sources: CVE Program, NVD, CISA KEV, EPSS and vendor advisories · How we score
Am I affected?
Timeline
- Published CVE record published
- Updated Record last modified
Scores and fixes here are computed automatically from those and other public sources. Confirm with the vendor advisory before changing production systems.
Quick answers
How do I fix CVE-2026-40991?
spring rest docs: upgrade to 2.0.9, 3.0.5.1. Exact commands for each OS are on this page.
Is CVE-2026-40991 being exploited?
CVE-2026-40991 is not on the CISA Known Exploited Vulnerabilities list at the time of the last update. Check again, as this can change.
What does CVE-2026-40991 affect?
CVE-2026-40991 affects spring rest docs. Severity is medium (CVSS 5.9). 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
How urgent is CVE-2026-40991?
Priority 24/100. No elevated risk signals yet.