针对 Apache Camel 漏洞的可运行概念验证复现程序,其中 camel-atmosphere-websocket producer 从名称位于 Camel 命名空间之外的 websocket.* Exchange 头中选择其 WebSocket 收件人 — 因此 HTTP HeaderFilterStrategy(只剥离 Camel* / camel*)会放行这些头,外部发送者便能够接管 producer 的调度决策。
| Runtime | Directory | Stack |
|---|---|---|
| Camel Spring Boot | camel-spring-boot/ | Spring Boot 3.5.13 + camel-atmosphere-websocket 4.18.2 |
Camel Quarkus: 不存在
camel-quarkus-atmosphere-websocket扩展,因此该组件无法在 Camel Quarkus 上运行 — 该复现程序仅支持 Spring Boot。
一条路由将 HTTP consumer 桥接到 atmosphere-websocket producer,通过自行设置 websocket.connectionKey 头,将每条 HTTP 消息投递给一个固定的 WebSocket 收件人(即“受害者”)。但 WebsocketProducer.process 在单键头之前先测试列表头 websocket.connectionKey.list,而该带点名称不在 Camel 命名空间中,因此 HTTP 头过滤器不会剥离它。于是,注入的 websocket.connectionKey.list 头会从请求传入 Exchange 并覆盖固定的收件人 — 本应发送给受害者的消息转而投递到攻击者选择的连接。
POST /notify ──► setHeader(websocket.connectionKey = victim) ──► atmosphere-websocket producer ──► victim peer
│ ▲
└─ injected header websocket.connectionKey.list: <attacker key> ───────┘ (tested first → wins)
关于测试平台。 atmosphere WebSocket 运行时需要 servlet 容器的 WebSocket 升级以及框架自身的初始化,这些无法由普通的独立 Spring Boot 应用驱动。因此,本复现程序通过真实的 HTTP 入口来运行真正的
WebsocketProducer调度逻辑 — 只有两个连接的对端是直接注册到端点WebSocketStore中的替身(就像 atmosphere 框架注册真实浏览器连接那样)。头过滤器绕过和 producer 的调度优先级 — 即实际漏洞 — 均被真实地验证。
cd camel-spring-boot
mvn clean package
docker compose up -d --build
curl -s http://localhost:8080/exploit/attack
docker compose down
受影响构建的预期输出:
1) Benign POST /notify (no injected header):
victim received: [hello for the victim]
attacker received: []
2) Injected POST /notify with header 'websocket.connectionKey.list: attacker-connection-key':
victim received: []
attacker received: [private data meant for the victim, ...]
>>> PROVEN: ... delivering a message meant for the victim to an attacker-chosen WebSocket connection instead: true
公告:https://camel.apache.org/security/CVE-2026-71300.html
调度头常量已被重命名到 Camel 命名空间中 — CamelAtmosphereWebsocketConnectionKey、CamelAtmosphereWebsocketConnectionKeyList、CamelAtmosphereWebsocketSendToAll — 这样 HTTP HeaderFilterStrategy 会在传输边界剥离它们,外部发送者便无法再注入。相关的 camel-undertow websocket 路径由 CVE-2026-78329 覆盖。
本仓库仅出于教育和防御目的发布:帮助 Apache Camel 用户了解该漏洞、验证其是否受影响,并确认升级能够解决该问题。请勿将本材料用于针对你不拥有或无权操作的系统。
| 属性 | 值 |
|---|
| 组件 | camel-atmosphere-websocket (camel-atmosphere-websocket-starter) |
| CWE | CWE-20(输入验证不当)→ CWE-74(注入) |
| 攻击向量 | 在桥接到 atmosphere-websocket producer 的请求上注入 websocket.connectionKey.list(或 websocket.connectionKey / websocket.sendToAll)头 |
| 影响 | 接管 producer 的调度决策 — 向任意 WebSocket 对端投递 / 扣留消息 |
| 受影响版本 | 4.0.0 至 4.14.9 之前,4.15.0 至 4.18.4 之前,4.19.0 至 4.22.0 之前 |
| 修复版本 | 4.14.9、4.18.4、4.22.0 |
| JIRA | CAMEL-24359 |
| 发现者 | Barak Srour (Apiiro) |