Preventing SSRF in vLLM multimodal requests

Multimodal requests can make your vLLM server fetch URLs on your behalf, which can reach internal services. This page covers how to restrict media fetches with allowed domains, redirect handling and tests on online and batch paths.

On this page

Why vLLM multimodal URLs can reach internal services

A self-hosted vLLM server that accepts image, audio or video URLs in a request will, by design, fetch those URLs from inside your network. That is the risk this section addresses: server-side request forgery (SSRF), where a caller supplies a URL that makes your server connect to a destination the caller could never reach directly, such as a metadata service on a cloud instance, an internal admin page, a database health endpoint or a host on a private address range. The vLLM server is the component making the connection, so it sits on the network path that your firewalls and routing rules may trust. A user who can submit a chat request with an image URL may therefore be able to probe services that were never meant to be exposed to them.

The multimodal path matters because it is easy to overlook. A team may lock down the text endpoints and forget that image, audio and video inputs are downloaded and decoded by the same process. The same applies to batch jobs that read media URLs from input files, which can bypass checks written only for interactive traffic. Treat any multimodal endpoint reachable by end users, by other internal services or by a gateway that forwards caller-supplied content as in scope. Single-tenant, offline-only deployments that never receive external URLs carry a much smaller exposure, but teams should confirm that assumption in their own network design rather than assume it.

The vLLM security documentation and its published advisories are the reference for how the server currently fetches media and which settings constrain that behavior, and the exact option names and defaults change between releases. Before designing controls, record the vLLM version you run, read the vLLM security documentation for that version, and check the advisory history for media-fetch issues. Then confirm with your own tests which media-fetch limits and domain controls your build actually enforces, and which ones you must implement in a proxy or network layer.

Options for restricting media URL fetches and when each fits

This table compares the main controls for stopping a vLLM server from fetching attacker-chosen image, audio and video URLs. Read each row as a control, the situation where it fits, and whether its behavior must be confirmed against the vLLM version you run. The main takeaway is that no single control is enough on its own, and the strongest setups combine an allowlist with network egress rules.

ControlWhat it doesWhen it fitsConfirm before relying on it
Domain allowlist for media hostsAccepts media URLs only from named hosts such as your own object storage or CDNClients send URLs to media you already host and the host list is short and stableCheck whether vLLM applies the allowlist to redirect targets and to DNS results, not only the hostname string
Block private and link-local rangesRejects URLs that resolve to loopback, RFC 1918, link-local or cloud metadata addressesMedia hosts are public or cloud-hosted and you cannot list every domain in advanceConfirm which address ranges vLLM blocks by default and whether the check runs after DNS resolution
Egress rules at network or proxy layerLimits which destinations the vLLM pods or hosts can open connections toYou need a control that holds even if application-layer checks failRequires the platform team to own firewall or proxy policy; test from inside the serving network
Disable URL inputAccepts only uploaded or pre-staged media, so the server never fetches a remote URLBatch jobs or internal pipelines can stage files ahead of timeConfirm the vLLM option or request handling that rejects URL inputs on your version
Gateway fetches media for clientsA gateway downloads and validates media, then passes the content or a staged reference to vLLMMultiple external clients send media and you need one place for logging and limitsThe gateway becomes the SSRF surface, so apply the same allowlist and egress rules there
Redirect handling policyRefuses or re-validates each redirect hop before fetching itAny allowlist applies, since a permitted host can redirect to an internal addressTest with a permitted host that redirects to an internal address on both online and batch paths

Where the trust boundary sits in a multimodal request

The flow starts at the client application, which sends a chat request with an image, audio or video URL through your reverse proxy or gateway. The proxy forwards only the endpoints meant for users to the vLLM online server. When a request carries a media URL, the server's fetch step retrieves it, and that outbound call is the hand-off to check. The allowlist, redirect checks and egress rules belong on the path between the fetch step and the network, so only approved external media hosts are reachable and internal addresses are denied. Check each boundary separately, because the proxy never sees the URLs the server fetches later.

Trust boundaries and enforcement points for outbound media URL fetches.

Setting up the media allowlist and redirect controls

