Skip to main content

Spring REST Docs CVE-2026-40991

| EUVDEUVD-2026-35885 MEDIUM
Improper Restriction of XML External Entity Reference (CWE-611)
2026-06-10 security@vmware.com GHSA-6rpq-6vv2-5222
5.9
CVSS 3.1 · Vendor: vmware
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Compromise remote API or stand up malicious HTTP endpoint
  2. Delivery
    Embed XXE payload in API XML response
  3. Exploit
    Developer or CI runner executes documentation tests against attacker-controlled endpoint
  4. Execution
    spring-restdocs-webtestclient or spring-restdocs-restassured processes XML response
  5. Persist
    Java XML parser resolves external entity reference
  6. Impact
    Sensitive 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.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

Spring REST Docs 2.0.0.RELEASE <2.0.9.RELEASE
Spring REST Docs 3.0.0 <3.0.6
Spring REST Docs 4.0.0 <4.0.1

Affected Packages

maven org.springframework.restdocs:spring-restdocs-restassured fix: 3.0.6, 4.0.1
maven org.springframework.restdocs:spring-restdocs-webtestclient fix: 3.0.6, 4.0.1
euvd spring_rest_docs fix: 2.0.9.RELEASE, 3.0.6, 4.0.1

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

Vendor (vmware) PRIMARY 5.9 MEDIUM
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

Attack Vector
Network
Attack Complexity
High
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
Low

Lifecycle Timeline

1
Patch available
Jun 10, 2026 - 02:01 EUVD

DescriptionCVE.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

EPSS Score
0.0%
Top 88% exploitable
Data Quality
6 sources
Confidence: High

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.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

30
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +30
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

XML External Entity (XXE) attacks exploit XML parsers that process Document Type Definitions (DTDs) without proper restrictions.

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy