atiaomar1978-hub commented on code in PR #25846:
URL: https://github.com/apache/camel/pull/25846#discussion_r3895980658
##########
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:
Addressed in 5a71f31 — source doc already says "once per exec endpoint" (via
@davsclaus's doc fix). Also regenerated catalog `exec-component.adoc`, updated
the 4.23 upgrade guide wording, and fixed the dedup test to set a control
header on the third exchange to the same endpoint.
_AI-generated on behalf of atiaomar1978-hub_
--
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]