This sequence turns a vague concern about media URLs into a tested control: a known list of allowed sources, network egress that enforces it, and evidence that both the online and batch paths refuse everything else. Each step produces a record your security team can review.

  1. Inventory the media sources clients need

    Product and platform owners list every place where image, audio and video URLs originate, such as customer upload services, a document store, a CDN or a partner's media host. For each source, record the hostnames, the schemes used (HTTPS only or HTTP as well), and whether the source ever issues redirects. Done means each application that sends media URLs to vLLM has a named owner and a written list of hosts, and any source that cannot be named is flagged for a decision before going further.

  2. Decide allowed domains and internal ranges

    Security and platform leads turn the inventory into an allowlist of exact hostnames, avoiding wildcards unless a source truly needs them. They also decide that private, loopback, link-local and cloud metadata address ranges are blocked for media fetches, and they document any exception with an owner and a reason. The output is a signed-off policy file or table. Done means every entry has a justification and the policy states what happens to URLs that match no entry.

  3. Enforce egress at the network layer

    The platform team restricts the vLLM hosts' outbound traffic so they can reach only the approved media hosts and the services they need, using firewall rules, egress proxies or cloud network policy. This control sits outside vLLM so that a misconfigured application setting cannot widen access. Done means a test connection from a vLLM host to an approved host succeeds, and a connection to an internal address, the cloud metadata endpoint and an unlisted public host fails and appears in the network logs.

  4. Configure the allowlist in your vLLM version

    The engineer responsible for the serving stack reads the security documentation and release notes for the exact vLLM version in production, then confirms which media domain and fetch controls that version provides and how they are named. Configuration is applied through the documented mechanism, kept in version control, and deployed with the rest of the serving configuration. Done means the running server reports the applied settings, and the configuration in version control matches the policy from the earlier step.

  5. Validate redirect behavior

    The tester supplies media URLs from an allowed host that respond with redirects to a disallowed host, an internal address, and a plain HTTP location, then records whether vLLM follows each hop. The tester also checks that the network layer blocks the final hop even if the application-level check is bypassed. Done means every redirect case that should be refused is refused at both layers, and the test cases are saved so they can be repeated after upgrades.

  6. Test the online request path

    The tester sends chat requests with image, audio and video URLs using the OpenAI-compatible endpoints the deployment exposes, covering allowed hosts, unlisted public hosts, private addresses and malformed URLs. Each request should return an error or a clear refusal for disallowed sources, and the server logs should show the decision. Done means the results match the policy table for every case, and any allowed host that fails is traced back to a policy or network gap.

  7. Test the batch request path

    The tester repeats the same URL cases through every batch or offline entry point the team uses, because a control that holds for online requests may not be applied to batch jobs that load media differently. Confirm the batch path with the vLLM version in use, since its media handling may differ from the online server. Done means batch results match the online results, and any difference is fixed or documented as a known gap with an owner.

  8. Record evidence and retest after upgrades

    The team stores the policy, configuration, network rule export, redirect test results and online and batch test outputs together, with the vLLM version and date. The same test set runs after every vLLM upgrade and every change to the media sources, since new releases can change fetch behavior. Done means a reviewer can trace each allowed host to an owner and a test, and a failed retest blocks the upgrade until the control is restored.

Handling redirects and DNS rebinding in media fetches

An allowlist that checks only the first hostname does not stop SSRF. A permitted media host can answer with a redirect to an address on your internal network, such as a metadata service or an internal API, and a fetcher that follows that redirect without checking again will make the request for the attacker. A second gap is DNS: the name is resolved once when the allowlist is checked and again when the connection is opened, and a hostname that answers with a public address first and a private one second (DNS rebinding) passes the check and reaches the internal target. Treat the hostname check as one control among several, not as the boundary.

The controls to confirm in your deployment are these. Redirects should be disabled, or followed only after the target URL is re-validated against the same allowlist and address rules at every hop, with a small cap on hop count. The address the fetcher resolves should be checked against private, loopback, link-local and metadata ranges, and the connection should be made to that checked address rather than a fresh lookup of the name. Independently, egress rules at the network layer should block the vLLM host and its containers from reaching internal ranges and cloud metadata endpoints, so a fetcher bug does not become an internal request. Confirm which of these the vLLM version you run actually implements in its media loader, because the checks may sit in a library, a configuration setting or your own proxy.

Do not assume these behaviors. Write tests that send a request with an allowed host redirecting to a private address, a host whose DNS record alternates between public and private answers, and a direct request to a metadata address, then run them against both the online serving path and the batch path. Record whether each request is refused, where it is refused, and whether a blocked attempt appears in your logs. Repeat the tests after each vLLM upgrade, since fetch behavior can change between releases.

Security and operational considerations for the allowlist

