AWS Security ChangesHomeSearch

AWS cognito: Add best practices for isolating apps that share a SAML IdP

Service: cognito · 2026-11-26 · Security-related high

File: cognito/latest/developerguide/identity-pools-security-best-practices.md · Type: authz

Summary

Adds a new best-practices subsection explaining that identity pool SAML trust is scoped to the IAM SAML provider (shared audience urn:amazon:webservices), not to an individual application, and recommends dedicated IAM SAML providers per trust boundary, rules-based role mapping with AmbiguousRoleResolution set to Deny, and role trust policies restricted with cognito-identity.amazonaws.com:aud and :amr condition keys.

Security assessment

The added text documents a concrete weakness: because identity pools accept any valid assertion from a trusted SAML IdP regardless of the application it was issued for, a user authenticated for one application can obtain AWS credentials from another identity pool sharing that IdP. The guidance (separate IAM SAML providers per trust boundary, Deny on ambiguous role resolution, aud/amr trust-policy conditions) directly mitigates unauthorized credential issuance.

Evidence

Identity pool SAML trust is scoped to the SAML IdP that you register in IAM, not to an individual application. Identity pools use the shared AWS relying party audience `urn:amazon:webservices`, and don't check whether your IdP issued an assertion for a specific identity pool. Any user that your IdP authenticates, for any application, can present their SAML assertion to an identity pool that trusts that IdP.

Diff

diff --git a/cognito/latest/developerguide/identity-pools-security-best-practices.md b/cognito/latest/developerguide/identity-pools-security-best-practices.md
index 70871a4..44400f4 100644
--- a//cognito/latest/developerguide/identity-pools-security-best-practices.md
+++ b//cognito/latest/developerguide/identity-pools-security-best-practices.md
@@ -154,0 +155,17 @@ As a best practice, only implement developer providers under the following condi
+### Isolate applications that share a SAML IdP
+
+Identity pool SAML trust is scoped to the SAML IdP that you register in IAM, not to an individual application. Identity pools use the shared AWS relying party audience `urn:amazon:webservices`, and don't check whether your IdP issued an assertion for a specific identity pool. Any user that your IdP authenticates, for any application, can present their SAML assertion to an identity pool that trusts that IdP.
+
+As a best practice, when your SAML IdP serves more than one application, take the following precautions:
+
+  * Register a dedicated IAM SAML provider, backed by a separate IdP application and signing certificate, for each trust boundary.
+
+  * Use rules-based role mapping on claims that end users can't modify, and set `AmbiguousRoleResolution` to `Deny` instead of `AuthenticatedRole`.
+
+  * Restrict your role trust policies by using the `cognito-identity.amazonaws.com:aud` and `cognito-identity.amazonaws.com:amr` condition keys. SAML condition keys like `saml:aud` don't apply to roles that identity pools assume.
+
+
+
+
+For more information, see [SAML federation trust scope in identity pools](./saml-identity-provider.html#saml-identity-provider-trust-scope).
+