# The Danger of Multi-SSO AWS Cognito User Pools

DevFeed: [The Danger of Multi-SSO AWS Cognito User Pools](<https://devfeed.tech/articles/the-danger-of-multi-sso-aws-cognito-user-pools-92074.md>)

Original publisher: [Read original article](<https://blog.doyensec.com/2026/05/05/cloudsectidbits-masso-cognito-sso.html>)

Published: 2026-05-04T22:00:00Z

Content type: article

Language: en

Sources: [Doyensec](<https://devfeed.tech/sources/doyensec.md>)

Topics: [Amazon Cognito](<https://devfeed.tech/topics/amazon-cognito.md>), [Single sign-on (SSO)](<https://devfeed.tech/topics/sso.md>)

Tags: [auditing](<https://devfeed.tech/tags/auditing.md>), [automation](<https://devfeed.tech/tags/automation.md>), [aws](<https://devfeed.tech/tags/aws.md>), [aws-cognito](<https://devfeed.tech/tags/aws-cognito.md>), [aws-lambda](<https://devfeed.tech/tags/aws-lambda.md>), [cloud-security](<https://devfeed.tech/tags/cloud-security.md>), [doyensec](<https://devfeed.tech/tags/doyensec.md>), [doyensecurity](<https://devfeed.tech/tags/doyensecurity.md>), [exploit](<https://devfeed.tech/tags/exploit.md>), [hacking](<https://devfeed.tech/tags/hacking.md>), [iac](<https://devfeed.tech/tags/iac.md>), [idp](<https://devfeed.tech/tags/idp.md>), [infosec](<https://devfeed.tech/tags/infosec.md>), [offensive](<https://devfeed.tech/tags/offensive.md>), [oidc](<https://devfeed.tech/tags/oidc.md>), [pentest](<https://devfeed.tech/tags/pentest.md>), [pentester](<https://devfeed.tech/tags/pentester.md>), [reverse-engineering](<https://devfeed.tech/tags/reverse-engineering.md>), [saas](<https://devfeed.tech/tags/saas.md>), [saml](<https://devfeed.tech/tags/saml.md>), [security](<https://devfeed.tech/tags/security.md>), [security-testing](<https://devfeed.tech/tags/security-testing.md>), [sso](<https://devfeed.tech/tags/sso.md>), [triggers](<https://devfeed.tech/tags/triggers.md>), [vulnerability](<https://devfeed.tech/tags/vulnerability.md>)

## AI overview

The article warns that a malicious or compromised external IdP can exploit weak identity checks in multi-tenant Cognito pools. Cognito invokes different trigger chains on first federated sign-in and later sign-ins; `PreSignUp_ExternalProvider` is the last gate before a user record is created, and a later rejection does not roll that record back. The article also describes fragile parsing of federated usernames (`ProviderName_<sub>`) when attacker-controlled `sub` values contain underscores, visually confusable IdP names, and routing hijacks when tenants can claim `IdpIdentifiers` without proving domain ownership. It recommends enforcing checks in `PreSignUp` for relevant `triggerSource` values, using consistent parsing, deriving security-sensitive attributes server-side, validating email there, and avoiding free-form self-service identifiers. The supplied text also identifies maSSO as a testing IdP for OIDC, SAML 2.0, and SCIM.

## Source excerpt

After a small detour, the CloudSecTidbits series is back with new episodes. We had the opportunity to present them at the first DEFCON in Singapore few days ago during our DemoLabs sessions. Meeting Singapore's community was indeed amazing - thanks again for having us! From the Previous Episodes CloudSec Tidbits is a blogpost series showcasing interesting bugs found by Doyensec during cloud security testing activities. We focus on vulnerabilities resulting from an insecure combination of web and cloud related technologies. Every article includes an Infrastructure as Code (IaC) laboratory that can be easily deployed to experiment with the described vulnerability. Time to get ready and dive into a new tidbit. Tidbit No. 4 - The Danger of Multi-SSO User Pools What is AWS Cognito? If you need a refresher, you can start by reading the initial AWS Cognito introduction we did back in S1 Ep.2, Tampering User Attributes In AWS Cognito User Pools. This time we leave simple setups behind and walk through the kind of multi-tenant Cognito deployment that is becoming the SaaS default: one User Pool, many tenants, and each tenant bringing "their" external IdP. AWS Cognito Multi-SSO Flows With Cognito User Pools, developers can register multiple external IdPs (OIDC and SAML) against a single pool and expose them via the hosted UI (managed login page), or via a custom login page that still hits the hosted SSO endpoints. External IdPs are registered through the CreateIdentityProvider API. A minimal OIDC registration looks like this: Of course, such a creation is typically made by the backend of the platform supporting custom IdP settings for its tenants. Introducing a New Actor, AWS Lambda Triggers Primer Triggers are synchronous hooks that allow developers to embed custom logic into event-driven flows. When it comes to Cognito, the service invokes multiple triggers at specific stages of user creation and authentication through SSO. They stop the SSO authentication flow and allow cus