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.
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2026-40991?
CVE-2026-40991 has a medium severity rating of 5.9.
How do I fix CVE-2026-40991?
To fix CVE-2026-40991, ensure that your Spring REST Docs configuration is secured against untrusted XML content and avoid documenting APIs that may be compromised.
What type of attack is associated with CVE-2026-40991?
CVE-2026-40991 is associated with an XML External Entity (XXE) injection attack.
Who is affected by CVE-2026-40991?
CVE-2026-40991 affects users of Spring REST Docs who generate documentation from untrusted XML content.
How can CVE-2026-40991 impact the security of my application?
CVE-2026-40991 can lead to unauthorized data exposure due to XXE injection vulnerabilities when documenting malicious APIs.