Net::SAML2 versions before 0.86 for Perl allow authentication bypass (CVE-2026-18108)
CVE-2026-18108 is a critical authentication bypass in the Perl Net::SAML2 library before version 0.86. The _verify_encrypted_assertion function decrypts an EncryptedAssertion and returns it as verified when it carries no dsig:Signature element, via an early return that skips signature and trust anchor checks. An attacker who obtains the SP's public encryption certificate (published in SAML metadata) can encrypt a forged unsigned assertion, wrap it in a samlp:Response, and post it to the assertion consumer service to authenticate as an arbitrary user. The fix in 0.86 requires trust anchor validation of decrypted EncryptedAssertions. Callers without a decryption key_file configured are unaffected.
Research notes
- Root causeThe _verify_encrypted_assertion function in Net::SAML2 returns the decrypted XML as verified when no dsig:Signature element is present, via an early return that bypasses the signature check and trust anchor verification. This allows an unsigned decrypted assertion to reach new_from_xml with its NameID and attributes accepted as authentic.
- Exploit chainAn attacker can (1) obtain the SP's public encryption certificate from published SAML metadata, (2) forge an unsigned SAML assertion with arbitrary identity/attributes, (3) encrypt it to the SP's certificate, (4) wrap it in a samlp:Response, and (5) post it to the assertion consumer service. The vulnerable library decrypts and accepts the assertion without requiring a signature, resulting in authentication as the forged identity.
- MitigationFixed in Net::SAML2 version 0.86, which requires trust anchor validation of decrypted EncryptedAssertions. Callers without a decryption key_file configured do not accept EncryptedAssertions and are unaffected.