An allowlist stops a media URL from reaching the wrong host only if the rest of the serving environment is set up to support it. The cards below cover the surrounding controls, logging, change management and upgrade checks that keep the allowlist effective over time.

Block cloud metadata endpoints

Cloud hosts expose instance metadata at a link-local address, and that service can return instance credentials to anyone who reaches it. A media fetch that resolves to that address bypasses any domain intent you had. Confirm that the serving host's metadata access is restricted to the processes that need it, enforce IMDS hop limits or token requirements where your provider supports them, and test that a multimodal request pointing at the metadata address fails.

Log every fetched media URL

Record the requested URL, the resolved host, the redirect chain and the outcome for each media fetch, tied to the caller identity. Without this, a blocked or unexpected fetch leaves no trace and an investigation cannot show which internal targets were attempted. Check that logs do not store signed query strings or tokens that appear in media URLs, and set a retention period that your security team has approved.

Put the allowlist under change control

Every domain added to the media allowlist widens what the serving host can reach, so treat changes as security-relevant. Require a named owner, a written reason and a review by the security team, and store the list in version control. Ask whether a wildcard or a broad CDN domain is being added, because a shared hosting domain may serve content from many tenants.

Recheck media handling on each vLLM upgrade

Media download and decode behavior can change between vLLM releases, including default timeouts, supported schemes and the handling of redirects. Releases arrive about every two weeks, so a fixed allowlist test is not enough. Rerun the SSRF test cases after each upgrade in staging, and read the release notes and security advisories for changes to media loading before promoting the new version.

Latest release in facts
v0.31.0
vLLM releases

Restrict all other egress from the host

The allowlist covers one code path, so the serving host should also be unable to reach internal services for any other reason. Apply outbound rules at the network layer that permit only the model registry, package mirrors and approved media domains, and deny the internal subnets where databases, admin consoles and the metadata address sit. Verify the rules from inside the container or pod, since host-level rules alone may not cover it.

Align the allowlist with the endpoint allowlist and API key

The media allowlist protects the server from outbound requests, while the reverse proxy allowlist and the --api-key option control who can send requests in the first place. The API key does not cover every endpoint, so a request path left open by mistake may still reach media handling. Confirm that only the user-facing inference routes reach the server, that authentication is enforced at the gateway, and that the two lists are reviewed together.

vLLM security docs

How to test the allowlist on online and batch paths

What should a permitted public host test prove for a media URL allowlist?

A request that names an approved public media host should be fetched and processed normally, which shows the allowlist does not block legitimate use. Run it on the online chat or completions path with an image, audio or video URL from a host on your list. Keep the request, the HTTP status returned to the client, and the server log line showing the host was matched and the fetch succeeded. Also record the exact allowlist version under test, so a later change can be compared against this baseline. Without this positive case, teams often loosen the rules after a false block and never notice the regression.

How do I confirm a private IP literal in a media URL is blocked?

The request should be rejected before any connection to the internal address is opened. Test with literal addresses such as loopback, RFC 1918 ranges, link-local addresses and the cloud metadata address, placed in an image URL field. The expected result is a client error with no outbound connection from the vLLM host, which you can confirm with egress logs or a packet capture on the node. Keep the rejected request, the response body, the log entry showing the block reason, and the firewall or flow log proving no connection attempt. Test IPv6 forms and alternate encodings of the same addresses, because a check that only matches dotted decimal text is easy to bypass.

How do I test a hostname that resolves to a private address?

The allowlist must check the address the hostname resolves to, not only the name in the URL. Use a test domain you control whose DNS record points to a private address, then send it through the online path and confirm the request is refused. Also test a name that resolves to a public address at check time and a private one at fetch time, since DNS rebinding depends on that gap. The evidence to keep is the DNS record used, the resolver answer seen by the server, and the block log. Confirm with your platform team whether the check runs in the vLLM process or in a proxy in front of it, because that decides where the test logs appear.

How do I test a redirect from an allowed host to an internal target?

A media request that starts at an allowed host and redirects to an internal address must be stopped at the redirect, not followed. Set up a test endpoint on an allowed host that returns a redirect to a private address and to a host outside the list, then send an image URL pointing to it. The expected result is that the redirect target is never requested, and the request fails with a logged reason. Check each hop, not just the final response, and cap the number of redirects. Keep the redirect chain, the server log showing each hop evaluated, and proof that the internal target received no traffic.

How should oversized and slow media downloads be tested?

