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


##########
docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_23.adoc:
##########
@@ -2500,3 +2500,33 @@ Due to the package rename from `com.bazaarvoice.jolt` to 
`io.joltcommunity.jolt`
 `ContextualTransform` classes into a Chainr spec need to update their imports 
to `io.joltcommunity.jolt.Transform` and
 `io.joltcommunity.jolt.ContextualTransform`.
 Users referencing `Removr` directly also need to update their import to 
`io.joltcommunity.jolt.removr.Removr`.
+
+=== camel-mustache, camel-chunk - potential breaking change
+
+The Exchange header constants in `MustacheConstants` and `ChunkConstants` have 
been renamed to
+follow the Camel naming convention used across the rest of the component 
catalog (so that they are
+handled consistently by `DefaultHeaderFilterStrategy`, like the other template 
components). The Java
+field names are unchanged; only the header string values have changed.
+
+`MustacheConstants`:
+
+[options="header"]
+|===
+| Constant | Previous value | New value
+| `MustacheConstants.MUSTACHE_RESOURCE_URI` | `MustacheResourceUri` | 
`CamelMustacheResourceUri`
+| `MustacheConstants.MUSTACHE_TEMPLATE` | `MustacheTemplate` | 
`CamelMustacheTemplate`
+|===
+
+`ChunkConstants`:
+
+[options="header"]
+|===
+| Constant | Previous value | New value
+| `ChunkConstants.CHUNK_RESOURCE_URI` | `ChunkResourceUri` | 
`CamelChunkResourceUri`
+| `ChunkConstants.CHUNK_TEMPLATE` | `ChunkTemplate` | `CamelChunkTemplate`
+|===
+
+Routes that reference the constants (for example 
`setHeader(MustacheConstants.MUSTACHE_TEMPLATE, ...)`)
+are unaffected. Routes that set the header by its literal string name, or that 
use
+`allowTemplateFromHeader=true` with the old header names, must switch to the 
new `Camel`-prefixed
+names.

Review Comment:
   ❓ The entry frames the rename as a consistency change. The stronger reason 
is a security one, and saying so would make the break easier to accept — and 
discourage the obvious workaround of just renaming back.
   
   Both components expose `allowTemplateFromHeader` (`MustacheEndpoint:54`, and 
the chunk equivalent), and a template supplied by a message is arbitrary code 
execution, not just configuration. Under the old names, `MustacheTemplate` / 
`ChunkTemplate` arriving from an untrusted external sender passed 
`DefaultHeaderFilterStrategy` untouched, because the filter keys on the `Camel` 
prefix. With the prefix in place they're filtered at the component boundary, so 
the header can only come from the route.
   
   A sentence to that effect — something like "the previous names were not 
covered by `DefaultHeaderFilterStrategy`, so a template header from an 
untrusted sender reached the component; the `Camel` prefix means it is now 
filtered on the way in" — would explain why the break is worth taking.



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