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

CVE-2026-46490: Samlify Privilege Escalation Vulnerability

CVE-2026-46490 is a privilege escalation vulnerability in Samlify that allows attackers to inject XML markup into SAML assertions and gain unauthorized privileges. This article covers technical details, affected versions, and mitigation.

Published:

CVE-2026-46490 Overview

CVE-2026-46490 is an XML injection vulnerability in samlify, a Node.js library for SAML single sign-on (SSO). Versions prior to 2.13.0 escape attribute contexts during template substitution but fail to escape values inserted into element text such as <saml:AttributeValue>. An authenticated user can inject XML markup into attribute values (e.g., email or name fields) and append additional <saml:Attribute> elements inside the assertion before the Identity Provider (IdP) signs it. The Service Provider (SP) then accepts the injected attributes as trusted, signed data. The maintainers addressed the issue in samlify version 2.13.0.

Critical Impact

Authenticated attackers can inject signed SAML attributes to escalate privileges when downstream applications rely on these attributes for role or group authorization.

Affected Products

  • samlify Node.js library versions prior to 2.13.0
  • Applications using samlify as their SAML SSO implementation
  • Service Providers consuming assertions generated through the affected template substitution path

Discovery Timeline

  • 2026-06-08 - CVE-2026-46490 published to the National Vulnerability Database (NVD)
  • 2026-06-09 - Last updated in NVD database

Technical Details for CVE-2026-46490

Vulnerability Analysis

The flaw is classified under [CWE-91] (XML Injection / Improper Neutralization of Special Elements in XML). samlify constructs SAML assertions using template substitution. The substitution routine escapes characters only when values are placed inside XML attribute contexts. Values inserted as element text content, including <saml:AttributeValue> nodes, pass through without XML entity encoding.

A standard authenticated user controls profile fields such as email or display name. By embedding XML markup in those fields, the user can break out of the element text context and append new <saml:Attribute> siblings within the assertion. The IdP signs the resulting XML structure as legitimate output. The SP validates the signature successfully because the injected markup is now part of the signed canonical form.

When the SP uses attributes for authorization decisions, such as mapping Role or Group attributes to permissions, the attacker gains privileges they were never granted by the IdP administrator.

Root Cause

The template substitution logic applies XML escaping selectively. Attribute-context substitution escapes quotes and angle brackets, but element-text substitution does not call the same encoding routine. This asymmetry allows user-controlled strings to introduce new XML elements rather than being treated as inert text.

Attack Vector

Exploitation requires network access to the SSO flow and a valid user account on the IdP integrated with samlify. The attacker updates an attribute value under their control, then initiates the SSO login. The unescaped value alters the assertion structure before signing. No user interaction beyond the attacker's own login is required, and no elevated privileges are needed on the IdP.

A detailed proof-of-concept is documented in the samlify GitHub Security Advisory GHSA-34r5-q4jw-r36m.

Detection Methods for CVE-2026-46490

Indicators of Compromise

  • SAML assertions containing duplicate <saml:Attribute> elements with the same Name attribute
  • <saml:AttributeValue> element text containing literal XML tags or entity sequences such as </saml:AttributeValue><saml:Attribute Name=
  • User profile fields (email, displayName, givenName) storing strings with angle brackets or SAML namespace prefixes
  • Authorization decisions granting roles or group memberships that the IdP administrator did not provision

Detection Strategies

  • Parse SAML responses at the SP and compare the count and Name set of <saml:Attribute> elements against the IdP's authoritative directory output
  • Apply an XML schema or XPath validation that rejects assertions where any attribute appears more than once or contains nested element children inside AttributeValue
  • Inventory all services using samlify and compare installed versions against 2.13.0 using npm ls samlify

Monitoring Recommendations

  • Log full SAML assertions at both IdP and SP, then alert on assertions whose attribute set differs between the two endpoints
  • Audit identity directory writes for user-controlled fields containing <, >, or saml: substrings
  • Track privilege grants triggered by SSO logins and correlate with recent profile edits to detect attribute injection attempts

How to Mitigate CVE-2026-46490

Immediate Actions Required

  • Upgrade samlify to version 2.13.0 or later across all Node.js services
  • Audit user profile fields used as SAML attributes and strip XML metacharacters from existing records
  • Review recent authorization changes resulting from SSO logins to identify any abuse before patching

Patch Information

The issue is patched in samlify version 2.13.0. The fix extends XML escaping to element-text substitution contexts so that values inserted into nodes such as <saml:AttributeValue> are entity-encoded. Refer to the samlify GitHub Security Advisory for the upstream commit and release notes.

Workarounds

  • Enforce strict input validation on IdP-side attribute sources, rejecting any value containing <, >, &, or quote characters before it reaches the assertion template
  • Configure the SP to canonicalize and re-parse assertions, then reject any assertion with duplicate Attribute names or non-text children inside AttributeValue
  • Restrict authorization mappings to attributes whose values are constrained to enumerated identifiers rather than free-form strings
bash
# Upgrade samlify to the patched release
npm install samlify@^2.13.0
npm ls samlify

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.