🇰🇷 한글 설명
Apache Camel의 camel-elasticsearch-rest-client 컴포넌트가 사용하는 Exchange 헤더 이름(SEARCH_QUERY, OPERATION, INDEX_NAME, INDEX_SETTINGS, ID)에 'Camel' 접두사가 없어 인바운드 HTTP 헤더 필터를 통과합니다. 이로 인해 외부 HTTP 클라이언트가 이 헤더를 조작해 쿼리와 작업을 변경할 수 있습니다.
💡 쉬운 설명
외부 사용자가 HTTP 요청에 특정 헤더를 추가하면 Elasticsearch 검색 조건이나 작업 종류를 임의로 바꿀 수 있습니다. 그 결과 인덱스의 데이터를 모두 읽거나 삭제될 수 있습니다.
🇺🇸 원문 (English)
Improper Input Validation, Authorization Bypass Through User-Controlled Key vulnerability in Apache Camel ElasticSearch Rest Client.
The camel-elasticsearch-rest-client component reads several Exchange headers to control its behaviour - SEARCH_QUERY (an advanced query body), OPERATION (which Elasticsearch operation to run), INDEX_NAME, INDEX_SETTINGS and ID. The string values of these header constants, defined in ElasticSearchRestClientConstant, are plain unprefixed names ('SEARCH_QUERY', 'OPERATION', 'INDEX_NAME', 'INDEX_SETTINGS', 'ID') rather than the 'Camel'-prefixed names used by every other Camel component (for example CamelSqlQuery, CamelMongoDbCriteria, CamelCqlQuery). Camel's inbound HTTP header filter, HttpHeaderFilterStrategy, blocks only header names that begin with 'Camel' or 'camel'. Because the Elasticsearch header names do not carry that prefix, they pass through the inbound filter unchanged. When a Camel route exposes an HTTP entry point (for example platform-http) in front of an elasticsearch-rest-client producer, an untrusted HTTP client can set these headers directly on its request and override the query and operation that the route author configured: reading every document in the index (SEARCH_QUERY with a match_all query), deleting documents (OPERATION set to Delete together with ID), or exfiltrating selected fields. No credentials are required and the producer reads the headers unconditionally.
This issue affects Apache Camel: from 4.3.0 before 4.14.8, from 4.15.0 before 4.18.3, from 4.19.0 before 4.21.0.
Users are recommended to upgrade to version 4.21.0, which fixes the issue. If users are on the 4.14.x LTS releases stream, then they are suggested to upgrade to 4.14.8. If users are on the 4.18.x releases stream, then they are suggested to upgrade to 4.18.3. The fix renames the camel-elasticsearch-rest-client Exchange header constant string values (ID, SEARCH_QUERY, INDEX_SETTINGS, INDEX_NAME, OPERATION) to carry the Camel prefix (CamelElasticsearchId, CamelElasticsearchSearchQuery, CamelElasticsearchIndexSettings, CamelElasticsearchIndexName, CamelElasticsearchOperation) so that they are blocked by the inbound HttpHeaderFilterStrategy; the Java field names are unchanged. For deployments that cannot upgrade immediately, strip the affected headers from untrusted inbound messages before they reach the producer (for example removeHeader('SEARCH_QUERY'), removeHeader('OPERATION'), removeHeader('INDEX_NAME'), removeHeader('INDEX_SETTINGS') and removeHeader('ID') in front of the elasticsearch-rest-client endpoint), or apply a custom HeaderFilterStrategy that blocks these names.
📍 영향받는 시스템
Apache Camel 4.3.0~4.14.8 미만, 4.15.0~4.18.3 미만, 4.19.0~4.21.0 미만의 camel-elasticsearch-rest-client를 사용하는 환경
⚔️ 공격 벡터
HTTP 엔드포인트(예: platform-http)로 SEARCH_QUERY, OPERATION, ID 등의 헤더를 포함한 요청을 보내 검색 또는 삭제 동작을 조작
🛡️ 대응 방법
Apache Camel 4.21.0, 4.14.8 또는 4.18.3 이상으로 업그레이드하거나, 엔드포인트 앞에서 해당 헤더를 removeHeader로 제거
🔧 검증 코드
출력된 JAR 파일 이름의 버전이 4.14.8, 4.18.3, 4.21.0 중 해당 스트림의 수정 버전 이상이면 취약하지 않고, 그보다 낮으면 취약합니다.
find / -name 'camel-elasticsearch-rest-client*.jar' 2>/dev/null | xargs -I{} sh -c 'echo {}; unzip -p {} META-INF/MANIFEST.MF 2>/dev/null | grep -i version'