test(multimodal): harden SSRF rejection paths - #13711
Draft
pskiran1 wants to merge 5 commits into
Draft
Conversation
Signed-off-by: Sai Kiran Polisetty <spolisetty@nvidia.com>
…hub.com/ai-dynamo/dynamo into spolisetty/dis-2670-ssrf-test-hardening
Signed-off-by: Sai Kiran Polisetty <spolisetty@nvidia.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview:
This PR closes SSRF error-propagation gaps for multimodal media URLs. When Dynamo rejects a media URL, the rejection must remain terminal. No adapter, connector, batch loader, or fallback should retry the URL or continue fetching other media.
This PR fixes paths where a typed rejection could be swallowed or treated as recoverable. It also adds request-level tests that use a real network listener to confirm that blocked destinations receive zero connection attempts.
Details:
InvalidArgumenterrors for policy violations, including blocked schemes, hostnames, IP ranges, DNS-resolved private addresses, and redirect destinations.UrlValidationErrorandHttpStatusError, verify that the same error instance escapes, and confirm that fallback and downstream fetch methods are not called.Where should the reviewer start?
lib/llm/src/preprocessor/media/loader.rs— typed Rust policy errors, redirect handling, DNS checks, and fetcher tests.lib/llm/src/preprocessor.rs— preservation of terminal policy errors through the dimension cache and MM-routing URL-passthrough path.components/src/dynamo/sglang/request_handlers/multimodal/encode_worker_handler.py— the terminal-error guard in_maybe_nvdec_decoder.components/src/dynamo/common/tests/multimodal/— batch propagation and vLLM connector fallback contracts.components/src/dynamo/trtllm/tests/test_trtllm_multimodal_processor.py— exact error propagation and prevention of later media fetches.tests/frontend/test_http_status_propagation.py— Python backend request-level 4xx and zero-egress coverage.tests/mm_router/test_vllm_frontend_ssrf_e2e.py— vLLM and Rust frontend request-level coverage.tests/utils/network_canary.py— shared connection-counting test helper.Related Issues
🔗 This PR is linked to an issue:
🚫 This PR is NOT linked to an issue: