gnodet commented on code in PR #25846:
URL: https://github.com/apache/camel/pull/25846#discussion_r3890732052
##########
components/camel-exec/src/main/docs/exec-component.adoc:
##########
@@ -48,6 +48,47 @@ include::partial$component-endpoint-headers.adoc[]
== Usage
+=== Control headers
+
+Since Camel 4.20, the exec in-headers that override URI options
(`CamelExecCommand*`,
+`CamelExecExitValues`, and `CamelExecUseStderrOnEmptyStdout`) are disabled by
default. This prevents untrusted message sources from redirecting
+command execution. To use dynamic executable, arguments, working directory, or
+other command settings from headers, enable the opt-in flag on the endpoint or
+component:
+
+[tabs]
+====
+Java::
++
+[source,java]
+----
+from("direct:run")
+ .setHeader("CamelExecCommandArgs", constant("ARGS-WORK"))
+ .to("exec:echo?allowControlHeaders=true");
+----
+
+YAML::
++
+[source,yaml]
+----
+- route:
+ from:
+ uri: direct:run
+ steps:
+ - setHeader:
+ name: CamelExecCommandArgs
+ constant: "ARGS-WORK"
+ - to:
+ uri: exec:echo
+ parameters:
+ allowControlHeaders: true
+----
+====
+
+When `allowControlHeaders` is `false` (the default), those in-headers on the
exchange
+are ignored (they are not removed), and a WARN is logged once per binding
instance.
+URI parameters such as `args` continue to work as before.
Review Comment:
Minor wording: the code deduplicates per endpoint URI (not per binding
instance). When multiple exec endpoints share one `DefaultExecBinding`, a
separate warning is logged for each distinct endpoint URI.
```suggestion
When `allowControlHeaders` is `false` (the default), those in-headers on the
exchange
are ignored (they are not removed), and a WARN is logged once per exec
endpoint.
```
--
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]