{"id":"CVE-2026-40991","aliases":["CLSA-2026-1793192311","EUVD-2026-35885","GHSA-6rpq-6vv2-5222","ROOT-APP-MAVEN-CVE-2026-40991"],"status":"published","title":"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.\n\nAffected versions:\nSpring REST Docs 4.0.0; 3.0.0 through 3.0.5; 2.0.0.RELEASE through 2.0.8.RELEASE.","severity":{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:L","level":"medium","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-10","score":0.00223,"percentile":0.12966,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-611"],"published":"2026-06-09T23:46:33Z","modified":"2026-10-30T19:45:48Z","fixes":[{"ecosystem":"Maven","package":"org.springframework.restdocs:spring-restdocs-webtestclient","fixed_in":["4.0.1","3.0.6"],"sources":["ghsa","osv"]},{"ecosystem":"Maven","package":"org.springframework.restdocs:spring-restdocs-restassured","fixed_in":["4.0.1","3.0.6"],"sources":["ghsa","osv"]},{"ecosystem":"TuxCare:Maven","package":"org.springframework.restdocs:spring-restdocs-restassured","fixed_in":["2.0.5.RELEASE-tuxcare.1"],"sources":["osv"]},{"ecosystem":"TuxCare:Maven","package":"org.springframework.restdocs:spring-restdocs-webtestclient","fixed_in":["2.0.5.RELEASE-tuxcare.1"],"sources":["osv"]},{"ecosystem":"Root:Maven","package":"io.root.org.springframework.restdocs:spring-restdocs-restassured","fixed_in":["2.0.8.RELEASE-root.io.1","3.0.3-root.io.1"],"sources":["osv"]},{"ecosystem":"Root:Maven","package":"org.springframework.restdocs:spring-restdocs-restassured","fixed_in":["2.0.8.RELEASE-aikido.1","3.0.3-aikido.1"],"sources":["osv"]}],"affected":[{"source":"ghsa","ecosystem":"Maven","package":"org.springframework.restdocs:spring-restdocs-webtestclient","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.0.0"},{"last_affected":"4.0.0"},{"fixed":"4.0.1"}]}],"versions":["4.0.0"]},{"source":"ghsa","ecosystem":"Maven","package":"org.springframework.restdocs:spring-restdocs-webtestclient","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"3.0.0"},{"last_affected":"3.0.5"},{"fixed":"3.0.6"}]}]},{"source":"ghsa","ecosystem":"Maven","package":"org.springframework.restdocs:spring-restdocs-webtestclient","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"2.0.8.RELEASE"}]}]},{"source":"ghsa","ecosystem":"Maven","package":"org.springframework.restdocs:spring-restdocs-restassured","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.0.0"},{"last_affected":"4.0.0"},{"fixed":"4.0.1"}]}],"versions":["4.0.0"]},{"source":"ghsa","ecosystem":"Maven","package":"org.springframework.restdocs:spring-restdocs-restassured","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"3.0.0"},{"last_affected":"3.0.5"},{"fixed":"3.0.6"}]}]},{"source":"ghsa","ecosystem":"Maven","package":"org.springframework.restdocs:spring-restdocs-restassured","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"2.0.8.RELEASE"}]}]},{"source":"osv","ecosystem":"TuxCare:Maven","package":"org.springframework.restdocs:spring-restdocs-restassured","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"2.0.5.RELEASE"},{"fixed":"2.0.5.RELEASE-tuxcare.1"}]}],"versions":["2.0.5.RELEASE"]},{"source":"osv","ecosystem":"TuxCare:Maven","package":"org.springframework.restdocs:spring-restdocs-webtestclient","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"2.0.5.RELEASE"},{"fixed":"2.0.5.RELEASE-tuxcare.1"}]}],"versions":["2.0.5.RELEASE"]},{"source":"osv","ecosystem":"Maven","package":"org.springframework.restdocs:spring-restdocs-webtestclient","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.0.0"},{"fixed":"4.0.1"}]}],"versions":["4.0.0"]},{"source":"osv","ecosystem":"Maven","package":"org.springframework.restdocs:spring-restdocs-webtestclient","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"3.0.0"},{"fixed":"3.0.6"}]}],"versions":["3.0.0","3.0.1","3.0.2","3.0.3","3.0.4","3.0.5"]},{"source":"osv","ecosystem":"Maven","package":"org.springframework.restdocs:spring-restdocs-webtestclient","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"2.0.8.RELEASE"}]}],"versions":["2.0.0.RELEASE","2.0.1.RELEASE","2.0.2.RELEASE","2.0.3.RELEASE","2.0.4.RELEASE","2.0.5.RELEASE","2.0.6.RELEASE","2.0.7.RELEASE","2.0.8.RELEASE"]},{"source":"osv","ecosystem":"Maven","package":"org.springframework.restdocs:spring-restdocs-restassured","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.0.0"},{"fixed":"4.0.1"}]}],"versions":["4.0.0"]},{"source":"osv","ecosystem":"Maven","package":"org.springframework.restdocs:spring-restdocs-restassured","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"3.0.0"},{"fixed":"3.0.6"}]}],"versions":["3.0.0","3.0.1","3.0.2","3.0.3","3.0.4","3.0.5"]},{"source":"osv","ecosystem":"Maven","package":"org.springframework.restdocs:spring-restdocs-restassured","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"2.0.8.RELEASE"}]}],"versions":["1.1.0.RELEASE","1.1.1.RELEASE","1.1.2.RELEASE","1.1.3.RELEASE","1.2.0.RELEASE","1.2.1.RELEASE","1.2.2.RELEASE","1.2.3.RELEASE","1.2.4.RELEASE","1.2.5.RELEASE","1.2.6.RELEASE","2.0.0.RELEASE","2.0.1.RELEASE","2.0.2.RELEASE","2.0.3.RELEASE","2.0.4.RELEASE","2.0.5.RELEASE","2.0.6.RELEASE","2.0.7.RELEASE","2.0.8.RELEASE"]},{"source":"osv","ecosystem":"Root:Maven","package":"io.root.org.springframework.restdocs:spring-restdocs-restassured","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.0.8.RELEASE-root.io.1"},{"fixed":"3.0.3-root.io.1"}]}]},{"source":"osv","ecosystem":"Root:Maven","package":"org.springframework.restdocs:spring-restdocs-restassured","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.0.8.RELEASE-aikido.1"},{"fixed":"3.0.3-aikido.1"}]}]}],"products":[{"vendor":"broadcom","product":"spring_rest_docs"},{"vendor":"spring","product":"spring rest docs"}],"references":[{"url":"https://spring.io/security/cve-2026-40991","tags":["Vendor Advisory","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-40991","tags":["advisory"]},{"url":"https://github.com/spring-projects/spring-restdocs/releases/tag/v3.0.6","tags":["web"]},{"url":"https://github.com/spring-projects/spring-restdocs/releases/tag/v4.0.1","tags":["web"]},{"url":"https://github.com/advisories/GHSA-6rpq-6vv2-5222"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/40xxx/CVE-2026-40991.json","tags":["advisory"]},{"url":"https://github.com/spring-projects/spring-restdocs","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2026-40991","title":"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.\n\nAffected versions:\nSpring REST Docs 4.0.0; 3.0.0 through 3.0.5; 2.0.0.RELEASE through 2.0.8.RELEASE.","status":"published","published":"2026-06-09T23:46:33.676Z","modified":"2026-06-27T21:10:14.865Z","cvss":[{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:L","level":"medium","assessor":"cna"}],"cwes":["CWE-611"],"updated_at":"2026-11-02T13:43:11.445168Z"}],"euvd":[{"id":"EUVD-2026-35885","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.\n\nAffected versions:\nSpring REST Docs 4.0.0; 3.0.0 through 3.0.5; 2.0.0.RELEASE through 2.0.8.RELEASE.","status":"published","published":"2026-06-09T23:46:33Z","modified":"2026-06-27T21:10:14Z","cvss":[{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:L","level":"medium"}],"updated_at":"2026-11-02T18:20:23.349194Z"}],"ghsa":[{"id":"GHSA-6rpq-6vv2-5222","title":"Spring REST Docs REST Assured \u0026 WebFlux are vulnerable to Improper Restriction of XML External Entity Reference","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.\n\nAffected versions:\nSpring REST Docs 4.0.0; 3.0.0 through 3.0.5; 2.0.0.RELEASE through 2.0.8.RELEASE.","status":"published","published":"2026-06-10T00:31:51Z","modified":"2026-08-12T15:26:10Z","cvss":[{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:L","level":"medium"}],"cwes":["CWE-611"],"updated_at":"2026-11-02T14:40:58.888637Z"}],"nvd":[{"id":"CVE-2026-40991","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.\n\nAffected versions:\nSpring REST Docs 4.0.0; 3.0.0 through 3.0.5; 2.0.0.RELEASE through 2.0.8.RELEASE.","status":"published","published":"2026-06-10T00:16:50.087Z","modified":"2026-07-23T09:10:00.113Z","cvss":[{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:L","level":"medium","assessor":"secondary"}],"cwes":["CWE-611"],"updated_at":"2026-11-02T14:12:23.485267Z"}],"osv":[{"id":"CVE-2026-40991","title":"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.\n\nAffected versions:\nSpring REST Docs 4.0.0; 3.0.0 through 3.0.5; 2.0.0.RELEASE through 2.0.8.RELEASE.","status":"published","published":"2026-06-09T23:46:33.676Z","modified":"2026-10-28T02:30:44.314665774Z","cvss":[{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:L","level":"medium"}],"cwes":["CWE-611"],"updated_at":"2026-11-02T15:45:03.424067Z"},{"id":"GHSA-6rpq-6vv2-5222","title":"Spring REST Docs REST Assured \u0026 WebFlux are vulnerable to Improper Restriction of XML External Entity Reference","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.\n\nAffected versions:\nSpring REST Docs 4.0.0; 3.0.0 through 3.0.5; 2.0.0.RELEASE through 2.0.8.RELEASE.","status":"published","published":"2026-06-10T00:31:51Z","modified":"2026-08-12T15:41:04.26937Z","cvss":[{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:L","level":"medium"}],"cwes":["CWE-611"],"updated_at":"2026-11-02T15:46:39.965326Z"},{"id":"CLSA-2026-1793192311","title":"TuxCare security update for org.springframework.restdocs (1 CVE)","description":"TuxCare rebuilt 2 org.springframework.restdocs packages to address 1 CVE. Fixed in 2.0.5.RELEASE-tuxcare.1.","status":"published","published":"2026-10-28T12:58:31Z","modified":"2026-10-30T19:45:48.397953024Z","updated_at":"2026-11-02T15:43:55.34846Z"},{"id":"ROOT-APP-MAVEN-CVE-2026-40991","title":"CVE-2026-40991 in io.root.org.springframework.restdocs:spring-restdocs-restassured - Patched by Root","description":"Root has patched CVE-2026-40991 in the io.root.org.springframework.restdocs:spring-restdocs-restassured package for Root:Maven. Multiple fixed versions available.","status":"published","published":"2026-07-01T13:37:30Z","modified":"2026-07-01T18:45:07.12897021Z","updated_at":"2026-11-02T15:53:27.066589Z"}]}}
