Skip to content

CAMEL-24085: Apply header filter strategy to IronMQ message envelope headers (4.18.x backport)#24905

Merged
davsclaus merged 1 commit into
apache:camel-4.18.xfrom
oscerd:backport-4.18.x-CAMEL-24085
Jul 19, 2026
Merged

CAMEL-24085: Apply header filter strategy to IronMQ message envelope headers (4.18.x backport)#24905
davsclaus merged 1 commit into
apache:camel-4.18.xfrom
oscerd:backport-4.18.x-CAMEL-24085

Conversation

@oscerd

@oscerd oscerd commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Backport of #24828 (merged on main, CAMEL-24085) to camel-4.18.x.

Branch adaptations, mirroring the CAMEL-24084 knative backport (#24753):

  • DefaultHeaderFilterStrategy on this branch does not filter Camel* inbound by default (pre-CAMEL-23543), so the strategy sets setInFilterStartsWith(CAMEL_FILTER_STARTS_WITH) explicitly. The new IronMQConsumerHeaderFilterTest passes on this branch, verifying the filter is effective.
  • Test support import switched to org.apache.camel.test.junit5 (this branch is not on junit6).
  • No upgrade-guide change here: per convention the 4.18.4 entry is added to camel-4x-upgrade-guide-4_18.adoc on main via a doc-sync PR.

Testing: mvn clean install in components/camel-ironmq (all tests pass, including the new filter test); full reactor mvn clean install -DskipTests from the branch root: success, no stale generated files.

Claude Code on behalf of Andrea Cosentino (@oscerd).

🤖 Generated with Claude Code

…headers (4.18.x backport)

The IronMQ consumer deserializes a JSON envelope (a headers map and a body)
and copied the embedded header entries onto the Camel message without
applying a HeaderFilterStrategy. Route the envelope headers through a
HeaderFilterStrategy so Camel* headers (matched case-insensitively) present
in the sender-controlled envelope are filtered, consistent with the inbound
header filtering performed by other consumers.

Backport to camel-4.18.x: the strategy sets
setInFilterStartsWith(CAMEL_FILTER_STARTS_WITH) explicitly, since
DefaultHeaderFilterStrategy on this branch does not filter Camel* inbound by
default. Test support uses junit5 on this branch.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Andrea Cosentino <ancosen@gmail.com>
@oscerd oscerd added the enhancement New feature or request label Jul 19, 2026
@oscerd
oscerd requested review from davsclaus and gnodet July 19, 2026 12:09

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: CAMEL-24085 — IronMQ header filter strategy (4.18.x backport)

Clean backport of #24828 (merged on main). Applies a `HeaderFilterStrategy` to IronMQ message envelope headers to prevent header-injection attacks (CVE-2025-27636 family).

What works well

  1. Correct security fix — Filters `Camel*`/`camel*` headers from untrusted IronMQ message envelopes before they reach the Camel exchange, preventing injection of internal headers like `CamelFileName` (path traversal) or `camelExecCommandExecutable` (command injection).

  2. Branch-appropriate adaptation — On `camel-4.18.x`, `DefaultHeaderFilterStrategy` does not filter `Camel*` inbound by default (pre-CAMEL-23543), so the backport explicitly sets `setInFilterStartsWith(CAMEL_FILTER_STARTS_WITH)`. This is the correct approach for this branch.

  3. Static strategy — The `HeaderFilterStrategy` is created once as a static field, avoiding per-message allocation overhead. Thread-safe since `DefaultHeaderFilterStrategy` is immutable after configuration.

  4. Good test — Verifies both `CamelFileName` (PascalCase) and `camelExecCommandExecutable` (camelCase) are filtered while regular headers (`MyHeader`) and IronMQ-specific headers (`MESSAGE_ID`) are preserved.

  5. Test correctly uses `junit5` for this branch (not junit6).

No issues found. Straightforward security backport.


Claude Code on behalf of gnodet — AI-generated review

@davsclaus davsclaus added this to the 4.18.4 milestone Jul 19, 2026
@davsclaus
davsclaus merged commit d6eab8b into apache:camel-4.18.x Jul 19, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants