Summary
A server-side request forgery (SSRF) vulnerability in pyLoad allows authenticated users with ADD permission to make the server perform arbitrary outbound requests using multiple URL schemes.
By abusing the parse_urls API, an attacker can reach internal network services, cloud metadata endpoints, and even local files from the server environment, enabling information disclosure and pivoting deeper into the infrastructure.
Affected context
This vulnerability exists in deployments of pyLoad that expose the parse_urls API endpoint and grant ADD permissions to users or API tokens.
The issue is triggered when the backend uses get_url(url) with pycurl to fetch user-supplied URLs without:
- Validating or sanitizing the URL
- Restricting allowed protocols (e.g., HTTP(S)-only)
- Filtering or blocking access to internal IP ranges or metadata services
It affects environments where the pyLoad server:
- Has network visibility into internal services (e.g., databases, admin panels, metadata endpoints)
- Can access local filesystem paths readable by the pyLoad process
Exploit preconditions
- Attack surface: pyLoad API endpoint exposing the parse_urls function.
- Required access: Authenticated account or API client with ADD permission.
- Trigger point: Supplying a crafted URL (or list of URLs) to the parse_urls API, which is subsequently passed to get_url(url).
- Why exploitation is possible:
- The URL is treated as fully trusted input.
- pycurl is allowed to use arbitrary protocols (http://, https://, file://, gopher://, dict://, etc.).
- There is no IP range filtering (e.g., 127.0.0.1, 169.254.169.254, RFC1918 networks) or hostname restriction.
- Response differences (error codes vs empty responses) can be observed to infer behavior such as file existence.
Why this happens
The root cause is unvalidated server-side URL fetching in a security-sensitive context, where the application acts as an HTTP client on behalf of an authenticated user.
The parse_urls function forwards user-controlled URLs directly into get_url(url), which uses pycurl without:
- Enforcing a strict allowlist of safe protocols
- Normalizing and validating URLs before use
- Blocking access to internal IP ranges or loopback interfaces
This behavior maps to CWE-918: Server-Side Request Forgery (SSRF): the server is tricked into initiating requests to arbitrary destinations, including internal or local resources, which would not normally be reachable by the attacker.
Potential impact
- Access to internal HTTP/HTTPS services that are not exposed publicly (e.g., admin dashboards, databases, internal APIs).
- Retrieval of cloud instance metadata (e.g., from 169.254.169.254), potentially leaking credentials and configuration secrets.
- Reading contents of local files accessible to the pyLoad process via file:// URLs.
- Interacting with internal services using alternative protocols (gopher://, dict://) for probing, tunneling, or chaining to other vulnerabilities.
- File existence enumeration based on differing error responses (error 37 vs empty response), aiding in targeted attacks.
- Use of the pyLoad server as a pivot point into otherwise isolated network segments.
General mitigation guidance
Effective mitigation focuses on reducing the trust placed in user-supplied URLs and constraining where the server is allowed to connect:
- Implement strict URL validation with an allowlist of protocols, typically limiting to http:// and https:// only.
- Normalize and parse URLs before use, rejecting malformed or ambiguous inputs (e.g., mixed encodings, embedded credentials, or IPv6 literals with obfuscation).
- Enforce network egress restrictions at the application or infrastructure level to prevent access to:
- Loopback and link-local addresses (127.0.0.0/8, ::1, 169.254.0.0/16)
- Private network ranges (e.g., 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16)
- Cloud provider metadata endpoints.
- Introduce a configurable destination allowlist (hostnames or domains) for server-initiated requests.
- Disable, or strictly limit, non-HTTP protocols (file://, gopher://, dict://) in the HTTP client library.
- Apply the principle of least privilege to the pyLoad process, limiting filesystem read permissions and network reach where possible.
How teams detect issues like this
Detection efforts can focus on code patterns, configuration, and runtime behavior:
- Static analysis:
- Flag direct use of HTTP client libraries (e.g., pycurl) where the URL is derived from user input without validation.
- Search for functions that accept URLs or paths and pass them directly into network I/O APIs.
- Enforce linting or custom rules that require protocol and host validation for outbound requests.
- Code review signals:
- APIs or endpoints that accept arbitrary URLs or link targets.
- Missing checks for protocols, hostnames, or IP ranges before making outbound requests.
- Lack of abstraction around network access (e.g., scattered direct pycurl usage instead of a centralized, audited helper).
- Infrastructure and runtime monitoring:
- Network egress logs showing unusual requests from the pyLoad host to internal IPs or metadata endpoints.
- Requests from pyLoad to non-HTTP protocols or unexpected ports.
- Automated SAST/DAST tools:
- Use security scanners that specifically look for SSRF sinks (URL fetchers) tied to user-controlled input.

