simplesamlphp/saml2

CVE-2024-52806

CVE-2024-52806 is a medium-severity XML external entity injection (XXE) vulnerability in simplesamlphp/saml2 (composer), affecting versions < 4.6.14. It is fixed in 4.6.14.

Key facts
CVSS score
8.3
Medium
Attack vector
Network
Issuing authority
GitHub Advisory Database
Affected package
simplesamlphp/saml2
Fixed in
4.6.14
Disclosed
2024

Summary

Summary When loading an (untrusted) XML document, for example the SAMLResponse, it's possible to induce an XXE. $options is defined as: https://github.com/simplesamlphp/saml2/blob/717c0adc4877ebd58428637e5626345e59fa0109/src/SAML2/DOMDocumentFactory.php#L41 including the DTDLoad option, which allows an attacker to read file contents from local file system OR internal network. While there is the NONET option, an attacker can simply bypass if by using PHP filters: php://filter/convert.base64-encode/resource=http://URL OR FILE From there an attacker can induce network connections and steal the targeted file OOB (haven't fully tested this). RCE may be possible with the php://expect or php://phar wrappers, but this hasn't been tested. Note: The mitigation here: https://github.com/simplesamlphp/saml2/blob/717c0adc4877ebd58428637e5626345e59fa0109/src/SAML2/DOMDocumentFactory.php#L63-L69 Comes too late, as the XML has already been loaded into a document. Mitigation: Remove the LIBXMLDTDLOAD | LIBXMLDTDATTR options. Additionally, as a defense in depth measure, check if there is the string: <!DOCTYPE inside the XML before parsing it. (This is not a complete fix because someone may be able to exploit some parser differentials, to load a DOCTYPE, maybe through spacing like: <! DOCTYPE)

Impact

What is XML external entity injection (XXE)?

An XML parser processes external entity references in untrusted input, causing the server to fetch internal resources or remote URLs. Typical impact: local file disclosure, server-side request forgery, or denial of service.

Severity and exposure

CVE-2024-52806 has a CVSS score of 8.3 (Medium). The vector is network-reachable, no privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment.

A fixed version is available (4.6.14). Upgrading removes the vulnerable code path.

Affected versions

composer

  • simplesamlphp/saml2 (< 4.6.14)
  • simplesamlphp/saml2-legacy (< 4.6.14)

Security releases

  • simplesamlphp/saml2 → 4.6.14 (composer)
  • simplesamlphp/saml2-legacy → 4.6.14 (composer)
Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter instead of chasing every advisory.

Kodem's runtime-powered SCA identifies whether CVE-2024-52806 is reachable in your applications. Explore open-source security for your team.

See if CVE-2024-52806 is reachable in your applications. Get a demo

Already deployed Kodem? See CVE-2024-52806 in your environment

Remediation advice

Upgrade the following packages to resolve this vulnerability:

  • Upgrade simplesamlphp/saml2 to 4.6.14 or later
  • Upgrade simplesamlphp/saml2-legacy to 4.6.14 or later

Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.

Frequently asked questions about CVE-2024-52806

What is CVE-2024-52806?

CVE-2024-52806 is a medium-severity XML external entity injection (XXE) vulnerability in simplesamlphp/saml2 (composer), affecting versions < 4.6.14. It is fixed in 4.6.14. An XML parser processes external entity references in untrusted input, causing the server to fetch internal resources or remote URLs.

How severe is CVE-2024-52806?

CVE-2024-52806 has a CVSS score of 8.3 (Medium). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.

Which packages are affected by CVE-2024-52806?
  • simplesamlphp/saml2 (composer) (versions < 4.6.14)
  • simplesamlphp/saml2-legacy (composer) (versions < 4.6.14)
Is there a fix for CVE-2024-52806?

Yes. CVE-2024-52806 is fixed in 4.6.14. Upgrade to this version or later.

Is CVE-2024-52806 exploitable, and should I be worried?

Whether CVE-2024-52806 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo

What actually determines whether CVE-2024-52806 is exploitable, and how bad it is?

Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.

How do I fix CVE-2024-52806?
  • Upgrade simplesamlphp/saml2 to 4.6.14 or later
  • Upgrade simplesamlphp/saml2-legacy to 4.6.14 or later

Stop the waste.
Protect your environment with Kodem.