Azure AD B2C 容易受到 Open Redirect 的攻击?

Vic*_*cky 5 redirect azure logout azure-ad-b2c

我正在使用 OWIN 和 OpenId 使用 Azure AD B2C 对我的 Web 应用程序的用户进行身份验证,Startup.Auth.cs 具有如下代码:

app.UseOpenIdConnectAuthentication(
            new OpenIdConnectAuthenticationOptions
            {
                 MetadataAddress = string.Format(AadInstance, Tenant, policy),
                AuthenticationType = policy,
                ClientId = clientId,
                Authority = authority,
                PostLogoutRedirectUri = postLogoutRedirectUri,
                RedirectUri = postLogoutRedirectUri,
                Notifications = new OpenIdConnectAuthenticationNotifica....
Run Code Online (Sandbox Code Playgroud)

在注销时,它会像这样导致重定向到 postLogoutRedirectUrl

https://login.microsoftonline.com/MY_TENANT/oauth2/logout?p=my_policy&post_logout_redirect_uri=https%3A%2F%2Fgoogle.com%2F

登出后重定向 URI 存在于门户的重定向 URI 中。

如果我停止浏览器并将地址栏中的 post logout uri 更改为 https%3A%2F%2Fevil.com%2F,即使此 url https://evil.com/不在允许的重定向中,重定向也会正确发生里。

为什么 AD B2C 不停止重定向?这不是对漏洞开放吗?

Par*_*akh 5

使用 Azure AD B2C 登录时,B2C 服务会向“redirect_uri”(应用)发送一个令牌。由于令牌需要保持安全,B2C 服务会要求您将应将令牌发送到的 URL 列入白名单。

当您退出时,B2C 服务不会将任何安全信息传输回应用程序。因此,即使用户被重定向到恶意站点,也不会丢失任何安全内容。

  • 如果有人拦截此请求并重定向到恶意网站,这看起来不太好。对于一无所知的用户,我们的网站似乎被重定向了。这很可能是一个设计成看起来像我的网络应用程序的网络钓鱼网站 (2认同)