← Security advisories
Apache Camel security advisory

CVE-2026-101259

Camel-CoAP: information disclosure - when the consumer could not build its response once the route had completed, the exception's message was sent to the CoAP client as the payload of the 5.00 response, so an internal error message reached an external client

Description

When the CoAP consumer could not build its response once the route had completed, CamelCoapResource caught the resulting exception and sent its message back to the CoAP client as the payload of a 5.00 Internal Server Error response. The typical case is a type conversion failure: the consumer converts the final message body to the byte[] payload, and the CamelCoapMaxAge and CamelCoapETag headers to their types, after the route has returned, and therefore outside the route's error handler. On the affected releases the message of such a failure names the class of the value being converted, carries the value's string form, and ends with the class name and message of the underlying cause, so a remote CoAP client could read internal detail about the deployment: class and package names, the string form of the value, such as the path of a file body, and whatever the cause carries, which in practice can include paths, host names and connection detail of a backend. The consumer had no option to suppress this, unlike the HTTP consumers, which offer a muteException option for that purpose. The exception raised by a failing route was not sent: the consumer did not check whether the exchange had failed, and answered a route failure with 2.05 Content and whatever body the message held at that point. Reaching the disclosure therefore requires a route whose completed response a remote client can make unconvertible, which depends on how the route is written.

Mitigation

Users are recommended to upgrade to version 4.23.0, which fixes the issue. If users are on the 4.22.x releases stream, then they are suggested to upgrade to 4.22.2. If users are on the 4.18.x releases stream, then they are suggested to upgrade to 4.18.5. The 4.14.x releases stream and earlier, and the 4.15.x to 4.17.x and 4.19.x to 4.21.x release lines, reached end of life before this issue was resolved and will not receive a fix, so deployments on them must move to a supported release. The upgrade is enough on its own: the new muteException consumer option defaults to true on all three fixed release lines, so the error response carries no payload without any configuration change. For deployments that cannot upgrade immediately, make sure the response can always be built once the route has completed: convert the body to byte[] or String as the last step of each route that consumes from a coap endpoint, for example with convertBodyTo, give the CamelCoapMaxAge and CamelCoapETag headers only values of their own types, and add an onException handler that marks the failure as handled and sets the response body explicitly, so that a conversion failure is raised and replaced inside the route rather than in the consumer.

Credit

This issue was discovered by Zhixi "Jace" Sun, independent security researcher

Notes

The JIRA ticket: https://issues.apache.org/jira/browse/CAMEL-25087 refers to the commits that resolved the issue, and has more details.

The fix was merged on main in https://github.com/apache/camel/pull/26994 (commit 2245feac8f4f9a85404b01d36114abdac504e7d1), and backported to camel-4.22.x in https://github.com/apache/camel/pull/27046 (commit 868d56044119a8a975f583b63aeb9666cd952a88) and to camel-4.18.x in https://github.com/apache/camel/pull/27048 (commit aaf5bbf81ede12837c9c65fa9106643fcb58b7c4).

The fix gives the CoAP consumer a muteException option, on the coap, coaps, coap+tcp and coaps+tcp endpoints alike, which defaults to true on all three release lines. When the response cannot be built once the route has completed, the consumer still answers with 5.00 Internal Server Error, but with an empty payload, and it now reports the exception through the consumer’s exception handler, so muting it does not hide it from the operator. The consumer also checks whether the exchange failed, and answers a route failure with 5.00 Internal Server Error under the same rule, where it previously answered 2.05 Content with whatever body the message held when the route failed. A route that relies on the exception’s message reaching the client must opt back in with muteException=false, which then sends the message as the payload of the 5.00 response for a route failure as well; for the Rest DSL the option is set with restConfiguration().endpointProperty(“muteException”, “false”). This behaviour change is described in the upgrade guides for 4.18.5, 4.22.2 and 4.23.0.

The consumer has returned the message of such an exception to the client since camel-coap was introduced in 2.16.0, and that code was unchanged until the fix, so every 4.x release before the fixed versions is affected, including Rest DSL services exposed through camel-coap.

This is the CoAP member of the unmuted-consumer-exception family published as CVE-2026-84180 (camel-knative), CVE-2026-85246 (camel-mina), CVE-2026-85257 (camel-cxf) and CVE-2026-85315 (camel-grpc), and the new option follows the same muteException convention. Unlike those consumers, the CoAP consumer did not return the exception of a failing route, only one raised while it built the response after the route had completed. It is classified as CWE-209 (Generation of Error Message Containing Sensitive Information).

References