HIGH 7.5

CVE-2026-46585: Apache Camel Lucene Query Injection and Authorization Bypass

Apache Camel's Lucene component contains a vulnerability that allows attackers to bypass intended query restrictions and access unauthorized data through HTTP requests. When a Camel route exposes Lucene search functionality via HTTP, an attacker can inject a malicious search query by setting specific HTTP headers, causing the application to execute searches against the full text index that should have been blocked or filtered. This affects Camel versions 4.0.0 through 4.20.x, with no authentication required if the HTTP endpoint is public. The risk ranges from unauthorized document disclosure to resource exhaustion through expensive queries.

Source data · NVD / CISA · public domain

CVSS
3.1 · 7.5 HIGH · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Weaknesses (CWE)
CWE-20, CWE-639
Affected products
1 configuration(s)
Published / Modified
2026-07-06 / 2026-07-08

NVD description (verbatim)

Improper Input Validation, Authorization Bypass Through User-Controlled Key vulnerability in Apache Camel Lucene Component. The camel-lucene producer reads the search phrase from an Exchange header (LuceneConstants.HEADER_QUERY) whose value was the plain string QUERY (and RETURN_LUCENE_DOCS for HEADER_RETURN_LUCENE_DOCS). Because these names do not start with the Camel / camel prefix, HttpHeaderFilterStrategy - which blocks only the Camel header namespace on the HTTP boundary - let them pass from an inbound HTTP request straight into the Exchange. In a route that exposes a Lucene query operation behind an HTTP consumer (for example platform-http), any HTTP client could therefore set the QUERY header and have its value executed against the full-text index, overriding the query the route intended to run. Depending on what is indexed, this allows reading documents the request should not have access to (for example a match-all query returns the entire index, or the route's intended per-user filter can be replaced), and expensive regular-expression queries can consume significant CPU. No credentials are required when the HTTP consumer is unauthenticated. This issue affects Apache Camel: from 4.0.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. After upgrading, routes that set the query via the raw header name must use CamelLuceneQuery (and CamelLuceneReturnLuceneDocs) instead of QUERY / RETURN_LUCENE_DOCS. For deployments that cannot upgrade immediately, strip the attacker-controllable headers before the Lucene producer and set the query from a trusted source (for example removeHeader('QUERY') and removeHeader('RETURN_LUCENE_DOCS'), then setHeader('QUERY', constant(...)) at the start of the route).

2 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

The camel-lucene producer component reads search queries from Exchange headers named QUERY and RETURN_LUCENE_DOCS. Because these header names do not follow Camel's internal naming convention (no 'Camel' or 'camel' prefix), the HttpHeaderFilterStrategy fails to filter them at the HTTP boundary. An HTTP request can therefore directly set these headers, which are passed through to the Lucene producer without validation. In routes where HTTP consumers (such as platform-http) feed directly into Lucene operations, this allows external callers to override the intended query logic. Depending on indexed content and route design, this enables unauthorized document retrieval or causes denial-of-service through expensive regex queries. The vulnerability stems from improper input validation (CWE-20) combined with an authorization bypass mechanism tied to user-controlled keys (CWE-639).

Business impact

Organizations using Apache Camel to expose full-text search capabilities over HTTP face exposure of sensitive indexed data—potentially customer records, internal documents, or confidential information—without authentication or audit. Attackers can extract complete indexes through match-all queries or craft expensive regular-expression searches to degrade performance. For data-heavy deployments, this represents both a confidentiality breach and operational resilience risk. If Lucene indices contain personally identifiable information or regulated data (HIPAA, GDPR), unauthorized access triggers compliance violations and breach notification obligations. The ease of exploitation (no credentials, simple HTTP headers) raises the likelihood of opportunistic attacks.

Affected systems

Apache Camel versions 4.0.0 through 4.14.7, 4.15.0 through 4.18.2, and 4.19.0 through 4.20.x are affected. Specifically, patched versions are 4.14.8 (LTS), 4.18.3, and 4.21.0. Only deployments that combine the camel-lucene producer with an HTTP consumer endpoint are vulnerable; isolated Lucene integrations not exposed via HTTP are unaffected. The vulnerability applies regardless of the HTTP consumer implementation (platform-http, jetty, servlet, etc.) as long as the route path leads from HTTP input to Lucene query execution.

Exploitability

Exploitation requires only network access to the affected HTTP endpoint and knowledge of the internal header names (QUERY and RETURN_LUCENE_DOCS), which are documented in Camel's codebase and easily discoverable. No authentication, special privileges, or user interaction are required. Attack complexity is low: an attacker simply crafts an HTTP request with the malicious header and observes results. Public or internet-facing Camel instances are immediately at risk. The CVSS 3.1 score of 7.5 (High) reflects the high confidentiality impact (documents exposed) and network accessibility, balanced by absence of integrity or availability impact in the base case, though denial-of-service is possible with carefully crafted queries.

Remediation

Upgrade to Apache Camel 4.21.0, 4.18.3, or 4.14.8 depending on your release stream. After upgrading, refactor routes to use the corrected header names: CamelLuceneQuery instead of QUERY, and CamelLuceneReturnLuceneDocs instead of RETURN_LUCENE_DOCS. These prefixed names are properly filtered by HttpHeaderFilterStrategy. Organizations unable to upgrade immediately should implement a workaround: at the start of affected routes, strip the vulnerable headers (removeHeader('QUERY'), removeHeader('RETURN_LUCENE_DOCS')) and set the query from a trusted, non-user-controlled source (e.g., constant values, database lookups, or configuration). Test workarounds to ensure the route still functions correctly.

Patch guidance

Verify the current Apache Camel version in your runtime environment and dependency manifests. For LTS users on 4.14.x, target 4.14.8 or later. For users on 4.15.x through 4.18.x, target 4.18.3 or later. For users on 4.19.x and 4.20.x, target 4.21.0 or later. Review the official Apache Camel release notes to confirm patch availability in your distribution channel (Maven Central, vendor releases, etc.). Schedule testing in a non-production environment first; confirm that any routes using the old header names are updated to use the Camel-prefixed variants. Rolling patches in high-availability deployments should follow your standard change control; no data migration is required.

Detection guidance

Monitor HTTP logs and Camel route traces for inbound requests that set the QUERY or RETURN_LUCENE_DOCS headers. Web Application Firewalls (WAF) can block or flag HTTP headers with those exact names before they reach the application. In Camel itself, enable debug logging on the camel-lucene component to observe which queries are executed and their origins; anomalous queries (particularly match-all patterns, regex-intensive searches, or unexpected user IDs) warrant investigation. If Lucene indices are accessed via audit logging, review for queries executed without corresponding application requests. Correlation of HTTP request headers with Lucene execution logs can reveal header-injection attempts. For threat hunting, search logs for regex patterns in the QUERY header value that correlate with unexpected CPU spikes on the Lucene indexing process.

Why prioritize this

This vulnerability merits immediate patching due to its high CVSS score (7.5), ease of exploitation (network-accessible, no authentication), and direct exposure of potentially sensitive indexed data. The lack of integrity or availability guarantees in the base case is offset by the authentication bypass mechanism, which violates fundamental security principles. Organizations handling regulated data or operating public-facing search services should treat this as critical. However, enterprises running isolated, non-HTTP-exposed Lucene integrations can defer patching with lower risk.

Risk score, explained

The CVSS 3.1 score of 7.5 reflects: Attack Vector Network (AV:N) due to HTTP accessibility, Attack Complexity Low (AC:L) because no special conditions are required, Privileges Required None (PR:N) as no authentication is checked, User Interaction None (UI:N) because the attack is fully automated, Scope Unchanged (S:U) as the vulnerability affects only the Lucene component in isolation, Confidentiality High (C:H) because unauthorized document disclosure is the primary impact, Integrity None (I:N) because the attacker cannot modify indexed documents, and Availability None (A:N) in the base vector, though resource exhaustion is possible in practice. The score correctly captures the severity of data exposure without overstating impact on system integrity or uptime.

Frequently asked questions

Does this vulnerability affect all Camel integrations or only specific use cases?

Only Camel routes that combine an HTTP consumer (platform-http, jetty, servlet, etc.) with the camel-lucene producer are vulnerable. Standalone Lucene integrations not exposed via HTTP, or routes that do not use the camel-lucene component, are unaffected. Check your route definitions to confirm whether Lucene operations are downstream of HTTP endpoints.

If we apply the recommended workaround instead of upgrading, do we need to change our route code?

Yes. The workaround requires adding explicit header stripping and query-setting logic at the start of each affected route. You must remove the vulnerable headers and set the query from a trusted source (constant, config, or database). This should be tested thoroughly. However, you still need to upgrade eventually; the workaround is only a temporary measure to reduce risk during the upgrade window.

Can we detect or block these attacks without code changes?

Yes, partially. A Web Application Firewall (WAF) or API gateway can block HTTP requests that contain the QUERY or RETURN_LUCENE_DOCS headers before they reach Camel. You can also enable Camel route tracing and monitor for unexpected or suspicious queries in the logs. However, this is a compensating control and not a substitute for patching.

What should we do if we cannot upgrade for several months?

Implement the temporary workaround immediately: strip the vulnerable headers and set queries from trusted sources. Monitor HTTP logs and Lucene execution logs for suspicious activity. If possible, restrict HTTP access to the affected endpoints (IP allowlisting, authentication layer, etc.) to reduce the attack surface while you plan your upgrade.

This analysis is based on the official CVE-2026-46585 disclosure and Apache Camel vendor guidance as of the publication date. Security teams should verify patch availability, compatibility, and testing requirements against their specific deployment before applying updates. The technical details, CVSS score, and remediation guidance reflect the vendor advisory; any discrepancies should be escalated to vendor support. This document does not constitute professional security advice or a guarantee of protection; organizations must conduct their own risk assessment and incident response planning. Source: NVD (public-domain), retrieved 2026-08-15. Analysis generated by SEC.co (claude-haiku-4-5).