
本项目演示 Apache Camel 的 camel-undertow Rest DSL 消费者中的一个信息泄露问题,编号为 CVE-2026-56139。muteException 选项控制是否将未捕获处理异常的详细信息返回给 HTTP 客户端。在普通 undertow 端点上,该选项有效——但 undertow Rest DSL 在创建其响应绑定时将 muteException 硬编码为 false,并且从不复制所配置的值,因此 muteException 在 REST 模式下被静默忽略,完整的 Java 堆栈跟踪仍然会被返回:
// UndertowComponent (affected 4.18.2) — the Rest DSL binding is created without the endpoint's muteException
if (!map.containsKey("undertowHttpBinding")) {
endpoint.setUndertowHttpBinding(new RestUndertowHttpBinding(endpoint.isUseStreaming())); // muteException stays false
}
由于端点的 undertowHttpBinding 现在非空,UndertowEndpoint.getUndertowHttpBinding() 会原样返回该 Rest 绑定,并且永远不会执行将端点 muteException 复制到该绑定上的分支。因此,显式设置 muteException=true 的路由在通过 Rest DSL 提供服务时仍会泄露堆栈跟踪——披露内部后端主机名、数据库 URL、凭据/保险库提示、库版本以及源代码位置。
该 PoC 将影响演示为通过错误消息造成的信息暴露 (CWE-209)。它是 CVE-2026-49365(该漏洞修正了普通 camel-netty-http 和 camel-undertow 端点的 muteException 默认值)在 Rest DSL 方面的对应问题;两者在 CAMEL-23651 中一并修复。
安全公告:https://camel.apache.org/security/CVE-2026-56139.html
修复方案使 Rest DSL 路径将
endpoint.getMuteException()复制到RestUndertowHttpBinding中,因此 Rest DSL 会遵循该设置(以及修正后的默认值true)。
// Both configured with muteException=true (camel.component.undertow.mute-exception=true):
restConfiguration().component("undertow").host("0.0.0.0").port(8888);
rest("/api").get("/orders").to("direct:boom"); // Rest DSL — IGNORES muteException, leaks
from("direct:boom").process(new FailingProcessor());
from("undertow:http://0.0.0.0:8889/plain/orders") // plain endpoint — HONOURS muteException, empty body
.process(new FailingProcessor());
CVE-2026-56139/
├── pom.xml # camel-undertow 4.18.2
├── Dockerfile
├── docker-compose.yml # single self-contained service
├── README.md
└── src/main/
├── java/com/example/
│ ├── Application.java
│ ├── FailingProcessor.java # throws an exception carrying sensitive internal detail
│ ├── RestRoutes.java # undertow Rest DSL (:8888) + plain undertow endpoint (:8889)
│ └── ExploitController.java # attacker: GETs both, shows Rest DSL leaks while plain is muted
└── resources/
└── application.properties # camel.component.undertow.mute-exception=true
mvn clean package -DskipTests
docker compose up -d --build
curl -s http://localhost:8080/exploit/attack
docker compose down
1) undertow Rest DSL :8888 (muteException=true, but the Rest binding hard-codes false)
HTTP 500
response body (NNNN bytes) — LEAKS internal detail:
| java.lang.IllegalStateException: Inventory lookup failed: cannot connect to
| jdbc:postgresql://prod-db.internal:5432/inventory (user=svc_inventory, ...)
| at com.example.FailingProcessor.process(FailingProcessor.java:...)
| ...[truncated]
2) plain undertow endpoint :8889 (same muteException=true — honoured)
HTTP 500
response body: <empty>
>>> Information disclosure: true
升级到 4.14.8 / 4.18.3 / 4.21.0(CAMEL-23651)。升级后,undertow Rest DSL 会遵循 muteException(并将其默认值设为 true),因此不会返回堆栈跟踪。
在升级之前,请添加一个返回通用消息而非堆栈跟踪的 onException(...).handled(true)(或全局错误处理器),并且不要仅依赖 muteException 来保护 undertow Rest DSL 消费者。
本复现工具仅用于安全研究和授权测试,针对的是已公开披露并修复的漏洞。未经明确许可,请勿将其用于任何系统。
| 属性 | 值 |
|---|
| 组件 | camel-undertow(Rest DSL 消费者) |
| 受影响的类 | org.apache.camel.component.undertow.UndertowComponent — 创建 RestUndertowHttpBinding 时未复制 muteException(因此默认为 false) |
| CWE | CWE-209(生成包含敏感信息的错误消息) |
| 影响 | 即使配置了 muteException=true,完整的 Java 堆栈跟踪仍会返回给未认证客户端 |
| 前置条件 | 一个 undertow Rest DSL 消费者;任何触发处理异常的请求 |
| 受影响版本 | 自 4.0.0 起至 4.14.8 之前,自 4.15.0 起至 4.18.3 之前,自 4.19.0 起至 4.21.0 之前 |
| 已修复版本 | 4.14.8, 4.18.3, 4.21.0 |
| JIRA | CAMEL-23651(PR apache/camel#23913) |
| 致谢 | Yu Bao (PayPal) |