Oversized and slow responses should end in a bounded failure, not a hung worker or memory spike. Test with a file larger than your configured size limit, served with and without a Content-Length header, and with a server that sends bytes very slowly. The expected results are a rejection at the byte limit and a timeout that frees the request slot. Watch worker memory, queue depth and request latency during each test. Keep the test parameters, the timeout and size settings in effect, the error returned, and the resource graphs for the window. Confirm the limits with your own configuration, since the defaults that apply to your version should be checked in the vLLM documentation.

Do the same checks apply to batch or offline job inputs?

Yes, batch and offline jobs need the same allowlist, redirect and size checks, and they are often the path teams forget. Run the full set of test cases above against a job file that references media URLs, and confirm the job rejects or fails each unsafe item without stopping the whole run when that is your intended behavior. Check whether the batch runner uses the same media loader as the online server, because separate code paths can enforce different rules. Keep the job input file, the per-item results, and the configuration used by the batch process, so the evidence matches what production will run.

Can our own team run these tests, or do we need a partner?

Your own team can run these tests if it has access to a staging vLLM deployment, a controlled DNS zone, a test web server and egress logs. Many teams keep the work in house and use an external review only for the final evidence. DeployOpen runs security testing of applications, APIs and AI systems, and can plan a fixed-scope test of your media allowlist and retest after fixes, with scope and deliverables agreed in writing before work starts. Cost depends on how many paths, proxies and batch runners are in scope, and on how much staging infrastructure must be built. Ask any provider for the written list of test cases, the evidence format and the retest terms.

Limits to confirm in your environment

The allowlist only protects you if the code paths, loaders and network around vLLM match what you assume. Each item below is a point where the release you run, your gateway or your cloud can change the outcome. Confirm them against your own deployment rather than relying on the default behavior of any one layer.

Which media options exist in your release

Media domain controls, fetch timeouts and size limits differ between vLLM versions, and option names change across releases. Read the help output of the exact vllm serve version you run and the security documentation for that version. Record which media-related settings exist, which are off by default, and which are not available at all, so the allowlist design matches the release in production rather than the one in a tutorial.

vLLM security docs

Whether batch and online share fetch logic

Online chat requests and offline or batch inputs may reach media fetching through different code paths. A control applied to the HTTP route does not necessarily cover a batch job that reads URLs from a file. Trace each entry point your team uses, test each one with a URL pointing at an internal address, and confirm that the same domain rules, redirect handling and size limits apply to every path.

Behavior of audio and video loaders

Image loaders are usually the most exercised path, while audio and video loaders may pull in different libraries, follow different redirects or stream larger payloads before any size check. Ask which loader handles each media type in your release, whether it honors the same domain rules, and whether it writes downloaded content to temporary storage on the serving host. Test each media type separately.

Media size limits at the gateway

A proxy or gateway in front of vLLM may buffer, truncate or reject request bodies before they reach the server, and it may not inspect the media URLs at all. Confirm the maximum request body size at each layer, whether the gateway forwards URLs for the server to fetch, and whether an oversized or slow response is cut off before it can tie up workers. The gateway and the server should enforce compatible limits.

Metadata endpoints on the serving host

Cloud instance metadata services listen on link-local addresses that a server making outbound requests can often reach. Confirm with your cloud provider which metadata versions are enabled on the serving nodes, whether session tokens are required, and whether hop limits or network policies block container and pod traffic to those addresses. Also check that the serving host's role cannot read secrets it does not need for inference.

Questions teams ask before fixing SSRF in vLLM

How much effort does fixing SSRF in vLLM multimodal requests take?

The effort depends mostly on how many media sources your users legitimately send and how many entry points reach the server. A deployment that accepts image URLs from one known storage bucket is a much smaller job than one that fetches arbitrary web images for many applications. The work splits into a one-time build of the allowlist, redirect handling and network egress rules, and a recurring cost of reviewing the allowlist as applications change. Ask any partner to price these two parts separately, and to state which online and batch paths are in the written scope.

Can our internal team fix this without outside help?

Often yes, if the team already runs Linux hosts, container networking and a reverse proxy or gateway, and can read the vLLM request path well enough to find where media URLs are fetched. The harder parts are proving that the allowlist holds against redirects and DNS tricks, and testing both the online API and any batch jobs. Teams without a security testing habit often find it useful to have an outside tester check the result. DeployOpen plans, implements and tests this work in infrastructure you control, under a written scope.

What does the work need from our team?

