CVE-2026-40991
XML External Entity (XXE) injection when documenting untrusted XML content
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.
INFO
Published Date :
June 10, 2026, 12:16 a.m.
Last Modified :
July 23, 2026, 9:10 a.m.
Remotely Exploit :
Yes !
Source :
[email protected]
CVSS Scores
| Score | Version | Severity | Vector | Exploitability Score | Impact Score | Source |
|---|---|---|---|---|---|---|
| CVSS | 134c704f-9b21-4f2e-91b3-4a467353bcc0 | |||||
| CVSS 3.1 | MEDIUM | dcf2e128-44bd-42ed-91e8-88f912c1401d | ||||
| CVSS 3.1 | MEDIUM | [email protected] |
Solution
- Update Spring REST Docs to a patched version.
- Avoid documenting untrusted APIs.
- Validate API sources before generating documentation.
References to Advisories, Solutions, and Tools
Here, you will find a curated list of external links that provide in-depth
information, practical solutions, and valuable tools related to
CVE-2026-40991.
| URL | Resource |
|---|---|
| https://spring.io/security/cve-2026-40991 | Vendor Advisory |
CWE - Common Weakness Enumeration
While CVE identifies
specific instances of vulnerabilities, CWE categorizes the common flaws or
weaknesses that can lead to vulnerabilities. CVE-2026-40991 is
associated with the following CWEs:
Common Attack Pattern Enumeration and Classification (CAPEC)
Common Attack Pattern Enumeration and Classification
(CAPEC)
stores attack patterns, which are descriptions of the common attributes and
approaches employed by adversaries to exploit the CVE-2026-40991
weaknesses.
We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).
Results are limited to the first 15 repositories due to potential performance issues.
The following list is the news that have been mention
CVE-2026-40991 vulnerability anywhere in the article.
The following table lists the changes that have been made to the
CVE-2026-40991 vulnerability over time.
Vulnerability history details can be useful for understanding the evolution of a vulnerability, and for identifying the most recent changes that may impact the vulnerability's severity, exploitability, or other characteristics.
-
CVE Translated by [email protected]
Jul. 23, 2026
Action Type Old Value New Value Added Translation Title: Spring REST Docs de Spring, Description: Al usar spring-restdocs-webtestclient o spring-restdocs-restassured para documentar una API remota accedida a través de HTTP, un atacante que compromete la API o engaña al usuario para que documente una API maliciosa puede realizar un ataque de inyección XXE cuando las pruebas de generación de documentación se ejecuten a continuación. Versiones afectadas: Spring REST Docs 4.0.0; 3.0.0 a 3.0.5; 2.0.0.RELEASE a 2.0.8.RELEASE. -
Initial Analysis by [email protected]
Jul. 17, 2026
Action Type Old Value New Value Added CPE Configuration OR *cpe:2.3:a:broadcom:spring_rest_docs:*:*:*:*:*:*:*:* versions from (including) 2.0.0 up to (excluding) 2.0.9 *cpe:2.3:a:broadcom:spring_rest_docs:*:*:*:*:*:*:*:* versions from (including) 3.0.0 up to (excluding) 3.0.5.1 *cpe:2.3:a:broadcom:spring_rest_docs:4.0.0:-:*:*:*:*:*:* Added Reference Type VMware: https://spring.io/security/cve-2026-40991 Types: Vendor Advisory -
CVE Modified by [email protected]
Jun. 27, 2026
Action Type Old Value New Value Changed Affected [{'vendor': 'Spring', 'product': 'Spring REST Docs', 'versions': [{'status': 'affected', 'version': '4.0.0', 'lessThan': '4.0.1', 'versionType': 'custom'}, {'status': 'affected', 'version': '3.0.0', 'lessThan': '3.0.6', 'versionType': 'custom'}, {'status': 'affected', 'version': '2.0.0.RELEASE', 'lessThan': '2.0.9.RELEASE', 'versionType': 'custom'}], 'defaultStatus': 'unaffected'}] [{'vendor': 'Spring', 'product': 'Spring REST Docs', 'versions': [{'status': 'affected', 'version': '4.0.0', 'lessThan': '4.0.0.1', 'versionType': 'custom'}, {'status': 'affected', 'version': '3.0.0', 'lessThan': '3.0.5.1', 'versionType': 'custom'}, {'status': 'affected', 'version': '2.0.0.RELEASE', 'lessThan': '2.0.9.RELEASE', 'versionType': 'custom'}], 'defaultStatus': 'unaffected'}] -
CVE Modified by [email protected]
Jun. 17, 2026
Action Type Old Value New Value Added Affected [{'vendor': 'Spring', 'product': 'Spring REST Docs', 'versions': [{'status': 'affected', 'version': '4.0.0', 'lessThan': '4.0.1', 'versionType': 'custom'}, {'status': 'affected', 'version': '3.0.0', 'lessThan': '3.0.6', 'versionType': 'custom'}, {'status': 'affected', 'version': '2.0.0.RELEASE', 'lessThan': '2.0.9.RELEASE', 'versionType': 'custom'}], 'defaultStatus': 'unaffected'}] -
CVE Modified by 134c704f-9b21-4f2e-91b3-4a467353bcc0
Jun. 17, 2026
Action Type Old Value New Value Added SSVC {'id': 'CVE-2026-40991', 'role': 'CISA Coordinator', 'options': [{'exploitation': 'none'}, {'automatable': 'no'}, {'technicalImpact': 'partial'}], 'version': '2.0.3', 'timestamp': '2026-06-10T13:01:26.403312Z'} -
New CVE Received by [email protected]
Jun. 10, 2026
Action Type Old Value New Value Added 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. Added CVSS V3.1 AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:L Added CWE CWE-611 Added Reference https://spring.io/security/cve-2026-40991