The vulnerability is caused by an incomplete fix for a previous vulnerability (CVE-2026-22778). The original fix introduced a sanitize_message function to prevent leaking memory addresses in error messages but failed to apply it in all necessary locations. Specifically, several new API endpoints and streaming handlers added after the original fix did not use the sanitizer.
The vulnerability exists in multiple locations where exceptions are caught, and the exception message (str(e)) is returned in an API response or sent over a WebSocket without being sanitized. An attacker can trigger this vulnerability by sending a malformed request, such as an image with invalid format, which causes an exception in the server. The resulting error message, containing sensitive information like memory addresses from object representations (e.g., <_io.BytesIO object at 0x7a95e299e750>), is then leaked to the attacker. This information leak can be used to bypass security mechanisms like ASLR.
The vulnerable functions are:
vllm.entrypoints.anthropic.api_router.create_messages: Handles POST /v1/messages and returns unsanitized exception messages.
vllm.entrypoints.anthropic.api_router.count_tokens: Handles POST /v1/messages/count_tokens and returns unsanitized exception messages.
vllm.entrypoints.anthropic.serving.AnthropicServing._stream_response_handler: A generator for streaming responses that yields unsanitized exception messages.
vllm.entrypoints.speech_to_text.realtime.connection.Connection.handle_connection: Handles WebSocket connections and sends unsanitized exception messages.
vllm.entrypoints.speech_to_text.realtime.connection.Connection._run_generation: Part of the WebSocket logic that sends unsanitized exception messages.
The fix involves applying the sanitize_message function to the exception message in all these locations before sending it to the client.