CAMEL-24158: Backport EventHubs HeaderFilterStrategy to 4.18.x - #24886
Conversation
gnodet
left a comment
There was a problem hiding this comment.
Claude Code on behalf of gnodet
Review: APPROVE ✅
Clean backport of the EventHubs HeaderFilterStrategy fix from PR #24884 to camel-4.18.x. I reviewed the original PR in detail — this backport faithfully ports the same security fix.
Changes verified
EventHubsComponent— correctly extendsHeaderFilterStrategyComponentinstead ofDefaultComponent, enabling defaultCamel*header filteringEventHubsConsumer— null-guard onPARTITION_KEYheader prevents null values from overridingPARTITION_IDon round-tripEventHubsProducer→EventHubsProducerOperations— filter strategy is obtained from the component and threaded through to the operations layerEventHubsProducerOperations— headers are now individually filtered viaapplyFilterToCamelHeaders()before being placed onEventDataproperties, preventing internalCamel*/org.apache.camel.*headers from leaking to the AMQP broker- Generated files — configurer and JSON metadata properly regenerated with the new
headerFilterStrategyproperty at index 19 - IT tests — constructor calls updated for the new 3-arg signature (passing
nullsince ITs don't need header filtering)
Minor bonus: the backport also modernizes instanceof checks to use pattern matching (data instanceof Exchange ex), which is fine for 4.18.x (Java 17+).
The security fix is correct and the backport is clean.
🤖 This review was generated by an AI agent (Claude Code) on behalf of gnodet. AI-generated reviews are advisory — human judgment should guide final decisions.
…ent Camel headers leaking to AMQP properties Backport of header filter strategy fix from PR #24884 to 4.18.x. EventHubsComponent now extends HeaderFilterStrategyComponent so that the default DefaultHeaderFilterStrategy filters out Camel-internal headers before they are put on EventData application properties. Also guards against setting a null PARTITION_KEY header on the consumer side. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
6b93ef2 to
ea14d7e
Compare
gnodet
left a comment
There was a problem hiding this comment.
Claude Code on behalf of gnodet
Follow-up review — rebased commit (ea14d7e) ✅
The PR was rebased to include proper catalog and component DSL regeneration:
azure-eventhubs.jsoncatalog —headerFilterStrategyproperty added at index 19AzureEventhubsComponentBuilderFactory.java— DSL builder method andsetPropertyOnComponentcase added
Source code is unchanged from the original review. These generated files complete the backport properly. Approval still stands.
🤖 This review was generated by an AI agent (Claude Code) on behalf of gnodet. AI-generated reviews are advisory — human judgment should guide final decisions.
Summary
Claude Code on behalf of davsclaus
Backport of the EventHubs header filter strategy fix from PR #24884 to the
camel-4.18.xmaintenance branch (CVE-related).Problem:
EventHubsProducerOperationscopies ALL Camel exchange headers (including internalCamel*headers) into AMQP application properties viaeventData.getProperties().putAll(headers). This leaks Camel-internal headers to the Azure Event Hubs broker.Fix:
EventHubsComponentnow extendsHeaderFilterStrategyComponentinstead ofDefaultComponent, enabling the defaultDefaultHeaderFilterStrategywhich filters outCamel*andorg.apache.camel.*headersHeaderFilterStrategytoEventHubsProducerOperations, which applies it before putting headers onEventDataPARTITION_KEYheader when the value is non-null (prevents null header from conflicting withPARTITION_IDon round-trip)Test plan
camel-azure-eventhubsmodule builds and compiles🤖 Generated with Claude Code
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com