Summary
MoviePilot v2 contains a server-side request forgery (SSRF) flaw in its image proxy endpoint that lets authenticated users make the server issue HTTP requests to arbitrary URLs that pass a weak domain-based allowlist check.
By abusing the resource_token cookie and crafting URLs whose domains appear allowed, attackers can pivot through the MoviePilot server to reach internal services, enumerate media servers like Jellyfin/Emby/Plex, and exfiltrate data from otherwise protected internal network resources.
Affected context
This vulnerability appears in MoviePilot v2 deployments where:
- The image proxy endpoint is exposed to authenticated users
- A
resource_tokencookie is accepted as proof of access to proxied resources - URL validation relies on
SecurityUtils.is_safe_urlusing only domain-membership checks - The server has network connectivity to internal services (e.g., internal Jellyfin, Emby, Plex instances or other intranet HTTP endpoints)
In such environments, the MoviePilot server can act as a bridge into internal networks because private, loopback, and link-local addresses are not excluded from proxying.
Exploit preconditions
- Attack surface: HTTP(S) access to the MoviePilot image proxy endpoint.
- Required access: Authenticated MoviePilot account, plus a valid
resource_tokencookie (or the ability to obtain or reuse one). - Trigger point: Supplying a crafted URL to the image proxy such that the hostname passes the domain allowlist used by
SecurityUtils.is_safe_url. - Why exploitation is possible:
- The URL safety check only verifies that the domain appears in an assembled allowlist and does not verify the effective destination IP.
- No specific protections exist against private, loopback, or link-local IP ranges, nor against DNS rebinding or hostnames that resolve internally.
- As a result, the MoviePilot backend will initiate HTTP requests on behalf of the attacker to internal or otherwise restricted targets and return the responses.
Why this happens
The root cause is a flawed SSRF defense strategy where URL validation is based solely on domain-membership checking rather than on the effective destination network location.
The SecurityUtils.is_safe_url routine is intended to enforce an allowlist but:
- Only verifies that the domain component appears allowed.
- Does not filter or reject URLs resolving to private, loopback, or link-local addresses.
- Does not perform IP-based checks after DNS resolution or protect against hostnames pointing to internal services.
Conceptually, this maps to CWE-918: Server-Side Request Forgery, where untrusted user input is used to construct outbound requests from a privileged server component without robust validation of the target. The image proxy endpoint becomes an unintended generic HTTP client into the internal network.
Potential impact
- Enumeration of internal HTTP services (e.g., discovering Jellyfin, Emby, Plex, or other internal applications).
- Exfiltration of sensitive data from intranet endpoints accessible to the MoviePilot server.
- Access to management interfaces or APIs bound only to internal IPs, potentially including administrative panels.
- Use of the MoviePilot host as a pivot point for further attacks against internal infrastructure.
- Circumvention of network-layer controls such as firewalls and NAT that would normally block external access.
General mitigation guidance
Effective mitigation focuses on hardening outbound request validation and minimizing trust in user-supplied URLs for proxying:
- Replace naive domain-based allowlisting with:
- IP and network-based checks that reject private, loopback, link-local, and link-layer addresses (e.g., RFC1918, 127.0.0.0/8, ::1, fe80::/10).
- Validation performed after DNS resolution to ensure the final destination is acceptable.
- Restrict the image proxy to a small set of known-safe external hosts or CDNs rather than allowing arbitrary URLs.
- Consider decoupling user-controlled URL input from direct server-side fetching, e.g., by:
- Using signed, pre-resolved resource identifiers instead of arbitrary URLs.
- Employing a dedicated, locked-down proxy service with strict egress rules.
- Apply network-level least privilege:
- Limit the MoviePilot server's ability to reach internal services not strictly required for its function.
- Use firewall rules, container network policies, or service meshes to block unnecessary outbound traffic.
- Implement defense-in-depth checks:
- Enforce maximum redirect depth and deny redirects to disallowed address ranges.
- Normalize and re-parse URLs to avoid bypasses via alternative encodings or schemes.
How teams detect issues like this
Detection can combine code-centric analysis with operational monitoring:
- Static analysis & code review:
- Flag any endpoints that perform server-side fetches based on user-controlled URLs, cookies, or parameters.
- Review helper utilities like
SecurityUtils.is_safe_urlfor: - Overreliance on host/domain string checks.
- Absence of IP/CIDR validation and DNS resolution checks.
- Search for image proxy or URL proxying patterns that don't enforce strict allowlists or IP sanitization.
- Configuration and policy enforcement:
- Use security linters or policies that require network egress checks around HTTP client usages in web handlers.
- Enforce coding standards that mandate centralized, hardened URL validation routines.
- Runtime monitoring:
- Log outbound HTTP target hosts and IPs from MoviePilot and alert on:
- Requests to private or loopback address ranges.
- Unusual domains or spikes in outbound connections originating from proxy endpoints.
- Employ network monitoring or IDS/IPS rules to detect lateral movement patterns or unexpected internal scanning from the MoviePilot host.

