iss/aud针对 Apache Camel 漏洞的可运行 PoC 复现工具:当未配置 jwtIssuer 或 jwtAudience 时,camel-main 内嵌 HTTP 服务器仅凭密钥库构建其 JWT 认证器,因此入站令牌仅检查签名和过期时间——iss 和 aud 声明从未被校验。
| 运行时 | 目录 | 技术栈 |
|---|---|---|
| Camel Main(独立运行) | camel-main/ | camel-main 4.21.0 + camel-platform-http-main |
为什么选择 camel-main 而不是 Camel Spring Boot / Camel Quarkus? 受影响的类
JWTAuthenticationConfigurer位于camel-platform-http-main中——即 camel-main 内嵌 HTTP 服务器 (MainHttpServer),供独立 camel-main 应用和camel-jbang使用。该服务器不是 Camel Spring Boot 的 platform-http 集成(基于 servlet),也不是 Camel Quarkus 的实现(Quarkus/Vert.x HTTP,带 自己的安全机制),因此对于这个特定缺陷,不存在忠实的 Spring Boot 或 Quarkus 复现方案。本仓库因此提供了一个独立的 camel-main 复现程序,它是该 bug 的准确宿主环境。
cd camel-main
mvn clean package
docker compose up -d --build
curl -s http://localhost:8080/exploit
docker compose down
受影响构建上的预期输出:
[1] GET /protected 无令牌 -> HTTP 401 (已强制认证)
[2] GET /protected 使用令牌 iss=https://attacker.example aud=some-unrelated-service -> HTTP 200 (已接受——iss/aud 未被校验)
[3] GET /protected 使用同一令牌但已过期 -> HTTP 401 (过期时间已检查)
>>> PROVEN: ... iss 和 aud 声明从未被检查 ... : true
公告:https://camel.apache.org/security/CVE-2026-66908.html
从 4.22.0 开始,当配置了 JWT 密钥库但未设置 jwtIssuer 或 jwtAudience 时,服务器拒绝启动,并明确指出缺少的属性。如果运维人员确实只需要签名和过期时间校验,则必须显式设置 camel.server.jwtAllowMissingIssuerAndAudience=true 来选择加入(默认失败关闭):
// fixed (JWTAuthenticationConfigurer.assertIssuerOrAudienceConfigured)
if (ObjectHelper.isEmpty(audience) && ObjectHelper.isEmpty(issuer)) {
throw new IllegalArgumentException(
"JWT authentication requires camel.server.jwtIssuer or camel.server.jwtAudience to be configured, ...");
}
本仓库仅用于教育和防御目的:帮助 Apache Camel 用户了解该漏洞、确认自己是否受影响,并验证升级可以解决该问题。相关令牌是使用项目中捆绑的一次性演示密钥库在本地生成的。请勿将本材料用于您不拥有或无权操作的系统。
| 属性 | 值 |
|---|
| 组件 | camel-platform-http-main(camel-main 内嵌 HTTP 服务器) |
| CWE | CWE-287(身份验证不当)/ CWE-1259(缺少安全声明校验) |
| 攻击向量 | 由受信任密钥(例如共享的 JWKS)签名、但签发给不同 issuer/audience 的 JWT |
| 影响 | 任何持有共享签名密钥的一方签发的未过期令牌都会被接受——部署实际执行的安全策略比运维人员认为的更弱 |
| 受影响版本 | 4.8.0 至 4.22.0 之前 |
| 修复版本 | 4.22.0 |
| JIRA | CAMEL-24281 |
| 致谢 | n0mi1k |