Three things matter most. You need network access to the vLLM hosts, the egress firewall and any proxy in front of them, so changes can be made and verified. You need a test environment that matches production routing, because allowlist behavior depends on DNS, proxies and egress paths. You also need a named owner for the allowlist who can approve each new media domain and remove old ones. Ask your partner to list these needs in the written scope so that access requests and environment setup are agreed before work begins.

How long does the fix take, and what changes the timeline?

No duration is fixed here, because it depends on your environment. The main drivers are the number of media sources, whether each source is a single host or a set of CDNs with changing addresses, how many request paths fetch media (online API, batch processing, and any tool integrations), and how many approval steps your change process requires. Each additional source needs a decision, a test and a record. Ask for a timeline tied to a list of sources and paths, and treat any estimate that does not name them as unverified.

Is a reverse proxy alone enough to stop SSRF in vLLM?

No. A reverse proxy that allowlists endpoints controls which vLLM paths users can reach, but it does not control where vLLM itself sends outbound requests when it downloads an image, audio or video URL from a request body. Those fetches originate from the vLLM host, so the controls must also include egress rules that block internal address ranges and metadata services, a media domain allowlist inside the request path, and handling of redirects so a permitted domain cannot forward the server to an internal address. Treat the proxy as one layer, and verify the others separately.

How do vLLM upgrades affect the SSRF controls?

Upgrades can change how media is fetched, which can quietly undo a control that depended on an older code path. vLLM ships new minor releases about every two weeks, so the setup needs to be retested after each upgrade you adopt, not only at initial deployment. Keep the egress rules and allowlist in version-controlled configuration outside the vLLM image, and rerun the same online and batch tests on each candidate release before rollout. Check the vLLM release notes and security advisories for media handling changes as part of that review.

Does fixing this create compliance evidence we can show an auditor?

It can help, but it does not make your deployment compliant by itself. Auditors look for documented controls, change records, test results and proof that the controls still operate after changes. A written allowlist with owners, egress rules stored as code, retained test results from the online and batch paths, and a record of each retest after upgrades give an assessor something concrete to review. Independent auditors and certification bodies issue any audit report or certification, and DeployOpen prepares the systems, controls and evidence for that assessment.

Where to check current vLLM behavior

Read the target version's release notes before you write or change the media allowlist. Multimodal media handling in vLLM is a moving part of the engine, and the way it fetches image, audio and video URLs can change between releases. vLLM ships new minor releases about every two weeks, so a rule that matched the version you tested last month may not match the version you deploy this month. Before you fix the allowlist, confirm which release you are running, open the release notes for that exact version and for each release between your current one and the target, and look for changes to media loading, URL handling, redirects, or security fixes. Record the version number next to the allowlist in your change record so that anyone reviewing the configuration knows which behavior it was written against.

Start with the vLLM security documentation, which describes the security posture the project documents and the deployment guidance that goes with it, and use the vLLM online serving documentation to confirm which request fields and endpoints the server accepts in your version. Treat both as the reference for what the server does, and treat your own test results as the evidence that your controls work. If the documentation for your version does not state how media URLs are fetched, do not assume a default. Ask the vendor or the project maintainers to confirm the behavior in writing, and verify it in your environment before you rely on it.

How DeployOpen scopes and tests vLLM media controls

DeployOpen plans and implements self-hosted vLLM inside infrastructure you control, including the media fetching controls that decide which image, audio and video URLs the server may retrieve. We scope the allowlist and redirect rules in writing, build them into your deployment, test them on both the online and batch paths, and hand over the configuration and evidence your security team can review.

How we scope

  • Inventory every request path that accepts image, audio or video URLs, including online serving and batch jobs
  • Agree in writing which media domains and internal network ranges are allowed, denied or out of scope
  • Record the vLLM version and deployment method so the controls match the release you run

How we build

  • Configure the allowlist, redirect handling and network egress rules at the layer you choose, with each rule documented
  • Restrict outbound connections from the vLLM host so internal services and metadata endpoints are unreachable
  • Keep changes in version-controlled configuration so reviews and rollbacks follow your change process

How we hand over

  • Deliver the written configuration, a test plan and results for online and batch requests, and a list of open risks
  • Provide operator notes on adding a domain to the allowlist and on how the change is reviewed
  • Walk your security and platform teams through the evidence so they can assess it against their own requirements

How we support

  • Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts
  • Ongoing support, upgrades and continuous testing are available as a retainer
  • Retesting after vLLM upgrades, including the two-week minor release cadence, can be included in the retainer scope

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.