跳转至

CloudSectiDbits

Ch11.209 CloudSectiDbits

📊 Level ⭐⭐ | 4.2KB | entities/cloudsectidbits.md

Key Research

Masso: Cognito SSO Bypass

A vulnerability in AWS Cognito's SSO implementation allowing authentication bypass. ^[raw/cloudsectidbits-masso-cognito-sso.html]

深度分析

Masso 漏洞揭示了 AWS Cognito SSO 实现中一个系统性的认证绕过问题。这类漏洞的危险性在于:Cognito 是 AWS 最常用的身份管理服务之一,从初创公司到企业级应用都有大量部署,SSO bypass 意味着攻击者可以绕过整个身份验证层。 ^[raw/cloudsectidbits-masso-cognito-sso.html] 攻击原理推断(基于 Doyensec 的研究模式和 Cognito 架构):Masso 很可能利用了 Cognito-hosted UI 的 URL 参数处理或 token exchange 过程中的状态机漏洞。常见的 Cognito SSO bypass 模式包括: ^[raw/cloudsectidbits-masso-cognito-sso.html] 1. State parameter 不绑定 session:Cognito 的 OAuth2 authorization code flow 中,state 参数用于防止 CSRF。如果 state 参数验证不严格,攻击者可以通过固定 state 值实现会话固定攻击。 ^[raw/cloudsectidbits-masso-cognito-sso.html] 2. Token 替换:在 SSO 流程中,多个 token(id_token、access_token、refresh_token)的交换顺序和验证时机存在 race window,攻击者可能在此窗口内用旧 token 替换新 token。 ^[raw/cloudsectidbits-masso-cognito-sso.html] 3. Domain verification bypass:Cognito 支持自定义域名,如果自定义域名的证书验证或 DNS 委托配置不当,可能被利用进行钓鱼攻击。 ^[raw/cloudsectidbits-masso-cognito-sso.html] Zero Trust 视角下的含义:Masso 漏洞对 Zero Trust 架构是一个警醒——Zero Trust 的核心假设是"不信任网络位置,始终验证身份"。但如果身份提供者(IdP)本身存在认证绕过,整个 Zero Trust 模型的边界就失效了。这意味着对 Cognito、Okta、Auth0 等 IdP 的安全评估需要独立于应用层安全评估进行。 ^[raw/cloudsectidbits-masso-cognito-sso.html]

实践启示

  • 立即审计 Cognito 的 SSO 配置:检查你的 User Pool 和 Identity Pool 配置,特别是 Hosted UI 的使用情况——如果使用了 Cognito hosted UI,检查是否有自定义域名,并验证 DNS 委托配置是否正确。Hosted UI 虽然方便,但在默认配置下可能存在与 Masso 类似的认证绕过风险。
  • 最小化 Cognito 的攻击面:优先使用 Developer Authenticated Identities 而非 Hosted UI;对于企业应用,考虑将 Cognito 与真正的 enterprise IdP(Okta、Azure AD)集成,而非依赖 Cognito 内置的 SSO 实现。
  • Token 轮换和会话绑定:确保应用正确处理 token 生命周期,特别是 refresh_token 的使用。避免在客户端长期存储 access_token;实现 token 轮换机制,使旧 token 在被窃取后尽快失效。
  • Cognito 事件监控:开启 Cognito 的 CloudWatch logging,监控失败的认证尝试和异常的 token 交换行为。Masso 一类的认证绕过在事后往往可以通过日志中的异常模式发现——如短时间内大量来自不同 IP 的 token exchange 请求。
  • 第三方安全研究订阅:Doyensec 的 CloudSectiDbits 系列持续关注 AWS 安全研究,建议订阅其博客或 RSS feed,及时了解新发现的 Cognito、IAM、Lambda 等服务的漏洞和利用方式。

相关实体

原文存档 ^[raw/cloudsectidbits-masso-cognito-sso.html]