Security Advisories (4)
CVE-2025-40934 (2025-11-26)

XML-Sig versions 0.27 through 0.67 for Perl incorrectly validates XML files if signatures are omitted. An attacker can remove the signature from the XML document to make it pass the verification check. XML-Sig is a Perl module to validate signatures on XML files.  An unsigned XML file should return an error message.  The affected versions return true when attempting to validate an XML file that contains no signatures.

CVE-2026-18568 (2026-08-03)

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.

CVE-2026-9390 (2026-08-03)

XML::Sig versions before 0.71 for Perl allow XPath injection in ID lookup. verify() and _get_signed_xml() in lib/XML/Sig.pm build XPath expressions by concatenating the SignedInfo/Reference/@URI value read from the document being verified. The value is neither escaped nor checked against the NCName grammar that XML requires of an ID, so a URI containing a single quote closes the string literal in the generated expression and appends arbitrary XPath operators. A crafted URI can make the lookup match elements the reference does not name, or every element in the document, so which node is selected for digest verification is decided by the injected expression rather than by the reference.

CVE-2026-9487 (2026-08-03)

XML::Sig versions before 0.71 for Perl allow signature wrapping via duplicate ID. _get_signed_xml() in lib/XML/Sig.pm, called from verify(), resolves the SignedInfo Reference/@URI to a node with the XPath expression "//*[@ID='$id']" and returns the first node of the resulting node set. A document in which two elements share that ID value is accepted: the digest and signature are checked against whichever element comes first in document order, and the duplicate is not detected. Such a document verifies successfully while an application that resolves the same ID independently can read the second, attacker supplied element; in a SAML2 context this places the contents of an Assertion under attacker control.

Changes for version 0.61 - 2023-03-12

  • Notable Changes since 0.59
    • Forgot to update the Change for 0.60
    • Minor fixes for ecdsa, DSA
    • Improve test to handle xmlsec1 and openssl version differences
    • 02a57cb v0.60
    • 44e3f47 Fix tests for changes to xmlsec output
    • 5d790dd Update repo version
    • 66b6886 Auto install dependencies in github action
    • 3f5e789 use Test::Sig::XML for hmac tests
    • 6699eed Improve tests for xmlsec and openssl version differences
    • 0b57351 Add support for key name to hmac to satisfy xmlsec tests
    • 86fb23f Fix missing SKIP in t/008_sign_saml.t
    • 983f1e0 Fix DSA implementation regarding keysize to signature hashing alg
    • 1186d53 Fix workflows with updated images
    • 45c7e13 Really fix hard-coded ecdsa key name
    • 97c01bb disabled ripemd160 between 3.0.0 and 3.0.6
    • 203e875 fix hard coded file name for loading ecdsa key
    • 4bdf307 v0.59

Modules

XML::Sig - A toolkit to help sign and verify XML Digital Signatures