Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
CVE-2026-50338 — Proof-of-concept exploit for CVE-2026-50338: cross-issuer authentication bypass in Spring Cloud Azure B2C resource servers. Demonstrates token forgery via AAD app registration to access protected B2C endpoints. | Kitploit
工具/GitHubGitHub/johanneslks/cve-2026-50338
身份验证与授权漏洞分析漏洞利用Web应用程序漏洞利用渗透测试学习与教育
GitHubjohanneslks/cve-2026-50338

CVE-2026-50338

Proof-of-concept exploit for CVE-2026-50338: cross-issuer authentication bypass in Spring Cloud Azure B2C resource servers. Demonstrates token forgery via AAD app registration to access protected B2C endpoints.

查看仓库
21个月前尚未审核

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

CVE-2026-50338

Spring Cloud Azure B2C 资源服务器跨身份颁发者认证绕过

描述

spring-cloud-azure-autoconfigure 中的 AadB2cResourceServerAutoConfiguration 构建了一个 JwtDecoder,该解码器信任从 AadB2cTrustedIssuerRepository.java:30 中的 AadTrustedIssuerRepository 继承的六个 AAD 系列颁发者(login.microsoftonline.com、sts.windows.net、sts.chinacloudapi.cn,每个含 v1 和 v2)。它未安装 tid 声明验证器,而 aud 谓词使用 containsAll(在空受众上为真空真)。

攻击者通过同一租户中的 AAD 应用注册,生成一个 client_credentials 令牌,其 iss 为 https://sts.windows.net/<tenant>/,aud 匹配 B2C 应用的 client-id。B2C 资源服务器接受该令牌,因为 AAD 颁发者在其受信任集合中,且没有进一步的声明验证能够拒绝跨身份系统令牌。

这是 CVE-2026-33117(AAD 资源服务器)的 B2C 版本。PR #49033 修复了 AAD 路径;B2C 路径直到 PR #49252(合并于 2026-06-02,在 2026 年 7 月安全更新中发布)才被触及。

当 tenant-id=common 时,任何 Entra 租户的令牌都将被接受。

受影响版本:spring-cloud-azure-starter-active-directory-b2c <= 5.19.0。 修复版本:2026 年 7 月安全更新 (PR #49252)。

使用方法

root@kitploit:~
pip install msal requests

# 针对易受攻击的 Spring Boot B2C 资源服务器:
python3 poc.py \
  --target http://localhost:8080/profile \
  --tenant-id <TENANT_ID> \
  --client-id <ATTACKER_APP_CLIENT_ID> \
  --client-secret <ATTACKER_APP_SECRET> \
  --victim-api <B2C_APP_CLIENT_ID>

# 不使用 MSAL(原始 HTTP 令牌请求):
python3 poc.py \
  --target http://localhost:8080/profile \
  --tenant-id <TENANT_ID> \
  --client-id <ATTACKER_APP_CLIENT_ID> \
  --client-secret <ATTACKER_APP_SECRET> \
  --victim-api <B2C_APP_CLIENT_ID> \
  --no-msal

# 详细输出(完整令牌声明和响应):
python3 poc.py ... -v

攻击者应用注册需要:

  • 客户端密钥
  • 针对受害 B2C 应用的客户端 ID(或其作用域)的 API 权限

依赖要求

  • Python 3.8+, msal, requests
  • 一个 Entra ID 租户,其中有一个应用注册(攻击者角色)
  • 一个使用 spring-cloud-azure-starter-active-directory-b2c <= 5.19.0 作为目标的 Spring Boot 应用

文件

文件描述
poc.pyPython PoC:生成 AAD 令牌,发送至 B2C 端点,报告绕过结果
README.md漏洞详情与使用方法
LICENSEGPLv3 许可证

参考资料

  • https://msrc.microsoft.com/update-guide/vulnerability/CVE-2026-50338
  • https://msrc.microsoft.com/update-guide/vulnerability/CVE-2026-33117
  • https://johannes-moeller.dev/blog/cve-2026-50338-spring-cloud-azure-b2c-cross-issuer
  • https://github.com/Azure/azure-sdk-for-java/pull/49252
  • https://github.com/Azure/azure-sdk-for-java/pull/49033

法律声明

本项目按照 GNU GPLv3 许可证发布。

该项目用于防御性安全研究、教育和授权测试。未经所有者明确许可,请勿将此代码用于任何系统或服务。

未经授权使用可能违反适用法律。作者未批准对第三方系统进行测试,且不对滥用行为负责。

有关保证和责任条款,请参阅 LICENSE 文件。

下载工具