CVE-2026-40991
XML External Entity (XXE) injection when documenting untrusted XML content
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.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- High
- Privileges needed
- None
- User interaction
- Required
What an attacker can affect
- Confidentiality
- High
- Integrity
- None
- Availability
- Low
Exploit likelihood
What each source reports
CVE List Score used
5.9
XML External Entity (XXE) injection when documenting untrusted XML content
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.
- Record
CVE-2026-40991- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:L - Weakness
- CWE-611
- Updated
- 2026-11-02
EUVDEUVD-2026-35885
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 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.
- Record
EUVD-2026-35885- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:L - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-6rpq-6vv2-5222
5.9
Spring REST Docs REST Assured & WebFlux are vulnerable to Improper Restriction of XML External Entity Reference
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.
- Record
GHSA-6rpq-6vv2-5222- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:L - Weakness
- CWE-611
- Updated
- 2026-11-02
NVD
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 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.
- Record
CVE-2026-40991- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:L - Weakness
- CWE-611
- Updated
- 2026-11-02
OSV
5.9
XML External Entity (XXE) injection when documenting untrusted XML content
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.
- Record
CVE-2026-40991- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:L - Weakness
- CWE-611
- Updated
- 2026-11-02
OSVGHSA-6rpq-6vv2-5222
5.9
Spring REST Docs REST Assured & WebFlux are vulnerable to Improper Restriction of XML External Entity Reference
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.
- Record
GHSA-6rpq-6vv2-5222- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:L - Weakness
- CWE-611
- Updated
- 2026-11-02
OSVCLSA-2026-1793192311 No score
TuxCare security update for org.springframework.restdocs (1 CVE)
TuxCare rebuilt 2 org.springframework.restdocs packages to address 1 CVE. Fixed in 2.0.5.RELEASE-tuxcare.1.
- Record
CLSA-2026-1793192311- Updated
- 2026-11-02
OSVROOT-APP-MAVEN-CVE-2026-40991 No score
CVE-2026-40991 in io.root.org.springframework.restdocs:spring-restdocs-restassured - Patched by Root
Root has patched CVE-2026-40991 in the io.root.org.springframework.restdocs:spring-restdocs-restassured package for Root:Maven. Multiple fixed versions available.
- Record
ROOT-APP-MAVEN-CVE-2026-40991- Updated
- 2026-11-02
Affected products
Affected packages
Show 6 moreShow less
| Package | Affected | Fixed |
|---|---|---|
org.springframework.restdocs:spring-restdocs-webtestclientMaven |
through 2.0.8.RELEASE, plus listed versions 2.0.0.RELEASE2.0.1.RELEASE2.0.2.RELEASE2.0.3.RELEASE2.0.4.RELEASE2.0.5.RELEASE2.0.6.RELEASE2.0.7.RELEASE |
None known |
org.springframework.restdocs:spring-restdocs-restassuredMaven |
4.0.0 up to 4.0.1 | 4.0.1 |
org.springframework.restdocs:spring-restdocs-restassuredMaven |
3.0.0 up to 3.0.6, plus listed versions 3.0.13.0.23.0.33.0.43.0.5 |
3.0.6 |
org.springframework.restdocs:spring-restdocs-restassuredMaven |
through 2.0.8.RELEASE, plus listed versions 1.1.0.RELEASE1.1.1.RELEASE1.1.2.RELEASE1.1.3.RELEASE1.2.0.RELEASE Show 14 moreShow less1.2.1.RELEASE1.2.2.RELEASE1.2.3.RELEASE1.2.4.RELEASE1.2.5.RELEASE1.2.6.RELEASE2.0.0.RELEASE2.0.1.RELEASE2.0.2.RELEASE2.0.3.RELEASE2.0.4.RELEASE2.0.5.RELEASE2.0.6.RELEASE2.0.7.RELEASE |
None known |
io.root.org.springframework.restdocs:spring-restdocs-restassuredRoot:Maven |
before 2.0.8.RELEASE-root.io.1 | 2.0.8.RELEASE-root.io.13.0.3-root.io.1 |
org.springframework.restdocs:spring-restdocs-restassuredRoot:Maven |
before 2.0.8.RELEASE-aikido.1 | 2.0.8.RELEASE-aikido.13.0.3-aikido.1 |
History
| Recorded | Changed | Sources |
|---|---|---|
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2026-40991 is a medium vulnerability (CVSS 5.9) in Broadcom Spring Rest Docs, published June 9, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.22%, the 12th percentile. Fixed in org.springframework.restdocs:spring-restdocs-webtestclient 4.0.1.
References
spring.io/security/cve-2026-40991
nvd.nist.gov/vuln/detail/CVE-2026-40991
github.com/spring-projects/spring-restdocs/releases/tag/v3.0.6
github.com/spring-projects/spring-restdocs/releases/tag/v4.0.1
github.com/advisories/GHSA-6rpq-6vv2-5222
github.com/CVEProject/cvelistV5/tree/main/cves/2026/40xxx/CVE-2026-40991.json
github.com/spring-projects/spring-restdocs