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

Published Jun 9, 2026
·
Updated

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

4 affected components
Spring Spring REST Docs=4.0.0, >=3.0.0<=3.0.5, >=2.0.0.RELEASE<=2.0.8.RELEASE
Broadcom Spring Rest Docs>=2.0.0<2.0.9
Broadcom Spring Rest Docs>=3.0.0<3.0.5.1
Broadcom Spring Rest Docs=4.0.0

Event History

Jun 9, 2026
CVE Published
via MITRE·11:46 PM
Data Sourced
via MITRE·11:46 PM
DescriptionSeverityWeakness
Jun 10, 2026
Data Sourced
via NVD·12:16 AM
DescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-40991?

CVE-2026-40991 has a medium severity rating of 5.9.

2

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.

3

What type of attack is associated with CVE-2026-40991?

CVE-2026-40991 is associated with an XML External Entity (XXE) injection attack.

4

Who is affected by CVE-2026-40991?

CVE-2026-40991 affects users of Spring REST Docs who generate documentation from untrusted XML content.

5

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.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203