REDHAT-BUG-2497287: Input Validation
Improper Input Validation, Exposure of Sensitive Information to an Unauthorized Actor, Server-Side Request Forgery (SSRF) vulnerability in Apache Camel in Vertx Websocket component.
The camel-vertx-websocket consumer mapped inbound WebSocket query and path parameters into the Camel Exchange header map without applying any HeaderFilterStrategy (VertxWebsocketConsumer.populateExchangeHeaders()). Because nothing blocked the Camel header namespace, a client connecting to the WebSocket endpoint could set Camel-internal control headers - including CamelHttpUri (Exchange.HTTPURI) - simply by supplying them as query parameters. In a route where the WebSocket consumer feeds a downstream HTTP producer, the injected CamelHttpUri redirects the server-side HTTP request to an attacker-chosen destination (server-side request forgery - for example to an internal service or a cloud metadata endpoint). In addition, the HTTP producer resolves Camel property placeholders on the resulting (attacker-controlled) URI, so placeholders embedded in the injected value - such as an environment-variable reference, an application property, or a vault reference - are resolved to their real values and sent to the attacker, disclosing environment variables, application properties and vault secrets. When the WebSocket endpoint is exposed without authentication, this is reachable by an unauthenticated remote attacker. This issue affects Apache Camel: from 4.0.0 before 4.14.8, from 4.15.0 before 4.18.3, from 4.19.0 before 4.21.0.
Users are recommended to upgrade to version 4.21.0, which fixes the issue. If users are on the 4.14.x LTS releases stream, then they are suggested to upgrade to 4.14.8. If users are on the 4.18.x releases stream, then they are suggested to upgrade to 4.18.3. The fix makes the affected consumers apply a HeaderFilterStrategy that filters the Camel header namespace case-insensitively on inbound mapping, so externally-supplied Camel / camel headers are no longer copied into the Exchange. For deployments that cannot upgrade immediately, strip the Camel control headers from the inbound message before they reach any downstream producer (for example removeHeaders('Camel') and removeHeaders('camel') at the start of the route), require authentication on the WebSocket endpoint, and avoid bridging an untrusted consumer directly into an HTTP producer whose target URI can be driven from message headers.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Apache Camelto a version that resolves this vulnerability.Fixed in 4.14.8 - Upgrade
Upgrade
Apache Camelto a version that resolves this vulnerability.Fixed in 4.18.3 - Upgrade
Upgrade
Apache Camelto a version that resolves this vulnerability.Fixed in 4.21.0 - Configuration
Apply a HeaderFilterStrategy in the Vertx websocket consumer so externally supplied Camel* / camel* headers are not copied into the Camel Exchange (filter case-insensitively during populateExchangeHeaders()).
Apache Camel Vertx Websocket component (camel-vertx-websocket consumer) HeaderFilterStrategy applied in VertxWebsocketConsumer.populateExchangeHeaders() = filter Camel header namespace case-insensitively for inbound mapping (exclude Camel* and camel* from being copied into the Exchange) - Configuration
In routes where the WebSocket consumer feeds downstream processors, strip Camel control headers from the inbound message at the start of the route (e.g., removeHeaders('Camel*') and removeHeaders('camel*') before they reach any downstream producer).
Apache Camel route Inbound Camel control header handling = removeHeaders('Camel*') and removeHeaders('camel*') at the start of the route - Configuration
Require authentication on the WebSocket endpoint to prevent unauthenticated remote attackers from reaching the vulnerable endpoint.
Apache Camel Vertx Websocket endpoint Authentication requirement = required - Compensating control
Avoid bridging an untrusted WebSocket consumer directly into an HTTP producer whose target URI can be driven from message headers.
Event History
Frequently Asked Questions
What is the severity of REDHAT-BUG-2497287?
The severity of REDHAT-BUG-2497287 is high, rated at 7.
How do I fix REDHAT-BUG-2497287?
To fix REDHAT-BUG-2497287, ensure you update Apache Camel to a patched version that addresses the vulnerability.
What type of vulnerability is REDHAT-BUG-2497287?
REDHAT-BUG-2497287 is an Improper Input Validation and SSRF vulnerability.
What components are affected by REDHAT-BUG-2497287?
The affected component in REDHAT-BUG-2497287 is the Vertx Websocket component of Apache Camel.
What can an attacker achieve with REDHAT-BUG-2497287?
An attacker exploiting REDHAT-BUG-2497287 can gain exposure to sensitive information and may conduct server-side request forgery (SSRF) attacks.