CVE-2026-49098: Apache Camel Kafka Header Injection Vulnerability (MEDIUM)
Apache Camel's Kafka component contains a header-injection vulnerability that allows untrusted HTTP clients to redirect Kafka messages to unintended topics. When an HTTP consumer (like platform-http) is chained into a Kafka producer within the same Camel route, attackers can inject kafka.* headers through HTTP requests to override the configured target topic, alter timestamps, or target specific partitions. This is possible because the HTTP header filter only blocks Camel-prefixed headers, allowing kafka.* headers to pass through and reach the Kafka producer unfiltered. No authentication is required if the HTTP endpoint is publicly accessible.
Source data · NVD / CISA · public domain
- CVSS
- 3.1 · 5.3 MEDIUM · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
- Weaknesses (CWE)
- CWE-20, CWE-74
- Affected products
- 1 configuration(s)
- Published / Modified
- 2026-07-06 / 2026-07-08
NVD description (verbatim)
Improper Input Validation, Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') vulnerability in Apache Camel Kafka Component. The camel-kafka producer can override its configured target topic at runtime from the kafka.OVERRIDE_TOPIC Exchange header: KafkaProducer.evaluateTopic() returns the header value in preference to the topic configured on the endpoint. The control-header constants in KafkaConstants (for example OVERRIDE_TOPIC = kafka.OVERRIDE_TOPIC, OVERRIDE_TIMESTAMP = kafka.OVERRIDE_TIMESTAMP, PARTITION_KEY = kafka.PARTITION_KEY) used plain, non-Camel-prefixed values. camel-kafka's own KafkaHeaderFilterStrategy does filter the kafka.* namespace, but only on the Kafka-to-Exchange serialization boundary (reading Kafka record headers into the Exchange, and writing Exchange headers into a Kafka record); it does not apply to headers that arrive from an upstream consumer in a multi-component route. The upstream HTTP consumer uses HttpHeaderFilterStrategy, which blocks only the Camel / camel namespace, so a kafka.* header passes through unfiltered. As a result, in a route that bridges an HTTP consumer (for example platform-http) into a kafka: producer, any HTTP client could set the kafka.OVERRIDE_TOPIC header and cause the message to be published to an arbitrary Kafka topic instead of the configured one - redirecting it to a sensitive internal topic, or injecting attacker-crafted messages into a topic consumed by a critical downstream service. The related kafka.OVERRIDE_TIMESTAMP and kafka.PARTITION_KEY headers could likewise be injected to backdate messages or target specific partitions. No credentials are required when the bridging 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 or read Kafka headers via the raw header names must use the CamelKafka* names (for example CamelKafkaOverrideTopic and CamelKafkaTopic) instead of the old kafka.* values. For deployments that cannot upgrade immediately, strip the kafka.* headers from any untrusted ingress before the kafka: producer (for example removeHeaders('kafka.*') at the start of the route), and set the target topic from a trusted source.
2 reference(s) · View on NVD →
SEC.co analysis · AI-assisted, reviewed against source
Technical summary
The vulnerability stems from inconsistent header-filtering strategies across Camel's bridge components. The camel-kafka producer evaluates runtime topic selection by preferring the kafka.OVERRIDE_TOPIC Exchange header over the configured endpoint topic in KafkaProducer.evaluateTopic(). While KafkaHeaderFilterStrategy filters kafka.* headers at the Kafka serialization boundary, it does not apply to headers arriving from upstream consumers. HttpHeaderFilterStrategy, used by HTTP consumers, only blocks the Camel/camel namespace, leaving kafka.* headers unfiltered. In multi-component routes, this allows kafka.OVERRIDE_TOPIC, kafka.OVERRIDE_TIMESTAMP, and kafka.PARTITION_KEY headers to propagate from the HTTP ingress to the Kafka producer, enabling message redirection, backdating, and partition targeting without credential validation.
Business impact
This vulnerability enables attackers to misdirect critical business messages, inject malicious payloads into downstream systems that consume specific Kafka topics, or corrupt message ordering and timing. Organizations using HTTP-to-Kafka bridging patterns in Camel are at risk of data integrity compromises, operational disruption, and potential compliance violations if sensitive topics are targeted. The low barrier to exploitation (no credentials required, standard HTTP request) increases the practical business risk, especially for internet-facing or multi-tenant deployments.
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 vulnerable. Systems are affected only if they deploy Camel routes that bridge HTTP consumers (platform-http, jetty, servlet) directly into Kafka producers. LTS stream users on 4.14.x and standard stream users on 4.18.x are in scope for targeted patching.
Exploitability
Exploitability is high for affected deployments. No authentication is required; an attacker simply includes a kafka.OVERRIDE_TOPIC header in an HTTP POST or GET request to a bridging route. The attack is trivial to execute with any HTTP client and requires only knowledge of the HTTP endpoint URL and the existence of a downstream Kafka topic name. However, the vulnerability is confined to deployments using the specific HTTP-to-Kafka pattern; standalone Kafka producers or routes without HTTP consumers are unaffected.
Remediation
Upgrade to Apache Camel 4.21.0 (all streams), 4.18.3 (4.18.x stream), or 4.14.8 (4.14.x LTS stream). After upgrading, audit Camel routes for direct references to old kafka.* header names and migrate them to CamelKafka*-prefixed names (e.g., CamelKafkaOverrideTopic). For immediate mitigation pending upgrade, add a removeHeaders('kafka.*') filter at the start of any HTTP-to-Kafka bridging route to strip untrusted kafka.* headers before they reach the producer.
Patch guidance
Apply the version-specific patches: version 4.21.0 for the mainline release, 4.18.3 for the 4.18.x stream, or 4.14.8 for the 4.14.x LTS stream. Verify patch availability and compatibility with your deployment's Java version and other Camel components. After patching, test bridging routes in a staging environment to confirm that any existing kafka.* header usage is migrated to the CamelKafka* namespace; otherwise, routes may fail to read or write headers as expected. Check the Apache Camel release notes for any additional breaking changes in your target version.
Detection guidance
Monitor Camel application logs and metrics for kafka.OVERRIDE_TOPIC, kafka.OVERRIDE_TIMESTAMP, and kafka.PARTITION_KEY headers arriving via HTTP requests. Enable Exchange header tracing on HTTP-to-Kafka routes to capture inbound headers. Look for unexpected topic names appearing in Kafka producer logs or audit trails. Network-level detection is difficult; focus on application-level logging and Kafka broker audit logs to identify message publications to unexpected topics. Compare the configured topic name against the actual destination topic in Kafka broker logs for routes suspected of bridging HTTP and Kafka.
Why prioritize this
Although the CVSS score is MEDIUM (5.3), the practical risk is elevated for affected organizations due to the ease of exploitation, the absence of authentication requirements, and the high impact on message integrity and system confidentiality. Prioritize patching for any internet-facing or multi-tenant Camel deployments that use HTTP-to-Kafka bridging. If patching is delayed, implement the interim header-stripping mitigation immediately.
Risk score, explained
The CVSS 3.1 score of 5.3 reflects low complexity attack vector (network accessible, no authentication, no user interaction), but limited impact scope (confidentiality affected, no integrity or availability impact in the base vector). The score does not fully capture the business risk of message redirection and injection into downstream systems, which may have higher impact depending on the sensitivity of consumed topics and downstream service dependencies. Organizations should apply contextual risk assessment based on the criticality of their Kafka topics and the degree of trust in upstream HTTP clients.
Frequently asked questions
Is this vulnerability exploitable if our Kafka cluster requires authentication?
Yes. The vulnerability exists in the Camel routing layer before messages are published to Kafka. Header injection occurs at the HTTP-to-Exchange boundary and is processed before Kafka authentication is applied. Kafka credentials protect against unauthorized broker access, but they do not prevent an attacker who controls the HTTP request from redirecting authenticated producer messages to unintended topics.
What if we use a different HTTP consumer (e.g., jetty instead of platform-http)?
Any HTTP consumer (jetty, servlet, undertow, etc.) that chains into a Kafka producer is vulnerable if the upstream HTTP header filter does not block kafka.* headers. The vulnerability is a result of the interaction pattern, not the specific HTTP consumer implementation. Verify your HTTP consumer's header filtering strategy in the Camel documentation.
Can we safely use kafka.* headers if we migrate to CamelKafka* names after patching?
Yes. The fix introduces CamelKafka*-prefixed header names that are handled by Camel's internal header filtering strategies and are safe from external injection. Routes should be audited to ensure they use only CamelKafka* names going forward. Old kafka.* header names are still recognized for backward compatibility in some contexts, but they should be replaced to avoid confusion and future issues.
Does the interim mitigation with removeHeaders('kafka.*') have any side effects?
The removeHeaders filter will strip all kafka.* headers before they reach the Kafka producer, effectively blocking both malicious injections and any legitimate kafka.* headers set by upstream components. If your routes intentionally pass kafka.* headers from trusted sources, the interim mitigation will break that flow. In those cases, apply the mitigation only to routes with untrusted HTTP ingress, or upgrade to a patched version before relying on this workaround.
This analysis is based on the CVE description and public Apache Camel advisory information available as of the publication date. Verify all patch version numbers and availability against the official Apache Camel release notes and vendor advisory. The interim mitigation (removeHeaders) should be validated in your environment before production deployment. CVSS scores are provided by NVD and may not reflect your organization's specific risk context; apply internal risk assessment criteria based on your Kafka topology and upstream trust boundaries. Source: NVD (public-domain), retrieved 2026-08-15. Analysis generated by SEC.co (claude-haiku-4-5).
Related vulnerabilities
- CVE-2026-49097MEDIUMApache Camel IRC Header Injection – Message Redirection Vulnerability
- CVE-2026-46453MEDIUMApache Camel Elasticsearch Header Injection Authorization Bypass
- CVE-2026-48206MEDIUMApache Camel JIRA Header Injection – Unauthorized Operations Risk
- CVE-2026-49086MEDIUMApache Camel DAPR Message Routing Vulnerability
- CVE-2026-49099MEDIUMApache Camel Salesforce Header Injection Vulnerability
- CVE-2026-39998HIGHApache APISIX Forward-Auth Identity Spoofing Vulnerability
- CVE-2026-42588HIGHApache ActiveMQ Remote Code Execution via Jolokia Code Injection
- CVE-2026-45505HIGHApache ActiveMQ Code Injection Vulnerability—Exploit & Patch Guidance