针对 Apache Camel 漏洞的可运行概念验证复现程序,该漏洞中 VertxPlatformHttpServerSupport. createCorsHandler() 在来源检查之外设置了 Access-Control-Allow-Credentials: true —— 因此它会在
对携带 Origin 头的请求的每个响应中发出,包括对处理器刚刚决定不予允许的来源的响应。当
camel.server.cors.origins 未设置时,处理器将所有来源视为允许,并将调用方自己的 Origin 回显为
Access-Control-Allow-Origin。两者结合便产生了 fetch 规范拒绝以字面通配符表达的带凭据的任意来源
配置 —— 这正是反射来源成为绕过该规则常用手段的原因。因此,任意来源上的页面都可以向
Camel 端点发起带凭据的跨源请求并读取响应。
| 运行时 | 目录 | 技术栈 |
|---|---|---|
| Camel Spring Boot | camel-spring-boot/ | Spring Boot 3.5.13 + camel-platform-http-vertx 4.22.0(受影响;修复于 4.22.1) |
Camel Quarkus: 不适用。存在漏洞的处理器位于 Camel 自有的独立 Vert.x platform-http 服务器 (
camel-platform-http-vertx)中。在 Camel Quarkus 上,platform-http由 Quarkus HTTP 服务器提供,CORS 由 Quarkus(quarkus.http.cors.*)处理,而非由createCorsHandler()处理,因此该特定缺陷在那里不可达。 (也不存在camel-platform-http-vertx-starter;Spring Boot 模块使用普通的camel-platform-http-vertx构件,它运行自己的 Vert.x 服务器,独立于 Spring Boot Web 服务器。)
应用在端口 8081 上启动 Camel 的 Vert.x platform-http 服务器,启用 CORS 且未配置任何来源,并
配置路由 platform-http:/api。攻击者发送 GET /api,携带 Origin: https://evil.example(一个从未
被加入允许列表的来源)并检查响应:
Access-Control-Allow-Origin: https://evil.example(反射)以及
Access-Control-Allow-Credentials: true。Access-Control-Allow-Credentials。cd camel-spring-boot
mvn clean package
docker compose up -d --build
curl -s http://localhost:8080/exploit/attack
docker compose down
受影响构建上的预期输出:
Response CORS headers:
Access-Control-Allow-Origin = https://evil.example
Access-Control-Allow-Credentials = true
>>> PROVEN: the endpoint echoes the attacker's Origin ... and sends Access-Control-Allow-Credentials: true ...
| 属性 | 值 |
|---|---|
| 组件 | camel-platform-http-vertx |
| CWE | CWE-942(对不可信域名的宽松跨域策略) |
| 严重程度 | 中危 |
| 攻击向量 | 携带 Origin 头的跨源(带凭据)请求,发送至启用了 CORS 且未配置来源的 platform-http-vertx 端点 |
| 影响 | 任意来源均可发起带凭据的跨源请求并读取响应 |
| 受影响版本 | 从 4.0.0 起至 4.18.5 之前,从 4.19.0 起至 4.22.1 之前 |
| 修复版本 | 4.18.5、4.22.1、4.23.0 |
| JIRA | CAMEL-24436 |
| 致谢 | Claude Security Scan Tool |
公告:https://camel.apache.org/security/CVE-2026-84176.html
不再对每个来源无条件发送 Access-Control-Allow-Credentials: true;对于未被明确允许的来源,不会授予凭据,因此“反射来源加凭据”(“带凭据的任意来源”)的组合不再出现。
设置显式的 camel.server.cors.origins 允许列表,并且不要依赖来自任意来源的带凭据跨源访问;将端点置于强制执行正确 CORS 策略的代理之后。
本仓库的发布仅用于教育和防御目的:帮助 Apache Camel 用户理解该漏洞、验证自身是否受影响,并确认升级可解决该问题。请勿将本材料用于您不拥有或运营的系统。