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

- Priority: **Routine**
- Reason: Not severe (CVSS 5.9, network access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2026-06-09 · Modified: 2026-06-27
- Aliases: GHSA-6rpq-6vv2-5222
- Record: https://cvemate.com/vulnerability/CVE-2026-40991 · JSON: https://cvemate.com/vulnerability/CVE-2026-40991/json

## Description

```text
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.
```

## Signals

- CVSS: 5.9 medium (v3.1, CVE.org) CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:L
- EPSS: 0.223%, percentile 13.7%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected

- broadcom spring\_rest\_docs: ≥ 2.0.0, \< 2.0.9 \| ≥ 3.0.0, \< 3.0.5.1 \| 4.0.0
- org.springframework.restdocs spring-restdocs-restassured (Maven): ≥ 4.0.0, \< 4.0.1 \| ≥ 3.0.0, \< 3.0.6 \| ≤ 2.0.8.RELEASE
- org.springframework.restdocs spring-restdocs-webtestclient (Maven): ≥ 4.0.0, \< 4.0.1 \| ≥ 3.0.0, \< 3.0.6 \| ≤ 2.0.8.RELEASE
- spring spring rest docs: ≥ 4.0.0, \< 4.0.0.1 \| ≥ 3.0.0, \< 3.0.5.1 \| ≥ 2.0.0.RELEASE, \< 2.0.9.RELEASE

## References

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

---

Data as of 2026-12-05T09:54:51.469Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
