# CVE-2026-40991: XML External Entity (XXE) injection when documenting untrusted XML content

- Severity: Medium 5.9 (CVSS:3.1, scored by vmware) `CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:L`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.22%, higher than 13% of CVEs (2026-12-01)
- Published: 2026-06-09T23:46:33.676Z
- Modified: 2026-08-12T15:41:04.269Z
- Also known as: GHSA-6rpq-6vv2-5222
- Weaknesses: CWE-611
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: vmware

## 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.

(As written by CVE List.)

## Affected

- Spring Spring REST Docs: from 4.0.0 before 4.0.0.1; from 3.0.0 before 3.0.5.1; from 2.0.0.RELEASE before 2.0.9.RELEASE
- org.springframework.restdocs:spring-restdocs-webtestclient (Maven): from 4.0.0 before 4.0.1; from 3.0.0 before 3.0.6; up to 2.0.8.RELEASE
- org.springframework.restdocs:spring-restdocs-restassured (Maven): from 4.0.0 before 4.0.1; from 3.0.0 before 3.0.6; up to 2.0.8.RELEASE
- broadcom spring_rest_docs: from 2.0.0 before 2.0.9; from 3.0.0 before 3.0.5.1; 4.0.0

## Every score

- vmware: 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`
- GitHub: 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`

## References

- <https://spring.io/security/cve-2026-40991> (vendor-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-40991> (advisory)
- <https://github.com/spring-projects/spring-restdocs> (package)
- <https://github.com/spring-projects/spring-restdocs/releases/tag/v3.0.6> (web)
- <https://github.com/spring-projects/spring-restdocs/releases/tag/v4.0.1> (web)

## Sources

- CVE List: [CVE-2026-40991](https://www.cve.org/CVERecord?id=CVE-2026-40991), CVE Terms of Use, modified 2026-06-27
- GitHub Advisory Database: [GHSA-6rpq-6vv2-5222](https://github.com/advisories/GHSA-6rpq-6vv2-5222), CC-BY-4.0, modified 2026-08-12
- NVD: [CVE-2026-40991](https://nvd.nist.gov/vuln/detail/CVE-2026-40991), Public domain, modified 2026-07-23

---

Page: https://cve.day/CVE-2026-40991 · Whole record: https://cve.day/CVE-2026-40991.json · Rebuilt by cve.day 2026-11-25T22:59:24.285Z
