/

CVE-2026-49454

Severity:

CRITICAL RISK

(9.1)

SAML Signature Validation Flaw (CWE-347) in Relyra

CVE-2026-49454

Deferred

Vulnerability type

Category:

Improper Authentication / Signature Validation

CWE:

CWE-287, CWE-347

Impact:

Authentication Bypass and Identity Impersonation

Severity:

CRITICAL RISK

(9.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Relyra, a strict-by-default SAML 2.0 Service Provider library for Elixir and Phoenix, contained a signature verification flaw that allowed forged SAML assertions to be accepted as authenticated.

Because the cryptographic SignatureValue and associated digests were not actually verified against the IdP certificate, an attacker able to inject or alter SAML responses could obtain successful logins with attacker-controlled identities.

Affected context

This vulnerability affects applications that use vulnerable versions of the Relyra SAML Service Provider library (notably 1.0.0 and 1.1.0) to implement SAML 2.0 single sign-on.

It manifests when SAML responses from an Identity Provider (IdP) are treated as trusted if they merely conform structurally and appear to come from an expected source, without performing full XML Digital Signature (XMLDSig) verification against the configured IdP certificate.

Environments that terminate SAML at an application boundary using Relyra, especially those relying on SSO for administrative or high-privilege access, are particularly exposed if attackers can influence or relay SAML messages.

Exploit preconditions

  • Attack surface: SAML assertion consumer endpoints (ACS) exposed by applications integrating Relyra.
  • Required access: Ability to intercept, modify, or directly post crafted SAML Responses to the ACS endpoint (e.g., via network position, misconfigured IdP, compromised browser or client, or open redirect/relay abuses).
  • Trigger point: The vulnerable signature-validation routine that processes the <ds:Signature> element of the SAML Response or Assertion.
  • Why exploitation is possible: The library performed a structure-only check and accepted signatures without:
  • Verifying SignatureValue over the canonicalized SignedInfo with :public_key.verify against the IdP's public key.
  • Recomputing and comparing DigestValue over the canonicalized referenced XML element.
  • Using the canonicalization logic (canonicalize/2) in the actual verification path.

As a result, a forged signature with arbitrary NameID and related subject data could be returned as a successful authentication result.

Why this happens

The root cause is an incomplete XMLDSig verification implementation that validates the presence and shape of signature-related elements but does not cryptographically prove their authenticity.

This maps to CWE-347: Improper Verification of Cryptographic Signature and is closely tied to CWE-287: Improper Authentication, because the application's trust in user identity ultimately depends on a signature that was never actually verified.

The library failed to:

  • Apply canonicalization and signature verification (:public_key.verify) to SignedInfo using the configured IdP certificate.
  • Recalculate digests of the referenced XML fragments and compare them against DigestValue.

Consequently, the trust boundary stopped at structural checks, allowing attacker-supplied signature bytes and identity attributes to be treated as valid.

Potential impact

  • Attackers can impersonate arbitrary users by forging SAML Responses with attacker-controlled NameID and attributes.
  • Privilege escalation to administrative or highly privileged accounts if those roles are derived from SAML attributes or mapped identities.
  • Complete bypass of SSO-based access controls across multiple relying applications integrated with the same IdP.
  • Potential lateral movement between systems that trust the compromised SAML assertions for federation.
  • Regulatory and compliance exposure due to unauthorized access to sensitive data and services.

General mitigation guidance

Mitigation focuses on enforcing complete, cryptographically sound SAML signature verification and strengthening the authentication boundary:

  • Ensure XMLDSig verification includes:
  • Canonicalization (e.g., exclusive C14N) of SignedInfo.
  • Verification of SignatureValue against the configured IdP certificate using a trusted crypto primitive.
  • Recalculation and comparison of DigestValue for each referenced element.
  • Treat SAML assertions as untrusted until all cryptographic checks and reference validations succeed, not just structural or schema checks.
  • Restrict which IdP certificates are accepted and ensure they are provisioned via out-of-band, authenticated channels.
  • Apply least-privilege and defense-in-depth controls so that SAML-based authentication does not automatically grant broad or administrative access without additional checks.
  • Prefer mature, well-reviewed SAML and XMLDSig libraries or hardened verification routines that default to safe behavior and minimize custom signature-handling logic.

How teams detect issues like this

Effective detection involves reviewing both code and runtime behavior around SAML processing:

  • Static analysis and code review:
  • Look for custom SAML or XMLDSig handling that parses <ds:Signature> but does not invoke strong cryptographic verification against a configured IdP public key.
  • Flag flows where canonicalization helpers (e.g., canonicalize/2) exist but are unused or bypassed in the verification path.
  • Identify any signature checks that rely only on the presence of signature elements, issuer fields, or document structure instead of validated cryptographic results.
  • Configuration and policy checks:
  • Verify that each relying party is configured with explicit, pinned IdP certificates and rejects unknown or unexpected keys.
  • Enforce policies requiring full signature and digest validation for all SAML Responses/Assertions, including nested or referenced elements.
  • Runtime monitoring:
  • Monitor authentication logs for anomalous patterns, such as successful logins for accounts without normal login activity or from unusual clients.
  • Use security testing and fuzzing tools that craft malformed or unsigned SAML Responses to confirm that the service correctly rejects them.

Automated security testing tools and SSO-focused scanners can help identify places where SAML assertions are accepted without complete cryptographic verification.

Sources

SourceLink
github.comgithub.com/szTheory/relyra/commit/2e456897af3158c175bb490ce7fc51d6241c8922
github.comgithub.com/szTheory/relyra/commit/8910200
github.comgithub.com/szTheory/relyra/security/advisories/GHSA-jv46-xfwm-36j7

Frequently asked

questions

The scope can be wide: any application that uses a vulnerable Relyra version to process SAML Responses is exposed if an attacker can deliver crafted SAML messages to the assertion consumer service. In federated environments, one successful exploit can impact multiple services relying on the same SSO.

Not necessarily. The core requirement is the ability to send forged SAML Responses to the ACS endpoint. This might be achieved by direct HTTP POST, abusing a redirect or relay flow, or leveraging a position that allows tampering with SAML messages in transit; valid IdP credentials are not required if the signature itself is not verified.

The safest pattern is to enforce complete, standards-compliant XMLDSig verification for every SAML Response/Assertion, including proper canonicalization, digest recomputation, and signature verification against pinned IdP certificates, while rejecting any response that fails any cryptographic or reference check.

Future prevention relies on treating SAML and XML signatures as security-critical boundaries: avoid custom signature logic where possible, rely on well-tested libraries with secure defaults, require code reviews focused on crypto and SSO flows, and incorporate security testing that deliberately submits malformed or unsigned SAML data to verify strict rejection behavior.

Find out what's already
exploitable in your codebase.