Skip to content

[Security] Apply sanitize_message to Anthropic and STT error paths#45119

Merged
DarkLight1337 merged 5 commits into
vllm-project:mainfrom
jperezdealgaba:fix/sanitize-anthropic-stt-error-messages
Jun 11, 2026
Merged

[Security] Apply sanitize_message to Anthropic and STT error paths#45119
DarkLight1337 merged 5 commits into
vllm-project:mainfrom
jperezdealgaba:fix/sanitize-anthropic-stt-error-messages

Conversation

@jperezdealgaba

Copy link
Copy Markdown
Contributor

Summary

Affected sites

# File Context
1 vllm/entrypoints/anthropic/api_router.py POST /v1/messages exception handler
2 vllm/entrypoints/anthropic/api_router.py POST /v1/messages/count_tokens handler
3 vllm/entrypoints/anthropic/serving.py SSE streaming error event
4 vllm/entrypoints/speech_to_text/realtime/connection.py WebSocket event loop error
5 vllm/entrypoints/speech_to_text/realtime/connection.py WebSocket generation loop error

Test plan

  • Added tests/entrypoints/anthropic/test_error_sanitization.py with 9 tests covering sanitization of realistic PIL address patterns and source-level verification that all affected modules use sanitize_message.
  • pytest tests/entrypoints/anthropic/test_error_sanitization.py -v — all 9 tests pass.
  • pre-commit run --files <all changed files> — all hooks pass.

Comment thread tests/entrypoints/serve/utils/test_error_sanitization.py
@mergify mergify Bot added the frontend label Jun 10, 2026
The fix for CVE-2026-22778 (PRs vllm-project#31987, vllm-project#32319) applied
sanitize_message only to the OpenAI router exception handlers.
The Anthropic API router, its SSE streaming converter, and the
speech-to-text WebSocket paths return str(exc) directly without
sanitization, leaking PIL object repr memory addresses to clients
(ASLR-bypass primitive).
Apply sanitize_message at all five affected sites:
- anthropic/api_router.py POST /v1/messages exception handler
- anthropic/api_router.py POST /v1/messages/count_tokens handler
- anthropic/serving.py SSE streaming error event
- speech_to_text/realtime/connection.py event loop error
- speech_to_text/realtime/connection.py generation loop error
Signed-off-by: Juan Pérez de Algaba <jperezde@redhat.com>

Signed-off-by: jperezde <jperezde@redhat.com>
@jperezdealgaba jperezdealgaba force-pushed the fix/sanitize-anthropic-stt-error-messages branch from 3033c52 to 9b959b6 Compare June 10, 2026 07:52

@DarkLight1337 DarkLight1337 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@DarkLight1337 DarkLight1337 enabled auto-merge (squash) June 10, 2026 07:56
@github-actions github-actions Bot added the ready ONLY add when PR is ready to merge/full CI is needed label Jun 10, 2026
jperezdealgaba and others added 3 commits June 10, 2026 10:52
Use importlib.util.find_spec to locate module source files instead of
relative paths. The previous approach assumed the working directory was
the repo root, which is not the case in CI environments.

Signed-off-by: Juan Pérez de Algaba <jperezde@redhat.com>

Signed-off-by: jperezde <jperezde@redhat.com>
auto-merge was automatically disabled June 11, 2026 08:16

Head branch was pushed to by a user without write access

@DarkLight1337 DarkLight1337 enabled auto-merge (squash) June 11, 2026 08:17
@DarkLight1337 DarkLight1337 merged commit 9492362 into vllm-project:main Jun 11, 2026
49 checks passed
ryttry pushed a commit to ryttry/vllm that referenced this pull request Jun 11, 2026
…llm-project#45119)

Signed-off-by: jperezde <jperezde@redhat.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Saddss pushed a commit to Saddss/vllm that referenced this pull request Jun 14, 2026
…llm-project#45119)

Signed-off-by: jperezde <jperezde@redhat.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend ready ONLY add when PR is ready to merge/full CI is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants