Skip to content

[backport camel-4.18.x] CAMEL-24417: camel-as2 - validate the asynchronous MDN delivery address and scope the MDN credentials - #25764

Merged
oscerd merged 1 commit into
apache:camel-4.18.xfrom
oscerd:backport/25637-to-camel-4.18.x
Aug 27, 2026
Merged

[backport camel-4.18.x] CAMEL-24417: camel-as2 - validate the asynchronous MDN delivery address and scope the MDN credentials#25764
oscerd merged 1 commit into
apache:camel-4.18.xfrom
oscerd:backport/25637-to-camel-4.18.x

Conversation

@oscerd

@oscerd oscerd commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Backport of #25637

Cherry-pick of #25637 onto camel-4.18.x.

Original PR: #25637
Original author: @oscerd

Resolution notes: the 4.23 upgrade-guide entry is dropped (guides for all lines live on main). On 4.18.x the HttpCore API differs, so httpContext.setRequest(request) is kept as setAttribute(HttpCoreContext.HTTP_REQUEST, request). The four auth tests each mixed this change with an unrelated main-only dynamic-port change; the allow-list part is taken and the branch's TARGET_PORT constant kept. Generated files were regenerated by a full reactor build.

Verified: cherry-pick applied with the conflicts resolved as above, and the branch builds on camel-4.18.x.

Claude Code on behalf of oscerd

…ss and scope the MDN credentials

The delivery address for an asynchronous MDN comes from the Receipt-Delivery-Option
header of the received AS2 message, so it is chosen by the sender. The server passed it
straight to a socket and attached the configured MDN credentials to whatever host it
named, with no scheme check.

A new asyncMdnAllowedHosts option names the hosts an asynchronous MDN may be delivered
to. Credentials are attached only for a host on the list, and an address naming a host
outside it is refused. With the option unset the MDN is still delivered, as before, but
no credentials are attached.

Independently of the option the scheme must now be http. https is refused rather than
attempted: this class delivers over a plain socket and has no TLS, so an https address
wrote the request - including the Authorization header - in cleartext to the TLS port.
IPv6 hosts are unbracketed before the allow-list match.

Public API stays source and binary compatible; the previous constructors delegate. Real
TLS delivery via SSLContextParameters is tracked as CAMEL-24474.

Closes apache#25637

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
@oscerd oscerd added the backport indicate that a Pull request is a backport from a fix from the main branch label Aug 26, 2026
@oscerd oscerd added this to the 4.23.0 milestone Aug 26, 2026

@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.

Backport of #25637 (CAMEL-24417) onto camel-4.18.x. The security fix adds MDN delivery address validation and credential scoping for the AS2 component.

The conflict resolution is well-documented: HttpCore API differences on 4.18.x (e.g. httpContext.setAttribute vs setRequest) are handled correctly, and the upgrade guide entry is properly dropped. The new asyncMdnAllowedHosts parameter and generated catalog changes are consistent.

CI green on JDK 17 and 21.

AI-generated review on behalf of Guillaume Nodet. Feedback? Let us know!

@oscerd oscerd added the bug Something isn't working label Aug 27, 2026
@oscerd oscerd self-assigned this Aug 27, 2026
@oscerd oscerd modified the milestones: 4.23.0, 4.18.5 Aug 27, 2026
@oscerd
oscerd merged commit 64459b6 into apache:camel-4.18.x Aug 27, 2026
3 checks passed
@oscerd
oscerd deleted the backport/25637-to-camel-4.18.x branch August 27, 2026 04:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport indicate that a Pull request is a backport from a fix from the main branch bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants