Class AddressingResponseEndpointPolicy
wsa:ReplyTo or wsa:FaultTo endpoint
reference taken off an inbound message may be used as the destination of a
server-initiated send.
A non-anonymous response endpoint is a spec-defined WS-Addressing feature — the SOAP binding says a response SHOULD be delivered to it — but the same specification's security considerations put the burden of deciding whether to honour one on the receiver, noting that "great care should be taken before honoring a [reply endpoint] or [fault endpoint] to avoid inadvertent participation in the activities of malicious SOAP message senders". Where WS-Security is not engaged to bind the EPR to a trusted issuer, an anonymous caller otherwise chooses the address the server connects to.
Three parameters control this, resolved through the usual Axis2 chain
(service, service group, then axis2.xml):
allowNonAnonymousResponseEndpoints(defaultfalse)- Off by default, so replies and faults only ever travel back down the
inbound connection and an inbound header cannot name an outbound destination
at all. Apache CXF made the same call for the same reason in its
org.apache.cxf.ws.addressing.decoupled.enabledproperty. Set it totruefor a deployment that genuinely uses decoupled responses — the separate-listener ("Dual") clients, or a third-party callback endpoint. blockPrivateNetworkResponseEndpoints(defaultfalse)- Additionally rejects response endpoints that resolve to loopback,
site-local/RFC-1918, IPv6 unique-local or carrier-grade-NAT addresses. This is
off by default because a callback endpoint inside the same private network is
how most real decoupled deployments are wired, and refusing it would break
them; turn it on wherever the caller is not already inside the trusted
network. Link-local, wildcard and multicast destinations are refused
regardless — see
resolvesToRestrictedAddress(java.lang.String, boolean, long). allowedResponseEndpointHosts(no default)- A comma-separated host allow-list. When set, a response endpoint host must appear in it, which supersedes the network-range check.
allowedResponseEndpointSchemes(defaulthttps)- A comma-separated scheme allow-list, applied once decoupled responses are
enabled at all. See
DEFAULT_ALLOWED_SCHEMESfor why the default is HTTPS alone.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisAllowed(EndpointReference epr, MessageContext messageContext) Whether the server may send to this response endpoint.static booleanisDecoupledResponse(MessageContext messageContext) Whether this send is a WS-Addressing decoupled response: a server-side send to a destination the caller named, rather than an ordinary client-side request.static voidshutdown()Stop the resolver pool.
-
Field Details
-
ALLOW_NON_ANONYMOUS
- See Also:
-
BLOCK_PRIVATE_NETWORKS
- See Also:
-
ALLOWED_HOSTS
- See Also:
-
ALLOWED_SCHEMES_PARAMETER
- See Also:
-
RESOLVE_TIMEOUT
- See Also:
-
-
Method Details
-
isAllowed
Whether the server may send to this response endpoint.Anonymous and null endpoints are always permitted: they mean "reply on the inbound connection" and drive no outbound connection at all.
- Parameters:
epr- the ReplyTo or FaultTo taken from the inbound messagemessageContext- the inbound message, for parameter resolution- Returns:
- true if the endpoint may be used as a send destination
-
shutdown
public static void shutdown()Stop the resolver pool. Called from the addressing module's shutdown so the threads do not outlive the configuration that created them. -
isDecoupledResponse
Whether this send is a WS-Addressing decoupled response: a server-side send to a destination the caller named, rather than an ordinary client-side request.Transports use this to decide whether to follow redirects. The scheme allow-list and the address checks in
isAllowed(org.apache.axis2.addressing.EndpointReference, org.apache.axis2.context.MessageContext)run against the endpoint reference the caller supplied, and nothing re-examines where a redirect leads, so following one steps straight past them: a 307 from the caller's own endpoint to an address this policy had already refused would be honoured. A decoupled reply is fire-and-forget, so nothing legitimate depends on following a redirect.- Parameters:
messageContext- the message being sent; may benull- Returns:
- whether the destination was nominated by the caller
-