Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2026-18568

CVE-2026-18568: XML::Sig Auth Bypass Vulnerability

CVE-2026-18568 is an authentication bypass vulnerability in XML::Sig for Perl that allows attackers to bypass signature verification. This post covers the technical details, affected versions, impact, and mitigation.

Published:

CVE-2026-18568 Overview

CVE-2026-18568 is a signature verification bypass in the XML::Sig Perl module, affecting versions from 0.29 before 0.72. The verify function in lib/XML/Sig.pm returns true even when every signature in a document is skipped before any cryptographic check runs. An attacker can craft XML with Signature elements whose Reference/@URI points to an ID no element carries, causing verify to fall through to an unconditional return 1. Any caller passing untrusted XML to verify can receive a true return for a document where no digest and no signature value was checked. This weakness is classified as [CWE-347] Improper Verification of Cryptographic Signature.

Critical Impact

Attackers can forge SAML assertions and other signed XML documents, bypassing authentication and integrity controls in Perl applications using XML::Sig for signature verification.

Affected Products

  • XML::Sig for Perl versions 0.29 through 0.71
  • Perl applications relying on XML::Sig for XML Digital Signature verification
  • Downstream modules such as SAML2 authentication libraries built on XML::Sig

Discovery Timeline

  • 2026-08-03 - CVE-2026-18568 published to NVD
  • 2026-08-05 - Last updated in NVD database

Technical Details for CVE-2026-18568

Vulnerability Analysis

The verify routine in lib/XML/Sig.pm counts //dsig:Signature elements into $numsigs and iterates over each one. Two code paths reach next before any digest or key check runs. The first triggers when a SignedInfo/Reference/@URI resolves to no element while $numsigs is greater than 1. The second triggers when id_attr is set and a reference does not match the requested ID.

The loop records no state about what it verified. When every signature takes one of these skip paths, control reaches an unconditional return 1 at the end of verify. Two Signature elements whose Reference URI names an ID no element carries is sufficient to trigger the bypass. A single such element combined with id_attr also works. A cert or cert_text trust anchor provides no protection because no key check ever runs.

Root Cause

The root cause is missing state tracking in the verification loop. The function does not distinguish between "signatures present" and "signatures actually verified." Versions up to 0.28 used an XML::XPath based verify without this skip logic and are not affected.

Attack Vector

An attacker takes a legitimately signed document, rewrites the signed content, renames the element carrying the referenced ID, and duplicates the Signature element. The Reference URI now points at nothing. Every signature is skipped, and verify returns true for the forged document.

text
     print ("NodeSet Size: $numsigs\n") if $DEBUG;
 
     die 'XML::Sig - XML does not include any signatures' if $numsigs <= 0;
+
+    # References actually verified.  $numsigs counts Signature elements
+    # present, not signatures verified - the loop below skips some before
+    # any cryptographic check runs.
+    my $verified = 0;
+
     # Loop through each Signature in the document checking each
     my $i;
     while (my $signature_node = $signature_nodeset->shift()) {

Source: GitHub Commit Patch. The patch introduces a $verified counter and fails verification when no signature was actually verified.

Detection Methods for CVE-2026-18568

Indicators of Compromise

  • XML documents containing multiple dsig:Signature elements where each SignedInfo/Reference/@URI points to an ID that no element in the document carries.
  • Signed XML payloads where the referenced ID attribute value has been renamed or removed while the Signature block remains intact.
  • Duplicate Signature blocks appended to otherwise valid signed XML, particularly in SAML Response or Assertion payloads.

Detection Strategies

  • Inspect application logs for XML::Sig verify calls returning success on documents with unresolved Reference URIs.
  • Add wrapper logic around verify that independently checks each Reference/@URI resolves to an element before trusting the return value.
  • Perform static analysis on Perl codebases to enumerate all callers of XML::Sig->verify and confirm the installed module version is 0.72 or later.

Monitoring Recommendations

  • Monitor authentication services that consume signed SAML or XML payloads for unusual assertion content, privilege escalations, or user identity mismatches.
  • Log full pre-verification XML payloads at SAML service providers to enable retrospective forensic analysis if a bypass is suspected.
  • Alert on Perl module inventory changes that downgrade XML::Sig below 0.72.

How to Mitigate CVE-2026-18568

Immediate Actions Required

  • Upgrade XML::Sig to version 0.72 or later on every host running affected Perl applications.
  • Audit all downstream modules, including SAML2 authentication stacks, to confirm they resolve to the patched XML::Sig release.
  • Rotate credentials, session tokens, and trust anchors for services that accepted untrusted XML during the vulnerable window.

Patch Information

The fix is committed upstream in the perl-XML-Sig repository and released as version 0.72. See the MetaCPAN XML-Sig Changes for release notes. The patch adds a $verified counter and fails verification when no reference was actually checked. A regression test t/031_verify_must_verify_something.t was added to ensure verify cannot return true unless at least one signature was cryptographically validated.

Workarounds

  • Wrap calls to XML::Sig->verify with pre-checks that reject documents whose Reference/@URI values do not resolve to elements bearing matching ID attributes.
  • Reject any XML document containing more than one dsig:Signature element unless the application explicitly requires multi-signature workflows.
  • Enforce strict schema validation on inbound signed XML to prevent renamed ID attributes and duplicated Signature blocks from being accepted upstream of verify.
bash
# Upgrade XML::Sig to the fixed release
cpanm XML::Sig@0.72

# Verify installed version
perl -MXML::Sig -e 'print "$XML::Sig::VERSION\n"'

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.