CVE-2026-18568
JSON

7.5high

XML::Sig versions from 0.29 before 0.72 for Perl allow signature verification bypass because verify returns true when every signature was skipped before any cryptographic check

Severity
7.5high CVSS:3.1 by CISA-ADP
Exploit likelihood
0.19% (higher than 9% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
CPANSec

Description

XML::Sig versions from 0.29 before 0.72 for Perl allow signature verification bypass because verify returns true when every signature was skipped before any cryptographic check. verify in lib/XML/Sig.pm counts the `//dsig:Signature` elements into `$numsigs` and iterates over them, but two paths reach `next` before any digest or key check runs: a `SignedInfo/Reference/@URI` that resolves to no element while `$numsigs` is greater than 1, and, when `id_attr` is set, a reference that does not match the requested ID. The loop records nothing about what it checked, so when every signature takes one of those paths control reaches the unconditional `return 1` that ends verify. Two `Signature` elements whose Reference URI names an ID that no element carries is enough, as is one such element combined with `id_attr`. Any caller that passes untrusted XML to verify can receive a true return for a document in which no digest and no signature value was checked; a `cert` or `cert_text` trust anchor does not change this, because no key check runs. Versions up to 0.28 use an XML::XPath based verify that has no such skip and are not affected.

Affected

Product or packageVersionsReported by
XML-Sigfrom 0.29 before 0.72CVE List
xml::sig_project xml::sigfrom 0.29 before 0.72NVD

Classification

CWE-347

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.

What each source says

CVE List

XML::Sig versions from 0.29 before 0.72 for Perl allow signature verification bypass because verify returns true when every signature was skipped before any cryptographic check. verify in lib/XML/Sig.pm counts the `//dsig:Signature` elements into `$numsigs` and iterates over them, but two paths reach `next` before any digest or key check runs: a `SignedInfo/Reference/@URI` that resolves to no element while `$numsigs` is greater than 1, and, when `id_attr` is set, a reference that does not match the requested ID. The loop records nothing about what it checked, so when every signature takes one of those paths control reaches the unconditional `return 1` that ends verify. Two `Signature` elements whose Reference URI names an ID that no element carries is enough, as is one such element combined with `id_attr`. Any caller that passes untrusted XML to verify can receive a true return for a document in which no digest and no signature value was checked; a `cert` or `cert_text` trust anchor does not change this, because no key check runs. Versions up to 0.28 use an XML::XPath based verify that has no such skip and are not affected.

NVD (es)

Las versiones de XML::Sig desde la 0.29 anteriores a la 0.72 para Perl permiten eludir la verificación de firma porque verify devuelve verdadero cuando se omitió cada firma antes de cualquier comprobación criptográfica. verify en lib/XML/Sig.pm cuenta los elementos ’//dsig:Signature’ en ’$numsigs’ e itera sobre ellos, pero dos rutas alcanzan ’next’ antes de que se ejecute cualquier comprobación de digest o clave: un ’SignedInfo/Reference/@URI’ que no se resuelve a ningún elemento mientras ’$numsigs’ es mayor que 1, y, cuando ’id_attr’ está configurado, una referencia que no coincide con el ID solicitado. El bucle no registra nada sobre lo que comprobó, así que cuando cada firma toma una de esas rutas, el control alcanza el ’return 1’ incondicional que finaliza verify. Dos elementos ’Signature’ cuyo URI de Referencia nombra un ID que ningún elemento contiene es suficiente, al igual que un elemento de este tipo combinado con ’id_attr’. Cualquier llamador que pase XML no confiable a verify puede recibir un retorno verdadero para un documento en el que no se comprobó ningún digest ni ningún valor de firma; un ancla de confianza ’cert’ o ’cert_text’ no cambia esto, porque no se ejecuta ninguna comprobación de clave. Las versiones hasta la 0.28 usan un verify basado en XML::XPath que no tiene tal omisión y no se ven afectadas.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-18568 changed 2026-08-03CVE Terms of Use
NVDCVE-2026-18568 changed 2026-10-23Public domain