针对 Apache Camel 漏洞的可运行概念验证复现程序:配置的
HeaderFilterStrategy 未应用于出站 SOAP 响应,因此在路由过程中设置到
exchange 上的 Camel 内部标头被复制到了返回给远程客户端的 SOAP 响应中。
| 运行时 | 目录 | 技术栈 |
|---|---|---|
| Camel Spring Boot | camel-spring-boot/ | Spring Boot 3.5.13 + camel-spring-ws 4.22.1 |
仅限 Camel Spring Boot。
camel-spring-ws基于 Spring Web Services 构建;不存在camel-quarkus-spring-ws扩展,已对照 Camel Quarkus 3.39.0 源码树及其 BOM 验证。
该路由是一个普通的 SOAP 服务,会累积任何路由都会累积的内部状态,并 返回一个它确实打算返回的标头:
from("spring-ws:rootqname:{http://example.com/demo}GetStatusRequest?endpointMapping=#endpointMapping")
.setHeader("CamelFileName", constant("/var/spool/camel/in/order-8841.xml"))
.setHeader("CamelHttpUri", constant("http://orders.internal:8080/backend/v2/status"))
.setHeader("CamelRedelivered", constant("false"))
.setHeader("CorrelationId", constant("corr-8841")) // this one is meant to go back
.setBody(...);
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
客户端发送一个不带任何自有标头的纯 SOAP 请求,而回复返回时会在其 SOAP 标头中携带该路由的内部状态:
<SOAP-ENV:Header CamelFileName="/var/spool/camel/in/order-8841.xml"
CamelHttpUri="http://orders.internal:8080/backend/v2/status"
CamelRedelivered="false"
CorrelationId="corr-8841"
org.apache.camel.demo.internalAccount="svc-orders"/>
因此,远程客户端可以获知路由所读取文件的本地路径、内部后端 URI,以及路由在交换中遗留的其他任何内容。BasicMessageFilter.doProcessSoapHeader() 将每个交换头复制到出站 SOAP 头中;入站方向已经过过滤,只有响应方向没有。
| 属性 | 值 |
|---|---|
| 组件 | camel-spring-ws(BasicMessageFilter) |
| CWE | 向未授权行为者暴露内部状态 |
| 严重性 | 中 |
| 攻击向量 | 向 spring-ws 消费者发送任意 SOAP 请求,且其路由设置了 Camel 内部头 |
| 影响 | 远程客户端可观察到内部路由状态:本地文件路径、后端 URI、重投递标志 |
| 受影响版本 | 4.0.0 至 4.18.6 之前;4.19.0 至 4.22.2 之前 |
| 修复版本 | 4.18.6、4.22.2、4.23.0 |
| JIRA | CAMEL-25340 |
| 致谢 | Apache Software Foundation 的 Andrea Cosentino |
公告:https://camel.apache.org/security/CVE-2026-103873.html
作为受影响版本上的变通方法,在生成响应之前使用 removeHeaders EIP 可剥离内部头。
将 camel.version 设置为 4.22.2 并再次运行。已针对 4.22.1 -> 4.22.2 验证:
Internal header names found in the response envelope:
- org.apache.camel.demo.internalAccount (org.apache.camel.* namespace, set by this application)
The header the service does mean to return (CorrelationId) is present: true
>>> NOT reproduced: no Camel*/camel* header reached the response.
三个 Camel* 头已消失,而 CorrelationId 仍会返回,因此该修复在不吞掉服务本意要返回的头的情况下,关闭了信息泄露。
org.apache.camel.* 头仍会被返回。 该修复所应用的过滤器是 DefaultHeaderFilterStrategy 的 CAMEL_FILTER_STARTS_WITH,即 {"Camel", "camel"},因此以 org.apache.camel. 开头的名称落在其范围之外——尽管公告将该前缀列为内部命名空间的一部分,而且 Camel 自身的加固指南要求同时剥离 Camel* 和 org.apache.camel.*。
如实界定范围:Camel 自身设置的任何头都不使用该前缀(代码库中的匹配项是类名和一个系统属性),因此这是相对于所声明命名空间的覆盖缺口,而不是 Camel 自身路由状态的持续泄露。它只会影响以这种方式命名自身头的应用程序,正如该路由有意为之,而 removeHeaders("org.apache.camel.*") 处理了这种情况。驱动程序正是出于这一原因单独报告它,而不是将其并入结论。
一个真实的 SOAP 服务:Spring Boot 在 /services 上自动配置的 MessageDispatcherServlet、一个 CamelEndpointMapping,以及上述路由。驱动程序通过 HTTP 发送真实的 SOAP 信封,并原样打印响应,因此信息泄露的观察方式与远程客户端所观察到的一致。
如果你要改编此内容,有两点值得了解。Camel 的 spring-ws 消费者是一个 Spring-WS
MessageEndpoint,因此调度器需要一个MessageEndpointAdapterbean;没有它,每个请求都会返回一个 SOAP 故障,内容为*“No adapter for endpoint”*。而且当响应不是正常的 HTTP 200 时,驱动程序拒绝打印结论——以故障应答的服务无法证明任何一方,而此复现器的早期运行正是从这种状态中报告了一个自信的“未复现”。
本仓库出于教育和防御目的发布:帮助 Apache Camel 用户理解该漏洞、验证自己是否受影响,并确认升级可以解决该问题。请勿将本材料用于你并不拥有或运营的系统。