Join our Newsletter — 33% off our NHI Course
Home› Glossary› Threats, Abuse & Incident Response› Assertion injection
Threats, Abuse & Incident Response

Assertion injection

← Back to Glossary
By NHI Mgmt Group Updated November 5, 2026 Domain: Threats, Abuse & Incident Response

A SAML attack in which a forged assertion is inserted into a message so that the application processes the attacker-controlled identity instead of the legitimate one. The vulnerability usually appears when signature checks cover one part of the document while identity extraction reads another part first.

How assertion injection works

Assertion injection is a federation attack against SAML processing, not a flaw in the concept of single sign-on itself. It succeeds when a service accepts identity data from one part of the message while trusting signature coverage on another part, so the attacker can substitute an assertion that names a different subject or account.

The core problem is document confusion. If the parser, business logic, or trust layer reads the first usable assertion before it has positively tied that data to the signed element, the application may authenticate the attacker’s chosen identity. That is why this class of issue is often discussed alongside XML structure ambiguity, signature wrapping, and flawed canonicalization or reference handling.

Why it is dangerous in federated identity

In a SAML flow, the assertion is the security decision. If an attacker can inject or redirect the consuming application to the wrong assertion, they can impersonate a user, reuse a privileged role, or bypass the intended identity provider assurance path. The impact is usually account takeover through federation rather than password theft.

This risk is especially serious in environments that rely on IdP-initiated sign-in, complex trust relationships, or custom SAML parsing logic. A weaker implementation may validate the signature but still bind the session to an attacker-controlled assertion, which breaks the assumption that “signed” automatically means “the identity extracted is the one that was signed.”

How organisations check exposure and harden SAML flows

Exposure checks start with inventory: identify every application that consumes SAML, every trust relationship, and every place where assertion parsing is custom or middleware-driven. Then verify whether the application binds identity, recipient, audience, and signature reference to the same assertion object rather than accepting whichever assertion appears first.

Vendor guidance matters here because the exact failure mode depends on product behaviour and configuration. The safest operational approach is to confirm that the SAML library or service provider enforces strict signature validation, canonical reference resolution, and unambiguous assertion-to-session binding. For the assurance expectations around federation, see the NIST SP 800-63C-4 Federation Assurance Levels Guide.

Detection and post-compromise review

Detection is difficult if the application logs only the final authenticated user and not the full federation transaction. Useful signals include unusual assertion identifiers, mismatches between the signed element and the consumed subject, abnormal relay-state or recipient patterns, and sessions that map to identities the IdP never actually issued for that transaction.

After suspected exploitation, review federation logs, IdP logs, service provider logs, and any downstream actions taken by the resulting session. If the application accepted an attacker-chosen assertion, treat the resulting session as potentially fraudulent and investigate whether access tokens, long-lived sessions, or delegated permissions were issued on the basis of that trust decision.

Risk and Threat Considerations

Assertion injection is dangerous because it attacks the trust boundary between cryptographic verification and identity consumption. A system can appear to validate SAML correctly while still being exploitable if it reads or maps the wrong assertion element first.

Failure mechanism: The attacker exploits parser ambiguity, signature wrapping, or inconsistent document handling so that the signed content is not the content used for authentication.

Impact: The application may create a session for the wrong user, grant elevated access, or let an attacker impersonate any identity they can encode into the forged assertion.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP API Security Top 10 and MITRE ATT&CK address the attack and risk surface, while NIST SP 800-63, NIST SP 800-53 Rev 5 and OWASP ASVS set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
NIST SP 800-63Federation and Assertion ValidationFederation assurance guidance governs trusted assertion handling in SAML flows.
Recommendation — Validate that the consumed assertion is the one covered by the federation trust decision.
NIST SP 800-53 Rev 5IA-5 — Authenticator ManagementAssertion abuse can undermine identity binding and the trust placed in federated authenticators.
Recommendation — Protect federation trust material and verify assertion processing integrity before establishing a session.
OWASP ASVSV10 — OAuth and OIDCFederated identity handling needs strict token and assertion trust processing discipline.
Recommendation — Apply federation validation requirements that bind identity claims to the correct signed trust object.
OWASP API Security Top 10API2 — Broken AuthenticationThe attack causes the service to accept attacker-controlled identity data as authenticated input.
Recommendation — Harden authentication processing so forged identity assertions cannot establish a session.
MITRE ATT&CKT1550 — Use Alternate Authentication MaterialAssertion injection lets an attacker abuse trusted authentication material to impersonate a victim.
Recommendation — Map federation abuse to trusted-material misuse and hunt for anomalous authenticated sessions.

Practitioner Guidance

Why practitioners should care: This is a control-integrity problem, not just a parser bug. Federated login depends on the consuming service proving that the assertion it trusts is exactly the one that was signed and intended for that session.

What to watch for: Treat any implementation that separates signature verification from assertion selection as suspect, especially where the code handles multiple assertions, custom XML processing, or IdP-initiated flows.

Practitioner takeaway: The safest pattern is to make assertion selection deterministic, bind it tightly to signature verification, and test the full SAML handling path with maliciously structured messages rather than assuming library defaults are sufficient.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on November 5, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org