CVE-2024-52596: Simplesamlphp/xml common SimpleSAMLphp Xml-common XXE Vulnerability Vulnerability
HIGHCVE-2024-52596 is a HIGH simplesamlphp xml-common xxe vulnerability vulnerability (CWE-611: Improper Restriction of XML External Entity Reference) affecting Simplesamlphp/xml common libraries in the Packagist ecosystem. The issue involves simplesamlphp xml-common xxe vulnerability. Remediation is available by upgrading affected packages to version 1.20.0.
CVE-2024-52596 at a Glance
How to Fix CVE-2024-52596
To remediate this vulnerability, upgrade all affected Simplesamlphp/xml common dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade simplesamlphp/xml-common to 1.20.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for simplesamlphp/xml-common
How to Check if You Are Affected
To determine whether your application is affected by CVE-2024-52596, inspect your project dependencies for Simplesamlphp/xml common:
inspect dependencies for simplesamlphp/xml-common
Analyze the terminal output to locate any version of Simplesamlphp/xml common in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.20.0), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-611: Improper Restriction of XML External Entity Reference, where the product processes an xml document that can contain xml entities with uris that resolve to documents outside of the intended sphere of control, causing the product to embed incorrect documents into its output. In Simplesamlphp/xml common, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-52596 Affected Simplesamlphp/xml common Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
simplesamlphp/xml-common
|
Packagist |
< 1.20.0
|
1.20.0
|
References
Frequently Asked Questions
What is CVE-2024-52596?
Which Simplesamlphp/xml common versions are affected?
What version fixes CVE-2024-52596?
Is simplesamlphp/xml-common affected?
What CWE is associated with CVE-2024-52596?
How can I check Packagist dependencies for CVE-2024-52596?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-2x65-fpch-2fcm",
"modified" : "2024-12-12T22:19:57Z",
"published" : "2024-12-02T17:14:30Z",
"aliases" : [ "CVE-2024-52596" ],
"summary" : "SimpleSAMLphp xml-common XXE vulnerability",
"details" : "Summary\n\nWhen loading an (untrusted) XML document, for example the SAMLResponse, it's possible to induce an XXE.\n\n$options is defined as: https://github.com/simplesamlphp/xml-common/blob/v1.19.0/src/DOMDocumentFactory.php#L39\nincluding the DTDLoad option, which allows an attacker to read file contents from local file system OR internal network.\n\nWhile there is the NONET option, an attacker can simply bypass if by using PHP filters:\nphp://filter/convert.base64-encode/resource=http://URL OR FILE\n\nFrom there an attacker can induce network connections and steal the targeted file OOB (haven't fully tested this).\n\nRCE may be possible with the php://expect or php://phar wrappers, but this hasn't been tested.\n\nNote:\nThe mitigation here:\nhttps://github.com/simplesamlphp/xml-common/blob/v1.19.0/src/DOMDocumentFactory.php#L58\nComes too late, as the XML has already been loaded into a document.\nMitigation:\n\nRemove the LIBXML_DTDLOAD | LIBXML_DTDATTR options.\nAdditionally, 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)",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:H/SC:L/SI:L/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "simplesamlphp/xml-common"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.20.0"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "< 1.20"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/simplesamlphp/xml-common/security/advisories/GHSA-2x65-fpch-2fcm"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-52596"
}, {
"type" : "WEB",
"url" : "https://github.com/simplesamlphp/xml-common/commit/fa4ade391c3194466acf5fbfd5d2ecdbf5e831f5"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/simplesamlphp/xml-common"
}, {
"type" : "WEB",
"url" : "https://lists.debian.org/debian-lts-announce/2024/12/msg00001.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-611" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2024-12-02T17:14:30Z",
"nvd_published_at" : "2024-12-02T17:15:12Z"
}
}