Skip to main content
VulnerabilityPublished Updated

CVE-2026-40991: Spring REST Docs · XML External Entity (XXE)

Affects Spring REST DocsSource CVE Database V5

0
Compare

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

CVSS 3.1 base score
5.9Medium
How severe the flaw is on the 0–10 CVSS scale.
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:L

Exploitation evidence

  1. Disclosed: evidence found.

    CVE published 10 Jun 2026

  2. Detectable: no evidence on record.

    No public nuclei template indexed

  3. Weaponized: no evidence on record.

    No public exploit code indexed in Metasploit or Exploit-DB

  4. Exploited in the wild: no evidence on record.

    Not in CISA KEV and no source reports exploitation

  5. Observed by OffSeq 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

ProductAffectedFixed in
SpringSpring REST DocsAffected
  • >=4.0.0 <4.0.0.1
Fixed in
  • 4.0.0.1
SpringSpring REST DocsAffected
  • >=3.0.0 <3.0.5.1
Fixed in
  • 3.0.5.1
SpringSpring REST DocsAffected
  • >=2.0.0.RELEASE <2.0.9.RELEASE
Fixed in
  • 2.0.9.RELEASE
Mavenorg.springframework.restdocs/spring-restdocs-webtestclientpkg:maven/org.springframework.restdocs/spring-restdocs-webtestclientOther threatsAffected
  • =4.0.0
  • 3.0.0 <3.0.6
  • 2.0.0.RELEASE <=2.0.8.RELEASE
Fixed in
  • 3.0.6
Mavenorg.springframework.restdocs/spring-restdocs-restassuredpkg:maven/org.springframework.restdocs/spring-restdocs-restassuredOther threatsAffected
  • =4.0.0
  • 3.0.0 <3.0.6
  • 2.0.0.RELEASE <=2.0.8.RELEASE
Fixed in
  • 3.0.6

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.

References

Community reviews

Loading reviews…