Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessCompromise remote API or stand up malicious HTTP endpoint
-
DeliveryEmbed XXE payload in API XML response
-
ExploitDeveloper or CI runner executes documentation tests against attacker-controlled endpoint
-
Executionspring-restdocs-webtestclient or spring-restdocs-restassured processes XML response
-
PersistJava XML parser resolves external entity reference
-
ImpactSensitive local file or environment secret disclosed to attacker
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A02:2025 - Security Misconfiguration
ASVS 5.0
V13 - Configuration XML external entity prevention
MITRE ATT&CK
2 techniques across 2 tactics: Initial Access, Collection The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Two specific conditions must both be true: (1) the project uses the spring-restdocs-webtestclient or spring-restdocs-restassured module - NOT spring-restdocs-mockmvc - and configures documentation tests to contact a real remote HTTP endpoint rather than a local mock; (2) the attacker controls the remote API endpoint, either by compromising the upstream API server or by tricking the developer into running tests against an attacker-hosted URL. The CVSS UI:R confirms that a human or automated process must actively execute the documentation-generating test suite for exploitation to occur. AC:H confirms that meeting both conditions simultaneously is non-trivial. Exploitation is bounded to the environment where tests run (developer laptop or CI runner) and does not affect production deployments or end-users of the documented application. The vulnerability does not apply to projects that exclusively use local mock-based testing. |
| Impact | The CVSS 5.9 score reflects meaningful but bounded risk: AV:N confirms network reachability, but AC:H (High Attack Complexity) and UI:R (User Interaction Required) together require the attacker to either compromise the legitimate remote API being documented or socially engineer the developer into pointing tests at an adversary-controlled endpoint. PR:N means no prior authentication to the victim system is needed once the API is compromised. The Unchanged scope (S:U) confines impact to the test-running environment - developer workstations and CI runners - not production deployments, making this a supply-chain and developer-tooling risk rather than a runtime application risk. Confidentiality impact is High (C:H), reflecting potential access to local files and environment secrets, while Integrity is None and Availability is Low. No EPSS data was provided in available intelligence, so exploitation probability cannot be quantified. Not listed in CISA KEV, and no public exploit has been identified. Real-world priority is moderate: the attack surface is restricted to teams that run documentation tests against live, non-local APIs, but the potential data exposure in CI/CD environments (SSH keys, tokens, cloud credentials) elevates urgency for such teams. |
| Exploit ScenarioDerived | A developer or automated CI pipeline runs Spring REST Docs documentation tests using spring-restdocs-webtestclient or spring-restdocs-restassured against a staging or third-party API endpoint. An attacker who has compromised that API serves a crafted XML response containing an XXE payload referencing a sensitive local path such as ~/.aws/credentials or a CI-injected environment variable file. When the documentation test executes and processes the response to generate snippets, the Java XML parser resolves the external entity and the contents are disclosed to the attacker via an out-of-band channel or error output - all without any visible indication to the developer. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jun 10, 2026
XXE injection in Spring REST Docs exposes developer machines and CI runners to file disclosure when documentation-generating tests process responses from a remote API. Versions 4.0.0, 3.0.0-3.0.5, and 2.0.0.RELEASE-2.0.8.RELEASE of the spring-restdocs-webtestclient and spring-restdocs-restassured modules fail to disable XML external entity processing, allowing an attacker who controls the documented API endpoint to serve a malicious XML response. No confirmed active exploitation exists (not in CISA KEV), and no public exploit has been identified at time of analysis; however, the High confidentiality impact against developer and CI environments warrants prompt patching.
RemediationAI
Upgrade to a patched version of Spring REST Docs per the vendor advisory at https://spring.io/security/cve-2026-40991. The exact fixed release version is not confirmed in the available intelligence data - the advisory must be consulted for the precise target version for each affected branch (4.x, 3.0.x, 2.0.x). Patch is available per vendor advisory. Where immediate upgrade is not feasible, the most targeted compensating control is to restrict documentation test execution to local mock servers only (e.g., spring-restdocs-mockmvc) and avoid running spring-restdocs-webtestclient or spring-restdocs-restassured tests against any external or third-party HTTP endpoint until patched; this eliminates the attack surface entirely but may require refactoring test suites. Additionally, CI runners should operate with least-privilege file system access and minimal secrets in the environment to limit exposure if an XXE payload is triggered, though this mitigates impact rather than preventing exploitation.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 3 packages in maven, euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
Spring REST Docs is a Java framework (tagged Java, XXE) that auto-generates API documentation from integration test snippets. The vulnerable surface is limited to the spring-restdocs-webtestclient module (targeting Spring WebFlux's WebTestClient) and the spring-restdocs-restassured module (targeting REST Assured), both of which process real HTTP responses from a remote endpoint during test execution. The spring-restdocs-mockmvc module, which uses local mocks, is not in scope. CWE-611 (Improper Restriction of XML External Entity Reference) identifies the root cause: the library's XML response parser does not disable DOCTYPE declarations or external entity resolution. When an attacker-controlled API returns XML with an XXE payload such as an entity referencing a local file path or an out-of-band SSRF destination, the Java XML parser resolves it during documentation snippet generation, leaking data without the developer's awareness. Reported by security@vmware.com, indicating origin from the Spring/VMware security team.
Know when Spring Rest Docs gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:L
Primary rating from Vendor (vmware) · only source for this CVE.
CVSS VectorVendor: vmware
Lifecycle Timeline
1DescriptionCVE.org
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.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
XML External Entity (XXE) attacks exploit XML parsers that process Document Type Definitions (DTDs) without proper restrictions.
EUVD-2026-35885
GHSA-6rpq-6vv2-5222
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB