websocket.* 注入)针对 Apache Camel 漏洞的可运行概念验证复现程序,该漏洞中 UndertowEndpoint 将
headerFilterStrategy 默认为基础 HttpHeaderFilterStrategy,并将该实例推入其创建的 UndertowHttpBinding
中,覆盖了 DefaultUndertowHttpBinding 安装的 UndertowHeaderFilterStrategy。除非
部署提供了自定义绑定或显式的 headerFilterStrategy,否则 undertow 特定的过滤永远不会
运行——策略对象在可被使用之前就被构造并立即替换。
| 运行时 | 目录 | 技术栈 |
|---|---|---|
| Camel Spring Boot | camel-spring-boot/ | Spring Boot 3.5.13 + camel-undertow 4.18.2 |
Camel Quarkus: 不存在
camel-quarkus-undertow扩展(Quarkus 使用自己的 Vert.x HTTP 技术栈),因此 该组件无法在 Camel Quarkus 上运行——此复现程序仅适用于 Spring Boot。
其后果是,遗留的 websocket. Exchange 标头前缀在 undertow 传输边界处不会被过滤,
无论哪个方向。因此,undertow HTTP 消费者会将这种形式的入站线路标头
(websocket.connectionKey、websocket.connectionKey.list、websocket.sendToAll 等)映射到 Exchange 上,而
undertow WebSocket 生产者会将它们作为分发指令读取,从而可能被诱导投递到
路由本意之外的节点——这与 atmosphere-websocket
CVE-2026-71300 属于同一类分发劫持。
此复现程序发送一个携带 websocket.* 分发标头以及 Camel* 控制标头的 HTTP 请求,并
展示实际到达 Exchange 的内容:websocket.* 标头穿过了边界(未过滤),而 Camel*
被剥离——证明是基础过滤器(而非 undertow 过滤器)在生效。
cd camel-spring-boot
mvn clean package
docker compose up -d --build
curl -s http://localhost:8080/exploit/attack
docker compose down
受影响构建上的预期输出:
What actually reached the Exchange, as echoed by the undertow route:
websocket.connectionKey.list on Exchange = [attacker-connection-key]
websocket.sendToAll on Exchange = [true]
CamelFoo on Exchange (control) = []
>>> PROVEN: the undertow endpoint applied the base HttpHeaderFilterStrategy (Camel* filtered) instead of the
>>> UndertowHeaderFilterStrategy, so the legacy websocket.* dispatch headers passed onto the Exchange ...
安全通告:https://camel.apache.org/security/CVE-2026-78329.html
undertow 端点不再覆盖绑定的 UndertowHeaderFilterStrategy,该策略会在两个方向上过滤
websocket. 前缀(在 CAMEL-23588 中添加)——因此分发标头会在传输边界被剥离,
外部发送方无法再注入它们。
本仓库出于教育和防御目的发布:帮助 Apache Camel 用户理解该 漏洞、验证其是否受影响,并确认升级能否解决问题。请勿将本材料用于 不属于您或您无权操作的系统。
| 属性 | 值 |
|---|
| 组件 | camel-undertow (camel-undertow-starter) |
| CWE | CWE-20(输入验证不当)→ CWE-74(注入) |
| 攻击向量 | 通过 undertow HTTP 消费者上的入站 websocket.* 标头,由 undertow WebSocket 生产者作为分发指令读取 |
| 影响 | 接管 WebSocket 生产者的分发决策——向任意 WebSocket 对端投递或拒绝投递 |
| 受影响版本 | 4.11.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-24360 |
| 致谢 | Andrea Cosentino(Apache 软件基金会);Barak Srour(Apiiro) |