针对 Apache Camel 漏洞的可运行概念验证复现程序。在该漏洞中,PGP 数据格式的 unmarshal() 仅在消息使用 OpenPGP 对称加密完整性保护数据包时才验证修改检测码。较旧的对称加密数据包不携带此类代码,而 OpenPGP 的 CFB 模式在没有该代码时是可延展的,因此使用该旧版数据包的消息完全跳过了完整性检查。由于数据包类型由生成消息的一方选择,发送方——或任何能在传输途中改写消息的人——决定了完整性检查是否适用。现有的 integrity 选项仅控制编组(marshalling),且没有解密侧的对应选项,因此部署方无法要求对其接受的消息进行完整性保护。
| 运行时 | 目录 | 技术栈 |
|---|---|---|
| Camel Spring Boot | camel-spring-boot/ | Spring Boot 3.5.13 + camel-crypto-pgp 4.22.0(受影响;修复版本 4.22.1) |
| Camel Quarkus | camel-quarkus/ | Quarkus 3.29.0 + camel-quarkus-crypto-pgp(Camel 4.15.0,受影响;修复对照 CQ 3.40.0 / Camel 4.22.1) |
两个模块均演示了受影响以及修复后的行为。
漏洞利用驱动程序扮演发送方(或中间人),通过使用 integrity=false 进行加密来生成带有旧版数据包的 PGP 消息——生成的密文不携带修改检测码。随后它将该消息送入一条使用密钥对其进行解密的路线。
BENIGN-PGP-PAYLOAD-MARKER-5E1F)——由于发送方选择了旧版数据包,完整性检查被完全跳过。部署方接受了其无法验证的密文。PGPException 拒绝该消息——“PGP message is not integrity protected…”——因为新的 requireIntegrityProtection 选项默认为 true。密钥环(pubring.gpg、secring.gpg,用户 ID 和密码均为 sdude)是来自 Apache Camel 自身 camel-crypto-pgp 测试的公开 RSA-2048 测试夹具——惰性材料,随附打包以使往返流程自包含。
# Camel Spring Boot
cd camel-spring-boot
mvn clean package
docker compose up -d --build
curl -s http://localhost:8080/exploit/attack # affected: legacy message decrypts; >>> PROVEN
docker compose down
# Patched control
mvn clean package -Dcamel.version=4.22.1
java -jar target/cve-2026-85243-crypto-pgp-integrity-downgrade-0.0.1-SNAPSHOT.jar &
curl -s http://localhost:8080/exploit/attack # fixed: rejected "not integrity protected"; >>> Not exploited
# Camel Quarkus
cd camel-quarkus
mvn clean package
docker compose up -d --build
curl -s http://localhost:8080/exploit/attack # affected (Camel 4.15.0): legacy message decrypts
docker compose down
# Patched control: CQ 3.40.0 ships Camel 4.22.1
mvn clean package -Dcamel-quarkus.version=3.40.0 -Dquarkus.platform.version=3.40.0
java -jar target/quarkus-app/quarkus-run.jar &
curl -s http://localhost:8080/exploit/attack # fixed: rejected "not integrity protected"
| 属性 | 值 |
|---|---|
| 组件 | camel-crypto-pgp (PGPKeyAccessDataFormat.unmarshal) |
| CWE | CWE-354(完整性校验值验证不当) |
| 严重程度 | 中危 |
| 攻击向量 | 使用旧版对称加密数据包(无修改检测代码)生成的消息 |
| 影响 | 完整性验证降级:由发送方/中间方决定是否执行完整性检查;可被篡改的密文在未经校验的情况下被接受 |
| 受影响版本 | 从 4.0.0 起至 4.18.5 之前,从 4.19.0 起至 4.22.1 之前 |
| 修复版本 | 4.18.5、4.22.1、4.23.0 |
| JIRA | CAMEL-24441 |
| 致谢 | Claude Security Scan Tool |
公告:https://camel.apache.org/security/CVE-2026-85243.html
PGPKeyAccessDataFormat.unmarshal 新增了 requireIntegrityProtection
选项(默认值为 true)。当消息不是受完整性保护的数据包且该选项已启用时,unmarshal
现在会抛出 PGPException("PGP message is not integrity protected…"),而不是对其进行解密。请注意,
signatureVerificationOption 的默认值仍为 optional,因此不携带签名的消息仍会被接受;正是这两个选项共同作用,才使解密后的消息具备真实性,而不仅仅是机密性。仅当需要与仍发送旧版数据包的发送方互操作时,才应将
requireIntegrityProtection=false,并将解密后的内容视为未经认证。
在消息到达数据格式之前,拒绝不使用完整性保护数据包的消息(例如,在 unmarshal 之前的处理器中检查
OpenPGP 数据包头)。
本仓库出于教育和防御目的发布:帮助 Apache Camel 用户理解该 漏洞、验证自身是否受影响,并确认升级可解决该问题。密钥环和明文均为无实际作用的公开测试样本。请勿将本材料用于您不拥有或不运营的系统。