GHSA-p3pr-8f3m-4qp8: SSRF
Summary
pyLoad ships the WindowsPhoneNotify addon, whose send() method opens an HTTP connection to a host taken directly from the plugin's pushurl configuration value. A user holding the standard non-admin SETTINGS permission can set pushurl and pushid and enable the addon through the web API, since these plugin options are not in the admin-only option set. Once enabled, the addon activates dynamically without a restart, and any completed download (download events fire globally, not per user) causes the addon to send an HTTP POST to the configured host and path. The request is made with Python's http.client.HTTPConnection, so it never passes through pyLoad's pycurl-based outbound connection guard. The attacker can therefore direct blind POST requests at internal hosts such as loopback services, RFC 1918 addresses, or the cloud metadata endpoint 169.254.169.254.
Root Cause
pyLoad enforces its outbound SSRF protection only inside the pycurl request path, where a PREREQFUNCTION callback calls isglobaladdress() on the resolved peer IP before each connection. The WindowsPhoneNotify addon uses a completely separate HTTP client (http.client.HTTPConnection) that is never subjected to that callback and performs no address validation of its own. In addition, the API config-write authorization only guards a narrow hard-coded set of plugin options, which does not include the WindowsPhoneNotify host and path fields, so a non-admin user can point the notifier at any destination.
text Affected symbols: - WindowsPhoneNotify.send (src/pyload/plugins/addons/WindowsPhoneNotify.py): opens http.client.HTTPConnection(url) on the attacker-controlled pushurl with no destination check. - Api.setconfigvalue (src/pyload/core/api/init.py): ADMINONLYPLUGINOPTIONS contains only AntiVirus entries, so a non-admin SETTINGS user can write the WindowsPhoneNotify pushurl, pushid, and enabled values.
Impact
An authenticated user with the non-admin SETTINGS permission can cause the pyLoad server to issue blind HTTP POST requests to arbitrary internal hosts, ports, and paths that the user cannot reach directly. The attacker controls the destination host and port (pushurl), the request path (pushid), and part of the XML request body (through file and package names surfaced in the notification text). Because the request is blind, response bodies are not returned; the demonstrated capability is internal service discovery, port and host probing through timing or error differences, cloud metadata endpoint reachability where the network routes it, and triggering state changes on internal HTTP endpoints that act on POST requests. Confidentiality and integrity impact are limited but real; no direct availability impact was demonstrated.
Proof of Concept
text Preconditions: an authenticated pyLoad account with the SETTINGS permission (128), a network path from the pyLoad host to the chosen internal target, and at least one download that completes to fire the notification event.
1. As a user with the SETTINGS permission, POST to /json/saveconfig with category="plugin" and config values WindowsPhoneNotify|pushurl=169.254.169.254, WindowsPhoneNotify|pushid=/latest/meta-data/, and WindowsPhoneNotify|enabled=True. 2. The write is accepted because (WindowsPhoneNotify, pushurl) is not in the admin-only option set, and setting enabled to true triggers the addon manager's dynamic activation callback, loading the plugin immediately. 3. Allow (or cause) any download to finish. The global downloadfinished event iterates activated addons and invokes the notifier.
text POST /json/saveconfig HTTP/1.1 Host: pyload.target Cookie: <authenticated session with SETTINGS> Content-Type: application/x-www-form-urlencoded
category=plugin&config=%7B%22WindowsPhoneNotify%7Cenabled%22%3A%22True%22%2C%22WindowsPhoneNotify%7Cpushurl%22%3A%22169.254.169.254%22%2C%22WindowsPhoneNotify%7Cpushid%22%3A%22%2Flatest%2Fmeta-data%2F%22%7D
text Observed result: on the next completed download, the pyLoad process opens a TCP connection to 169.254.169.254:80 and sends "POST /latest/meta-data/" with a text/xml notification body. The connection is made by http.client.HTTPConnection with no address validation.
Attack Chain
1. Exposure: The /json/saveconfig web endpoint is network reachable and gated only by loginrequired("SETTINGS"), a standard non-admin permission bit. 2. Control: The attacker supplies the notifier pushurl (host and port), pushid (request path), and enabled flag as config values. 3. Path: setconfigvalue writes the plugin options; the addon manager's config-change callback fires on enabled and activates the addon without a restart; a completed download dispatches the global downloadfinished event to activated addons. 4. Guard: The config-write check consults ADMINONLYPLUGINOPTIONS, which lists only two AntiVirus options, so the notifier fields pass; the notifier rate and client-connection checks do not block the request; the pycurl PREREQFUNCTION SSRF guard and isglobaladdress are never invoked on this path. 5. Primitive: WindowsPhoneNotify.send() calls http.client.HTTPConnection(pushurl) and issues a POST to pushid. 6. Result: A blind HTTP POST reaches an attacker-chosen internal host and path from the pyLoad server's network position.
Bypass Evidence
pyLoad's outbound SSRF protection lives entirely in the pycurl request path: isglobaladdress() is called only from the pycurl PREREQFUNCTION callback, and isglobalhost() is called only from URL parsing for user-submitted download links. Neither helper appears anywhere in the notifier dispatch path. The WindowsPhoneNotify sink uses http.client.HTTPConnection, which has no relationship to pycurl and no destination validation, so the guard is not bypassed by a payload trick but is simply not present on this code path. Attempts to disprove the finding were made and failed: the SETTINGS permission is a non-admin bit that an admin can grant independently of the admin role; the admin-only plugin option set does not contain the notifier fields; the dynamic activation callback fires on enabled and the activation and download-event handlers share a lock so there is no activation race; the notifier key-emptiness, client-connection, and rate-limit checks all pass with attacker-chosen non-empty values and default settings; and the testing plugin status is loadable (only broken is rejected).
Affected Versions
- Ecosystem: pip - Package: pyload-ng - Confirmed affected range: <= 0.5.0b3.dev101 - Latest release checked: pyload-ng 0.5.0b3.dev101 (PyPI sdist, sha256 427cfb35bc8e0db104e86a53576b2fdef99127aec178b80f58380a7977130251) - Fix status: not fixed in any released version
The vulnerable send() method and the narrow admin-only plugin option set are present in the latest published PyPI artifact, pyloadng-0.5.0b3.dev101. The project publishes only prerelease builds; there is no final 0.5.0 release, so the upper bound is the latest published prerelease. The introduction point was not bisected, so the range uses an open lower bound; the WindowsPhoneNotify addon carries an internal plugin version of 0.19, indicating a long history. No published version contains a fix.
Suggested Fix
Enforce the same outbound destination policy on every HTTP client pyLoad uses, not only the pycurl path. Before the notifier opens a connection, resolve the configured host and reject non-global or otherwise disallowed destinations using the existing isglobalhost / isglobaladdress logic (including the IPv6 transition-form handling), or route all addon HTTP traffic through a single hardened client that applies the guard. As defense in depth, add the WindowsPhoneNotify host and path options (and any other plugin option that designates a network destination) to the admin-only option set so a non-admin SETTINGS user cannot repoint them. Interim mitigation: restrict the SETTINGS permission to trusted accounts and ensure the pyLoad host cannot reach sensitive internal endpoints such as the cloud metadata service.
Reported by zx (GitHub: @manus-pi).
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Configuration
Add the WindowsPhoneNotify host and path options, and other plugin options that designate network destinations, to ADMIN_ONLY_PLUGIN_OPTIONS so non-admin SETTINGS users cannot repoint them.
pyLoad API ADMIN_ONLY_PLUGIN_OPTIONS = Include WindowsPhoneNotify|pushurl and WindowsPhoneNotify|pushid - Compensating control
Before any notifier connection, resolve the configured host and reject non-global or otherwise disallowed destinations using the existing is_global_host/is_global_address logic, including IPv6 transition-form handling; enforce the same outbound destination policy for every HTTP client pyLoad uses.
- Compensating control
Restrict the SETTINGS permission to trusted accounts and prevent the pyLoad host from reaching sensitive internal endpoints such as 169.254.169.254.
Event History
Frequently Asked Questions
Who can exploit this through the pyLoad web API?
A user with the standard non-admin SETTINGS permission can configure the addon’s pushurl and pushid values and enable the addon. These options are not restricted to the admin-only option set.
Does exploitation require an administrator action or a service restart?
No. The affected addon can be enabled dynamically through the web API, without restarting pyLoad. After it is enabled, a completed download triggers the request.
What systems can the resulting requests target?
The configured host and path are used directly for an HTTP POST, allowing blind requests to internal destinations such as loopback services, RFC 1918 addresses, and the cloud metadata endpoint at 169.254.169.254. Download events are global rather than per-user, so any completed download can provide the trigger.