By clicking “Accept”, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts. View our Privacy Policy for more information.
18px_cookie
e-remove

CVE-2025-47949 Reveals Flaw in samlify That Opens Door to SAML Single Sign-On Bypass

Information on the likelihood and impact of CVE-2025-47949

Information on the likelihood and impact of CVE-2025-47949

Information on the likelihood and impact of CVE-2025-47949

Written by
Meenakshi S L
Meenakshi S L
Published on
May 20, 2025

Information on the likelihood and impact of CVE-2025-47949

Information on the likelihood and impact of CVE-2025-47949

A new critical vulnerability popped up concerning samlify, a widely adopted Node.js library for implementing SAML 2.0 Single Sign-On. So, what exactly do you need to know about this? This post will break down the flaw, its potential impact on applications using samlify, and most importantly, guide you on how to secure your systems. Understanding this vulnerability is crucial for anyone involved in managing SAML-based authentication.

TL;DR

  • Vulnerability: A critical Signature Wrapping attack (CVE-2025-47949) affects samlify versions prior to 2.10.0.
  • Impact: Allows an attacker to forge SAML Responses, leading to complete authentication bypass and arbitrary user impersonation (including administrators).
  • Exploitability: Easy to exploit, requiring only a legitimately signed XML document from the Identity Provider.
  • Fix: Immediately upgrade to samlify version 2.10.0 or later.

What is samlify?

samlify [0]  is a widely used Node.js library designed to simplify the implementation of SAML 2.0 (Security Assertion Markup Language 2.0) for Single Sign-On (SSO) and Single Log-out (SLO). It provides a high-level API that abstracts away the complexities of the SAML protocol, making it easier for developers to build both Identity Providers (IdPs) and Service Providers (SPs) that communicate securely. Its purpose is to enable users to log in once to a central identity system and then seamlessly access multiple integrated applications without repeated authentication.

How popular is it?

Single Sign-on (SSO) scenarios are prominent and used in many contexts. SAML is one of the most used protocols to implement SSO, getting a SAML signed. For instance, SSO can support:

  • Enterprise Applications: Used by organizations to allow employees to access multiple internal tools with a single login.
  • Cloud Services (SaaS): Leveraged by SaaS providers to integrate with corporate identity management systems such as Active Directory, Azure AD, Okta, and OneLogin.
  • Federated Identity Management: Essential for secure identity exchange across different organizations.
  • Developer Tools and Platforms: Utilized by developers building or integrating authentication services.

samlify enjoys significant adoption within the Node.js ecosystem for the same. With over 200,000 weekly downloads[1] on npm, it demonstrates a substantial user base and is actively maintained. Its reliance by numerous other packages (62 dependents as per npm) further underscores its integration into various projects, ranging from enterprise applications to cloud services and internal developer tools. This widespread use makes any critical vulnerability in the library particularly impactful.

What is the vulnerability, and how easy or difficult is it for someone to exploit?

The vulnerability, identified as CVE-2025-47949, is a Signature Wrapping attack affecting samlify versions prior to 2.10.0. This is a severe weakness classified under CWE-347: Improper Verification of Cryptographic Signature.

The Vulnerability Explained:

SAML relies heavily on XML digital signatures to ensure the integrity and authenticity of messages exchanged between an Identity Provider (IdP) and a Service Provider (SP). In a Signature Wrapping attack, the attacker exploits a parsing flaw in the Service Provider's SAML library.

Here's how it generally works:

  1. Obtaining a Signed XML Document: The attacker first needs to obtain a legitimately signed XML document from the Identity Provider. This is the most crucial prerequisite. This can be achieved by:
    • Intercepting a legitimate SSO flow: By acting as a Man-in-the-Middle (MitM) or compromising a user's browser/device, an attacker can intercept a real SAML Response that was signed by the IdP.
    • Acquiring public IdP metadata: In some cases, if the IdP signs its public metadata (which is often XML), an attacker might be able to extract a valid signature from this.
  2. Crafting the Malicious SAML Response: The attacker then takes this legitimately signed XML document and manipulates it. They insert a second, malicious SAML Assertion into the document. This malicious assertion contains the identity of a target user (e.g., an administrator's username). The crucial part is that the valid signature from the original document still applies to a benign part of the XML structure, but the SP's vulnerable parsing logic will inadvertently process the unsigned, malicious assertion.
  3. Exploiting the Parsing Flaw: The vulnerable samlify versions would, after validating the signature (which still passes because it refers to the original, valid portion), then incorrectly parse the XML and extract the identity from the attacker-controlled, unsigned assertion that was subtly introduced.

Ease of Exploitation:

This vulnerability is considered easy to exploit for several reasons:

  • Low Attack Complexity: As per the CVE details (CVSS v4.0), the attack complexity is "Low." 
  • No Privileges Required: An attacker does not need any prior privileges on the target system to carry out this attack.
  • No User Interaction: The attack can be performed without any user interaction once the signed XML document is obtained.
  • Availability of Signed XML: Obtaining a signed XML document (either via interception or publicly available signed metadata) is a realistic scenario.

The danger lies in the library's improper verification of the cryptographic signature in relation to the parsed content. Even though the signature is valid, the library incorrectly extracts the user identity from an unsigned section, leading to an authentication bypass.

How does one fix it?

The fix for CVE-2025-47949 is straightforward and critically important:

  • Immediately upgrade samlify to version 2.10.0 or later.
  • Ensure secure SSO flows: Implement HTTPS and avoid untrusted sources for SAML flows.

References:

The Challenge

The Solution

The Impact

Book a Demo

Book a Demo

Book a Demo

Welcome to the resistance
Oops! Something went wrong while submitting the form.

Book a Demo

Book a Demo

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Book a Demo