CVE-2026-40991: Spring REST Docs · XML External Entity (XXE)
Affects Spring REST DocsSource CVE Database V5
Not known to be exploited · CVSS 5.9 Medium · fixed in 4.0.0.1 : update Spring REST Docs when convenient.
Data as of 30 Oct 2026, 06:59 UTC
- EPSS
- 0.2% chance of exploitation in 30 days – higher than 12% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
- Patch
- Available – fixed in 4.0.0.1, 3.0.5.1, 2.0.9.RELEASE +1
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:LExploitation evidence
Disclosed: evidence found.
CVE published 10 Jun 2026
Detectable: no evidence on record.
No public nuclei template indexed
Weaponized: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 29 Oct 2026.
What to do
Upgrade Spring REST Docs to 4.0.0.1, 3.0.5.1 or 2.0.9.RELEASE; org.springframework.restdocs/spring-restdocs-webtestclient and org.springframework.restdocs/spring-restdocs-restassured to 3.0.6.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| SpringSpring REST Docs | Affected
| Fixed in
|
| SpringSpring REST Docs | Affected
| Fixed in
|
| SpringSpring REST Docs | Affected
| Fixed in
|
Mavenorg.springframework.restdocs/spring-restdocs-webtestclientpkg:maven/org.springframework.restdocs/spring-restdocs-webtestclientOther threats | Affected
| Fixed in
|
Mavenorg.springframework.restdocs/spring-restdocs-restassuredpkg:maven/org.springframework.restdocs/spring-restdocs-restassuredOther threats | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
A patch is available for this vulnerability. Users should apply the official fix from the Spring project to the affected versions of Spring REST Docs. Since the vendor advisory content is not provided, check the Spring project or official Spring REST Docs release notes for the exact patched versions and update accordingly. Avoid documenting untrusted or potentially malicious remote APIs until patched.
Description
CVE-2026-40991 is an XML External Entity (XXE) injection vulnerability in Spring REST Docs when using spring-restdocs-webtestclient or spring-restdocs-restassured to document remote APIs accessed over HTTP. An attacker who compromises or tricks the user into documenting a malicious API can exploit this vulnerability during the execution of documentation-generating tests. The vulnerability affects Spring REST Docs versions 4.0.0, 3.0.0 through 3.0.5, and 2.0.0.RELEASE through 2.0.8.RELEASE. The CVSS score is 5.9 (medium severity). A patch is available for this vulnerability.