davsclaus commented on code in PR #27719:
URL: https://github.com/apache/camel/pull/27719#discussion_r4251270063


##########
components/camel-lra/src/main/java/org/apache/camel/service/lra/LRASagaRoutes.java:
##########
@@ -106,13 +107,19 @@ private void verifyCompletionRequest(Exchange exchange) {
 
     /**
      * Check if the request is pointing to an allowed URI to prevent 
unauthorized remote uri invocation. Validates only
-     * the URI relevant to the callback type against the corresponding 
allowlist.
+     * the URI relevant to the callback type against the corresponding 
allowlist. When a callback secret is configured,
+     * the signature of the called URL is verified first.
      */
     private void verifyRequest(Exchange exchange, boolean isCompensation) {
         if (exchange.getIn().getHeader(Exchange.SAGA_LONG_RUNNING_ACTION) == 
null) {
             throw new IllegalArgumentException("Missing " + 
Exchange.SAGA_LONG_RUNNING_ACTION + " header in received request");
         }
 
+        LRACallbackSigner signer = sagaService.getCallbackSigner();
+        if (signer != null && !applySignedParameters(exchange, signer, 
isCompensation)) {

Review Comment:
   Small one: after a valid signature, a step without compensation and 
completion URIs still reaches the CAMEL-17751 fallback below, which parses 
`CamelHttpQuery` again. With camel-netty-http that header is the decoded query, 
so a signed option value containing an encoded `&` can turn into a 
`Camel-Saga-Compensate`/`Camel-Saga-Complete` parameter there (still limited to 
the registered URIs). As the signed parameters are authoritative in this mode, 
skipping the fallback when `signer != null` would keep the "only signed values" 
guarantee, e.g. returning right after `applySignedParameters` succeeds and 
going straight to the allowlist check.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to