Skip to content
Heist/ feed
Back to feed
Medium

XML External Entity (XXE) injection when documenting untrusted XML content

Type: advisorySources: OSV

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.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2026-40991
Confirmed fixed CVEs
Not specified
Updated in this feed
5 Nov 2026, 16:31 UTC · Revision 1

Source evidence

XML External Entity (XXE) injection when documenting untrusted XML content

core-osv · Original source

Published 9 Jun 2026, 23:46 UTC

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.

osv:CVE-2026-40991
Complete source record
{
  "id": "2507583f2ca02867c325cad17d852055b16751f1eecd815b8af75349f2143036",
  "url": "https://osv.dev/vulnerability/CVE-2026-40991",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "XML External Entity (XXE) injection when documenting untrusted XML content",
    "summary": "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.",
    "evidence": "osv:CVE-2026-40991",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "CVE-2026-40991",
      "aliases": [
        "CVE-2026-40991",
        "GHSA-6rpq-6vv2-5222"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:L"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/spring-projects/spring-restdocs",
              "type": "GIT",
              "events": [
                {
                  "introduced": "b088263fd22195c49e6f8fc49f05c9d9e89e4eeb"
                },
                {
                  "last_affected": "b088263fd22195c49e6f8fc49f05c9d9e89e4eeb"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:broadcom:spring_rest_docs:4.0.0:-:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "4.0.0-NA"
                      },
                      {
                        "last_affected": "4.0.0-NA"
                      }
                    ],
                    "source": "CPE_STRING"
                  }
                ]
              }
            }
          ],
          "versions": [
            "4.0.0-NA",
            "v4.0.0"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-40991.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:44.314665774Z",
      "provider": "osv",
      "references": [
        "https://spring.io/security/cve-2026-40991",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/40xxx/CVE-2026-40991.json",
        "https://nvd.nist.gov/vuln/detail/CVE-2026-40991"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-611"
        ],
        "cna_assigner": "vmware",
        "unresolved_ranges": [
          {
            "extracted_events": [
              {
                "range": [
                  {
                    "introduced": "4.0.0"
                  },
                  {
                    "fixed": "4.0.0.1"
                  },
                  {
                    "introduced": "3.0.0"
                  },
                  {
                    "fixed": "3.0.5.1"
                  },
                  {
                    "introduced": "2.0.0.RELEASE"
                  },
                  {
                    "fixed": "2.0.9.RELEASE"
                  }
                ],
                "source": "AFFECTED_FIELD",
                "strategy": "StandardRange"
              }
            ]
          }
        ],
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/40xxx/CVE-2026-40991.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-40991",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 512408,
  "published_at": "2026-06-09T23:46:33.676+00:00"
}