/

CVE-2026-45071

Severity:

HIGH RISK

(7.5)

XML External Entity (CWE-611) in Symfony Crawler

CVE-2026-45071

Analyzed

Vulnerability type

Category:

XML External Entity (XXE)

CWE:

CWE-611

Impact:

Information Disclosure via XXE

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

An XML External Entity (XXE) vulnerability in Symfony's Crawler::addXmlContent() allows attacker-controlled XML to resolve external entities when DOMDocument::$validateOnParse is set to true.

If an application passes untrusted XML into the crawler, an attacker may be able to read local files via file:// entities or access other sensitive resources on the server.

Affected context

This vulnerability occurs in Symfony-based applications that use Crawler::addXmlContent() with XML derived from user input or other untrusted sources.

It is relevant when DOMDocument parsing is performed with validation enabled, which reactivates external entity resolution.

The risk is higher in deployments where the PHP process can access sensitive files or internal network resources that might be referenced by XML entities.

Exploit preconditions

  • Attack surface: HTTP endpoints or other interfaces that feed XML into Crawler::addXmlContent()
  • Required access: Ability to supply or influence XML content processed by Symfony's crawler
  • Trigger point: Invocation of addXmlContent() on attacker-controlled XML when DOMDocument validation is enabled
  • Why exploitation is possible: Setting DOMDocument::$validateOnParse = true re-enables external entity resolution, allowing expansion of file:// and potentially other external entities

Why this happens

The root cause lies in how XML parsing is configured within Symfony's crawler component.

By setting DOMDocument::$validateOnParse = true prior to loadXML(), the code implicitly reactivates external entity resolution, contrary to secure parser defaults.

This maps to CWE-611: Improper Restriction of XML External Entity Reference, where XML is parsed without adequately disabling external entity expansion, permitting access to local or remote resources referenced in the XML.

Potential impact

  • An attacker may read local files accessible to the PHP process using file:// entities
  • Sensitive configuration data (such as credentials or API keys) could be disclosed
  • Internal network endpoints and services might be probed or accessed via specially crafted entities
  • Application-level data confidentiality can be compromised depending on file and network access

General mitigation guidance

Mitigation focuses on hardening XML parsing and reducing trust in XML inputs.

Recommended patterns include:

  • Ensuring XML parsers run with external entity resolution disabled, even when validation or schema checks are enabled
  • Avoiding the use of validating parsers on untrusted XML, or strictly isolating them from sensitive resources
  • Treating XML from clients and third-party systems as untrusted and applying schema validation without enabling entity expansion
  • Designing applications so that processes handling untrusted XML operate with least privilege and minimal filesystem and network visibility

How teams detect issues like this

Detection can rely on reviewing XML parsing configurations and usages of DOMDocument in the codebase.

Effective strategies include:

  • Static analysis rules that flag DOMDocument::$validateOnParse being set to true in code paths handling untrusted XML
  • Code review checklists that require verifying external entity settings whenever XML parsing is introduced or modified
  • Security policies that mandate safe XML parsing wrappers or factory methods with XXE protections baked in
  • Use of automated scanning tools configured to identify XXE risk patterns and insecure parser options

Sources

SourceLink
github.comgithub.com/symfony/symfony/commit/eea5fd7488cbdc241da4ce242344b7d9a3ecdf3d
github.comgithub.com/symfony/symfony/releases/tag/v5.4.52
github.comgithub.com/symfony/symfony/releases/tag/v6.4.40
github.comgithub.com/symfony/symfony/releases/tag/v7.4.12
github.comgithub.com/symfony/symfony/releases/tag/v8.0.12
github.comgithub.com/symfony/symfony/security/advisories/GHSA-x6g4-fwcc-jj8w

Frequently asked

questions

Exploitability depends on whether your application passes user-controlled or otherwise untrusted XML into Crawler::addXmlContent(). If XML content is fully controlled by the server and not influenced by attackers, practical risk is reduced.

An attacker needs the ability to submit or influence XML that is processed by the Symfony crawler. This typically means access to an endpoint or interface that ingests XML, such as APIs, import features, or feeds.

The safest pattern is to ensure XML parsing is performed with external entities disabled by default and to avoid enabling validating modes on untrusted XML. Centralizing XML parser configuration in a secure factory or wrapper also helps enforce consistent protections.

Establish secure XML parsing guidelines, use hardened parser configurations that permanently disable external entities, avoid processing attacker-controlled XML with high-privilege processes, and include XXE checks in code review and automated security testing.

Find out what's already
exploitable in your codebase.