{"id":"CVE-2025-66578","aliases":["CVE-2025-66578","GHSA-c4cc-x928-vjw9"],"related":[],"kind":"vulnerability","state":"published","title":"robrichards/xmlseclibs has an Libxml2 Canonicalization error which can bypass Digest/Signature validation","summary":"xmlseclibs is a library written in PHP for working with XML Encryption and Signatures. Versions 3.1.3 contain an authentication bypass vulnerability due to a flaw in the libxml2 canonicalization process during document transformation. When libxml2’s canonicalization is invoked on an invalid XML input, it may return an empty string rather than a canonicalized node. xmlseclibs then proceeds to compute the DigestValue over this empty string, treating it as if canonicalization succeeded. This issue is fixed in version 3.1.4. Workarounds include treating canonicalization failures (exceptions or nil/empty outputs) as fatal and aborting validation, and/or adding explicit checks to reject when canonicalize returns nil/empty or raises errors.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"xmlseclibs is a library written in PHP for working with XML Encryption and Signatures. Versions 3.1.3 contain an authentication bypass vulnerability due to a flaw in the libxml2 canonicalization process during document transformation. When libxml2’s canonicalization is invoked on an invalid XML input, it may return an empty string rather than a canonicalized node. xmlseclibs then proceeds to compute the DigestValue over this empty string, treating it as if canonicalization succeeded. This issue is fixed in version 3.1.4. Workarounds include treating canonicalization failures (exceptions or nil/empty outputs) as fatal and aborting validation, and/or adding explicit checks to reject when canonicalize returns nil/empty or raises errors.","source":"cvelist"},{"lang":"en","text":"### Summary\nAn authentication bypass vulnerability exists due to a flaw in the libxml2 canonicalization process, which is used by [xmlseclibs](https://github.com/robrichards/xmlseclibs) during document transformation. This weakness allows an attacker to generate a valid signature once and reuse it indefinitely. In practice, a signature created during a previous interaction - or through a misconfigured authentication flow - can be replayed to bypass authentication checks.\n\n### Details\nWhen libxml2’s canonicalization is invoked on an invalid XML input, it may return an empty string rather than a canonicalized node. [xmlseclibs](https://github.com/robrichards/xmlseclibs) then proceeds to compute the DigestValue over this empty string, treating it as if canonicalization succeeded.\n\nhttps://github.com/robrichards/xmlseclibs/blob/f4131320c6dcd460f1b0c67f16f8bf24ce4b5c3e/src/XMLSecurityDSig.php#L296\n\n### Impact\nDigest bypass: By crafting input that causes canonicalization to yield an empty string, the attacker can manipulate validation to pass incorrectly.\n\nSignature replay on empty canonical form: If an empty string has been signed once (e.g., in a prior interaction or via a misconfigured flow), that signature can potentially be replayed to bypass authentication.\n\n### Suggested remediation\nTreat canonicalization failures (exceptions or nil/empty outputs) as fatal and abort validation.\nAdd explicit checks: reject when canonicalize returns nil/empty or raise","format":"markdown","source":"ghsa"},{"lang":"es","text":"xmlseclibs es una biblioteca escrita en PHP para trabajar con Cifrado y Firmas XML. Las versiones 3.1.3 contienen una vulnerabilidad de omisión de autenticación debido a un fallo en el proceso de canonicalización de libxml2 durante la transformación de documentos. Cuando la canonicalización de libxml2 es invocada en una entrada XML inválida, puede devolver una cadena vacía en lugar de un nodo canonicalizado. xmlseclibs entonces procede a calcular el DigestValue sobre esta cadena vacía, tratándola como si la canonicalización hubiera tenido éxito. Este problema está solucionado en la versión 3.1.4. Las soluciones provisionales incluyen tratar los fallos de canonicalización (excepciones o salidas nulas/vacías) como fatales y abortar la validación, y/o añadir comprobaciones explícitas para rechazar cuando canonicalize devuelve nulo/vacío o genera errores.","source":"nvd"}],"published":"2025-12-08T17:57:33.000Z","modified":"2026-10-07T20:10:01.970Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:L/A:L","score":6,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:L/A:L","score":6,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:L/A:L","score":6,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","score":7.5,"rating":"HIGH"}],"cwes":["CWE-248"],"affected":[{"ranges":[{"version":"< 3.1.4","status":"affected"}],"vendor":"robrichards","product":"xmlseclibs","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"3.1.4"}],"ecosystem":"Packagist","package":"robrichards/xmlseclibs","purl":"pkg:composer/robrichards/xmlseclibs","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"3.1.4"}],"vendor":"xmlseclibs_project","product":"xmlseclibs","cpe":"cpe:2.3:a:xmlseclibs_project:xmlseclibs:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/robrichards/xmlseclibs/security/advisories/GHSA-c4cc-x928-vjw9","tags":["exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/robrichards/xmlseclibs/commit/69fd63080bc47a8d51bc101c30b7cb756862d1d6","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/robrichards/xmlseclibs/blob/f4131320c6dcd460f1b0c67f16f8bf24ce4b5c3e/src/XMLSecurityDSig.php#L296","tags":["product","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-66578","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/robrichards/xmlseclibs","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2025-12-09T15:24:31.684Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-66578","url":"https://www.cve.org/CVERecord?id=CVE-2025-66578","licence":"CVE Terms of Use","modified":"2025-12-09T15:24:42.721Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-c4cc-x928-vjw9","url":"https://github.com/advisories/GHSA-c4cc-x928-vjw9","licence":"CC-BY-4.0","modified":"2025-12-09T19:52:24.819Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-66578","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-66578","licence":"Public domain","modified":"2026-10-07T20:10:01.970Z"}],"updatedAt":"2026-11-25T22:59:08.541Z","epss":{"score":0.00255,"percentile":0.18199,"date":"2026-12-01T12:00:22.000Z"}}