Summary
CVE-2026-85686 is a server-side request forgery (SSRF) vulnerability in ms-swift, an open-source LLM fine-tuning/deployment toolkit maintained by ModelScope, affecting the OpenAI-compatible swift deploy inference API. The API accepts image_url, audio_url, and video_url parameters in multimodal chat completion requests and fetches these URLs server-side without validating the target or restricting redirects, allowing unauthenticated remote attackers to force the server to issue requests to internal network resources and cloud instance metadata services. The flaw is rated HIGH severity (8.7).
Technical details
- Root cause: The media-loading path (
load_fileinswift/template/vision_utils.py, invoked viaload_image/remove_messages_mediainswift/template/base.pyandswift/template/template_inputs.py) fetches any URL beginning withhttpusing a simplesession.get(path)call, with no validation of the destination IP/hostname and no restriction on HTTP redirects. - Trigger conditions: The
swift deployserver binds to0.0.0.0and runs with no authentication (api_key=None) by default, so any network-reachable client can submit a/v1/chat/completionsrequest containing a craftedimage_url,audio_url, orvideo_url. - Attack vector: Network, no privileges or user interaction required (CVSS AV:N/AC:L/PR:N/UI:N). An attacker can point the media URL at loopback addresses, RFC1918 private ranges, link-local addresses, or cloud metadata endpoints (e.g.,
http://169.254.169.254/latest/meta-data/), and can also use HTTP redirects to bypass any external allowlisting since redirects are followed without re-validation. - Impact: Disclosure of internal service responses and cloud instance metadata (which can include temporary cloud credentials), and the ability to probe/interact with internal-only network services from the server’s network position. The vulnerability primarily impacts confidentiality.
Affected software
- Product: ms-swift (
pkg:pypi/ms-swift), maintained by ModelScope - Affected versions: All versions up to and including 4.5.2
Severity
- CVSS v3.1 Base Score: 7.5 (High) —
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N - CVSS v4.0 Base Score: 8.7 (High) —
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N - CWE-918: Server-Side Request Forgery (SSRF)
Mitigation and recommended actions
- Immediate: No official patched release is currently available. A fix (
_assert_media_url_allowed(), which rejects requests resolving to private, loopback, link-local, reserved, multicast, or unspecified IP ranges, blocks non-HTTP(S) schemes, and re-validates each hop of a redirect) has been proposed upstream but was not merged as of this writing, pending a broader refactor of the multimodal loading path. Security teams should track the upstream repository for a released fix and upgrade as soon as one ships. - If no patch is available:
- Do not expose the
swift deployOpenAI-compatible API directly to untrusted networks; place it behind an authenticating reverse proxy or API gateway and avoid binding to0.0.0.0in untrusted environments. - Enable authentication on the deployment server (do not run with
api_key=None) and restrict inbound access via network ACLs/firewalls to trusted clients only. - Block or filter outbound requests from the host running ms-swift to loopback, private/RFC1918, link-local (including
169.254.169.254), and other reserved IP ranges at the network/egress-firewall layer. - Disable or tightly control cloud instance metadata service access (e.g., enforce IMDSv2 with hop-limit restrictions on AWS, or equivalent metadata protections on other cloud providers) for hosts running this service.
- Monitor egress traffic and logs from ms-swift deployment hosts for anomalous requests to internal IP ranges or metadata endpoints.
- Do not expose the

