Summary
LMDeploy versions prior to 0.12.3 contain a Server-Side Request Forgery (SSRF) issue in the vision-language module, where the load_image() helper can fetch arbitrary URLs on behalf of the server.
When exposed to user-controlled image URLs, this behavior can allow attackers to make the LMDeploy service access internal or cloud-only endpoints, potentially disclosing sensitive data or interacting with internal services.
Affected context
This vulnerability affects LMDeploy-based applications that:
- Use the vision-language module and its
load_image()functionality - Allow users or external systems to supply image URLs (e.g., for multimodal prompts or inference requests)
- Run LMDeploy in environments where the server has network visibility into internal services, cloud metadata endpoints, or restricted infrastructure
The issue is most relevant when the deployment is reachable over a network interface and untrusted or semi-trusted clients can influence which URLs are fetched.
Exploit preconditions
- Attack surface: Network-accessible LMDeploy vision-language endpoints that accept user-specified image URLs or paths
- Required access: Ability to submit requests that cause
load_image()to retrieve a remote URL (e.g., via API, SDK, or web UI integration) - Trigger point: Passing a crafted URL to the image loading function, which the server resolves and fetches without IP range validation or egress filtering
- Why exploitation is possible: The implementation does not distinguish between external, internal, or link-local/metadata IP ranges, so the server can be coerced into issuing HTTP or other protocol requests to internal resources that are not directly exposed to the attacker
Why this happens
The root cause is unvalidated server-side fetching of user-controlled URLs in the load_image() utility within the vision-language module.
This maps to CWE-918: Server-Side Request Forgery, where the server acts as a proxy for attacker-chosen destinations due to missing checks on target hosts or IP ranges.
Instead of restricting URL schemes and disallowing internal, loopback, link-local, or metadata addresses, the function trusts arbitrary URLs and lets the LMDeploy process perform network requests with its own privileges and network reach.
Potential impact
- Access to cloud provider metadata services that may expose instance credentials or configuration
- Discovery and probing of internal network services, including ports and HTTP endpoints not exposed externally
- Retrieval of sensitive internal documents, APIs, or configuration endpoints accessible only from within the deployment network
- Use of the LMDeploy service as a pivot point for further attacks within the infrastructure (e.g., lateral movement or internal service abuse)
General mitigation guidance
Effective mitigation typically combines network-layer controls with safer URL handling patterns:
- Restrict outbound network access from LMDeploy instances, especially to metadata IP ranges and internal management networks, using firewall rules, security groups, or service mesh policies.
- Implement allowlists for image sources (e.g., specific domains or CDNs) and reject URLs that do not match approved patterns.
- Validate and normalize URLs before fetching, enforcing safe schemes (such as HTTPS) and blocking private, loopback, link-local, and non-routable address ranges.
- Run LMDeploy with least-privilege network access and avoid colocating it on hosts that have direct access to highly sensitive control planes or data stores.
- Prefer designs where image content is uploaded directly by the client (with size and type checks) instead of fetched from arbitrary URLs when feasible.
How teams detect issues like this
Detection can focus on both code-level patterns and runtime behavior:
- Use static analysis or code review to identify functions that perform network requests on user-supplied URLs, checking for missing host/IP allowlists and scheme restrictions.
- Establish secure coding guidelines for multimodal and image-loading utilities, and enforce them through pull request templates or automated checks.
- Monitor outbound traffic from LMDeploy instances for anomalous destinations, especially attempts to reach metadata IPs (e.g., 169.254.169.254) or internal-only subnets.
- Employ centralized logging of requested URLs for image loading, with alerts for access to private IPs, non-standard ports, or sensitive hostnames.

