{"id":"CVE-2024-32880","kind":"vulnerability","aliases":["CVE-2024-32880","GHSA-3f7w-p8vr-4v5f"],"related":[],"title":"pyLoad allows upload to arbitrary folder lead to RCE","description":"### Summary\nAn authenticated user can change the download folder and upload a crafted template to the specified folder lead to remote code execution\n\n### Details\nexample version: 0.5\nfile:src/pyload/webui/app/blueprints/app_blueprint.py\n```python\n@bp.route(\"/render/<path:filename>\", endpoint=\"render\")\ndef render(filename):\n    mimetype = mimetypes.guess_type(filename)[0] or \"text/html\"\n    data = render_template(filename)\n    return flask.Response(data, mimetype=mimetype)\n```\nSo, if we can control file in the path \"pyload/webui/app/templates\" in latest version and path in \"module/web/media/js\"(the difference is the older version0.4.20 only renders file with  extension name \".js\"), the render_template func will works like SSTI(server-side template injection) when render the evil file we control.\n\nin /settings page and the choose option general/general, where we can change the download folder. \n![image](https://github.com/pyload/pyload/assets/48705773/0b239138-9aaa-45c4-bf84-c1c3103c452a)\n\nAlso, we can find the pyLoad install folder in /info page\n![image](https://github.com/pyload/pyload/assets/48705773/6e9d363a-f0e0-4d25-92b3-b1587188a235)\nSo, we can change the  value of Download folder to the template path. Then through /json/add_package we can upload a crafted template file to RCE.\n```python\n@bp.route(\"/json/add_package\", methods=[\"POST\"], endpoint=\"add_package\")\n# @apiver_check\n@login_required(\"ADD\")\ndef add_package():\n    api = flask.current_app.config[\"PYLOAD_API\"]\n\n    package_name = flask.request.form.get(\"add_name\", \"New Package\").strip()\n    queue = int(flask.request.form[\"add_dest\"])\n    links = [l.strip() for l in flask.request.form[\"add_links\"].splitlines()]\n    pw = flask.request.form.get(\"add_password\", \"\").strip(\"\\n\\r\")\n\n    try:\n        file = flask.request.files[\"add_file\"]\n\n        if file.filename:\n            if not package_name or package_name == \"New Package\":\n                package_name = file.filename\n\n            file_path = os.path.join(\n                api.get_config_value(\"general\", \"storage_folder\"), \"tmp_\" + file.filename\n            )\n            file.save(file_path)\n            links.insert(0, file_path)\n\n    except Exception:\n        pass\n\n    urls = [url for url in links if url.strip()]\n    pack = api.add_package(package_name, urls, queue)\n    if pw:\n        data = {\"password\": pw}\n        api.set_package_data(pack, data)\n\n    return jsonify(True)\n```\n### PoC\nFirst login into the admin page, then visit the info page to get the path of pyload installation folder.\nSecond, change the download folder to PYLOAD_INSTALL_DIR/ webui/app/templates/\nThird, upload crafted template file through /json/add_package through parameter add_file\nthe content of crafted template file and its filename is \"341.html\":\n```\n{{x.__init__.__globals__['__builtins__']['eval'](\"__import__('os').popen('whoami').read()\")}}\n```\n![image](https://github.com/pyload/pyload/assets/48705773/a933a95b-bb18-4e2e-a442-973585e7d1fc)\nLast, visit http://TARGET/render/tmp_341.html to trigger the RCE\n![image](https://github.com/pyload/pyload/assets/48705773/80a1ba00-2774-4ce5-bc9e-dd32f189634e)\n![image](https://github.com/pyload/pyload/assets/48705773/136236f2-9b00-4506-a8ac-29a14a537bbe)\n\n### Impact\nIt is a RCE vulnerability and I think it affects all versions. In earlier version 0.4.20, the trigger difference is the pyload installation folder path difference and the upload file must with extension \".js\"  .\nThe render js code in version 0.4.20:\n```python\n@route(\"/media/js/<path:re:.+\\.js>\")\ndef js_dynamic(path):\n    response.headers['Expires'] = time.strftime(\"%a, %d %b %Y %H:%M:%S GMT\",\n                                                time.gmtime(time.time() + 60 * 60 * 24 * 2))\n    response.headers['Cache-control'] = \"public\"\n    response.headers['Content-Type'] = \"text/javascript; charset=UTF-8\"\n\n    try:\n        # static files are not rendered\n        if \"static\" not in path and \"mootools\" not in path:\n            t = env.get_template(\"js/%s\" % path)\n            return t.render()\n        else:\n            return static_file(path, root=join(PROJECT_DIR, \"media\", \"js\"))\n    except:\n        return HTTPError(404, \"Not Found\")\n```","summary":"pyLoad, a download manager, lets a logged-in user change the download folder to its web templates directory and upload a crafted template there. Requesting that template through the render route runs attacker-chosen Python code on the server.","severity":"critical","cvss":9.1,"epss":0.01354,"exploited":false,"exploited_at":null,"products":[{"name":"pyload-ng","fixed":[],"affected":"<= 0.5.0","ecosystem":"pypi"},{"name":"pyload","fixed":[],"affected":"<= 0.5.0","ecosystem":"vendor"}],"ecosystems":["pypi","vendor"],"tags":["cwe-434","package","pyload-ng","python","self-hosted"],"not_affected_if":["pyload-not-installed","web-ui-not-reachable"],"how_to_check":"- Check the installed version with `pip show pyload-ng`; the affected range is `<= 0.5.0`.\n- Look at the general settings for a download folder inside the pyLoad `webui/app/templates` directory.\n- Check which accounts have the ADD permission, since the attack starts from one.","fix":null,"status":"open","published_at":"2024-04-24T21:16:59+00:00","first_seen_at":"2026-11-16T16:03:22+00:00","triaged_at":"2026-11-16T16:04:56+00:00","updated_at":"2026-11-16T16:08:50+00:00","category":"package","confidence":0.8,"triage":{"at":"2026-11-16T16:04:56Z","model":"claude-haiku-5-5","output":{"fix":"unknown","reach":"network","title":"pyLoad: logged-in users can upload templates and run code","impact":"high","summary":"pyLoad, a download manager, lets a logged-in user change the download folder to its web templates directory and upload a crafted template there. Requesting that template through the render route runs attacker-chosen Python code on the server.","audience":"businesses","category":"package","nicknames":[],"who_cares":["pyload-ng","python","self-hosted"],"confidence":0.8,"fix_status":"unknown","needs_auth":"yes","worst_case":"Attacker runs Python code on the server as pyLoad","analyst_note":"Find the fixed version of pyload-ng in the advisory at https://github.com/advisories/GHSA-3f7w-p8vr-4v5f, since the product data lists no fix.","how_to_check":"- Check the installed version with `pip show pyload-ng`; the affected range is `<= 0.5.0`.\n- Look at the general settings for a download folder inside the pyLoad `webui/app/templates` directory.\n- Check which accounts have the ADD permission, since the attack starts from one.","plain_action":"","product_name":"","needs_analyst":true,"not_affected_if":["pyload-not-installed","web-ui-not-reachable"],"who_is_affected":"Any pyLoad instance with its web interface reachable by a user who can change settings and add packages is exposed. The install path is shown on the info page, which makes the file upload easier to aim. Teams that do not run pyLoad, or that keep its web interface off untrusted networks, can skip it.","user_interaction":"no","product_ecosystem":"","needs_special_setup":"no","severity_if_unknown":"unknown"},"cost_usd":0.001622,"input_tokens":6110,"output_tokens":2021,"severity_before":"critical"},"analyst_status":"queued","analyst_note":"Find the fixed version of pyload-ng in the advisory at https://github.com/advisories/GHSA-3f7w-p8vr-4v5f, since the product data lists no fix.","search":"'-2024':11A,19A '-32880':12A,20A '-434':26B '-8':515C '/info':207C '/json/add_package':228C,240C,391C '/media/js':478C '/pyload/pyload/assets/48705773/0b239138-9aaa-45c4-bf84-c1c3103c452a)':197C '/pyload/pyload/assets/48705773/136236f2-9b00-4506-a8ac-29a14a537bbe)':433C '/pyload/pyload/assets/48705773/6e9d363a-f0e0-4d25-92b3-b1587188a235)':212C '/pyload/pyload/assets/48705773/80a1ba00-2774-4ce5-bc9e-dd32f189634e)':429C '/pyload/pyload/assets/48705773/a933a95b-bb18-4e2e-a442-973585e7d1fc)':418C '/render':107C '/settings':180C '0':117C,321C '0.4.20':450C,475C '0.5':102C '2':502C '24':501C '341.html':406C '3f7w':15A '4v5f':17A '60':499C,500C 'add':244C,250C,252C,261C,269C,277C,282C,290C,394C 'admin':360C 'affect':444C 'allow':2A 'also':198C 'api':254C,257C 'api.add':336C 'api.get':309C 'api.set':347C 'apiv':246C 'arbitrari':5A 'attack':69B 'attacker-chosen':68B 'authent':78C 'b':491C 'bp.route':106C,239C 'builtin':408C 'cach':505C 'cache-control':504C 'chang':45B,81C,190C,216C,376C 'charset':513C 'check':247C 'choos':184C 'chosen':70B 'code':72B,97C,472C 'config':310C 'content':397C,510C 'content-typ':509C 'control':133C,178C,506C 'craft':57B,88C,233C,387C,399C 'cve':10A,18A 'cwe':25B 'd':490C 'data':120C,126C,344C,349C,351C 'def':110C,251C,482C 'dest':270C 'detail':99C 'differ':147C,453C,460C 'dir':383C 'directori':53B 'download':37B,47B,83C,192C,220C,378C 'dynam':484C 'earlier':448C 'endpoint':108C,243C 'env.get':533C 'eval':409C 'evil':175C 'exampl':100C 'except':324C,325C 'execut':98C 'expir':487C 'extens':156C,467C 'file':103C,134C,154C,176C,235C,288C,291C,306C,318C,322C,389C,395C,401C,464C,518C 'file.filename':293C,305C,316C 'file.save':317C 'filenam':112C,116C,123C,404C 'find':201C 'first':356C 'flask.current_app.config':255C 'flask.request.files':289C 'flask.request.form':268C,276C 'flask.request.form.get':260C,281C 'flask.response':125C 'folder':6A,48B,84C,93C,193C,205C,221C,314C,374C,379C,458C 'func':162C 'general':312C 'general/general':186C 'get':368C 'ghsa':14A 'ghsa-3f7w-p8vr-4v5f':13A 'github.com':196C,211C,417C,428C,432C 'github.com/pyload/pyload/assets/48705773/0b239138-9aaa-45c4-bf84-c1c3103c452a)':195C 'github.com/pyload/pyload/assets/48705773/136236f2-9b00-4506-a8ac-29a14a537bbe)':431C 'github.com/pyload/pyload/assets/48705773/6e9d363a-f0e0-4d25-92b3-b1587188a235)':210C 'github.com/pyload/pyload/assets/48705773/80a1ba00-2774-4ce5-bc9e-dd32f189634e)':427C 'github.com/pyload/pyload/assets/48705773/a933a95b-bb18-4e2e-a442-973585e7d1fc)':416C 'gmt':496C 'h':493C 'host':34B 'imag':194C,209C,415C,426C,430C 'impact':434C 'import':410C 'info':365C 'inject':171C 'instal':204C,373C,382C,457C 'int':267C 'j':535C 'js':158C,468C,471C,481C,483C 'jsonifi':353C 'l':274C 'l.strip':272C 'last':419C 'latest':140C 'lead':7A,94C 'let':39B 'like':165C 'link':271C,278C,332C 'links.insert':320C 'log':42B 'logged-in':41B 'login':248C,357C 'm':494C 'manag':38B 'method':241C 'mimetyp':113C,127C,128C 'mimetypes.guess':114C 'module/web/media/js':145C 'mootool':528C 'must':465C 'n':285C 'name':157C,259C,262C,297C,300C,304C,339C 'new':263C,301C 'ng':23A,30B 'older':150C 'option':185C 'os':411C 'os.path.join':308C 'p8vr':16A 'pack':335C,350C 'packag':27B,245C,253C,258C,264C,296C,299C,302C,303C,337C,338C,348C 'page':181C,208C,361C,366C 'paramet':393C 'pass':326C 'password':283C,345C 'path':137C,143C,225C,307C,319C,323C,370C,459C,479C,485C,526C,531C 'poc':355C 'popen':412C 'post':242C 'public':507C 'pw':280C,343C,346C 'pyload':1A,22A,24A,29B,35B,203C,256C,372C,381C,456C 'pyload-ng':21A,28B 'pyload/webui/app/templates':138C 'python':31B,71B,105C,238C,476C 'queue':266C,341C 'r':286C 'rce':9A,237C,425C,438C 're':480C 'read':414C 'remot':96C 'render':65B,109C,111C,121C,153C,160C,173C,470C,521C 'request':60B 'requir':249C 'response.headers':486C,503C,508C 'return':124C,352C 'rout':66B,477C 'run':67B 'second':375C 'self':33B 'self-host':32B 'server':75B,168C 'server-sid':167C 'side':169C 'specifi':92C 'splitlin':279C 'src/pyload/webui/app/blueprints/app_blueprint.py':104C 'ssti':166C 'static':517C,523C 'storag':313C 'strip':265C,284C 'summari':76C 'target/render/tmp_341.html':421C 'templat':52B,58B,62B,89C,122C,161C,170C,224C,234C,388C,400C,534C 'text/html':119C 'text/javascript':512C 'think':442C 'third':385C 'time.gmtime':497C 'time.strftime':488C 'time.time':498C 'tmp':315C 'tri':287C,516C 'trigger':423C,452C 'true':354C 'type':115C,511C 'upload':3A,55B,86C,231C,386C,463C 'url':327C,328C,330C,340C 'url.strip':334C 'user':44B,79C 'utf':514C 'valu':218C,311C 'version':101C,141C,446C,449C,474C 'version0.4.20':151C 'visit':363C,420C 'vulner':439C 'web':51B 'webui/app/templates':384C 'whoami':413C 'work':164C 'x.__init__.__globals__':407C 'y':492C","nicknames":[],"mitigations":[],"who_affected":"Any pyLoad instance with its web interface reachable by a user who can change settings and add packages is exposed. The install path is shown on the info page, which makes the file upload easier to aim. Teams that do not run pyLoad, or that keep its web interface off untrusted networks, can skip it.","tier":"B","verified":{},"analyst_revisit_at":null,"fix_status":"none","audience":"businesses","plain_action":null,"pkeys":["pyload","pyloadng"],"ptokens":["ng","pyload"],"labels":["critical","cwe434","package","pyloadng","pypi","python","selfhosted","vendor"],"campaign_type":null,"search_a":"'-2024':11A,19A '-32880':12A,20A '3f7w':15A '4v5f':17A 'allow':2A 'arbitrari':5A 'cve':10A,18A 'folder':6A 'ghsa':14A 'ghsa-3f7w-p8vr-4v5f':13A 'lead':7A 'ng':23A 'p8vr':16A 'pyload':1A,22A,24A 'pyload-ng':21A 'rce':9A 'upload':3A","search_b":"'-434':26B 'attack':69B 'attacker-chosen':68B 'chang':45B 'chosen':70B 'code':72B 'craft':57B 'cwe':25B 'directori':53B 'download':37B,47B 'folder':48B 'host':34B 'let':39B 'log':42B 'logged-in':41B 'manag':38B 'ng':30B 'packag':27B 'pyload':29B,35B 'pyload-ng':28B 'python':31B,71B 'render':65B 'request':60B 'rout':66B 'run':67B 'self':33B 'self-host':32B 'server':75B 'templat':52B,58B,62B 'upload':55B 'user':44B 'web':51B","search_c":"'-8':515C '/info':207C '/json/add_package':228C,240C,391C '/media/js':478C '/pyload/pyload/assets/48705773/0b239138-9aaa-45c4-bf84-c1c3103c452a)':197C '/pyload/pyload/assets/48705773/136236f2-9b00-4506-a8ac-29a14a537bbe)':433C '/pyload/pyload/assets/48705773/6e9d363a-f0e0-4d25-92b3-b1587188a235)':212C '/pyload/pyload/assets/48705773/80a1ba00-2774-4ce5-bc9e-dd32f189634e)':429C '/pyload/pyload/assets/48705773/a933a95b-bb18-4e2e-a442-973585e7d1fc)':418C '/render':107C '/settings':180C '0':117C,321C '0.4.20':450C,475C '0.5':102C '2':502C '24':501C '341.html':406C '60':499C,500C 'add':244C,250C,252C,261C,269C,277C,282C,290C,394C 'admin':360C 'affect':444C 'also':198C 'api':254C,257C 'api.add':336C 'api.get':309C 'api.set':347C 'apiv':246C 'authent':78C 'b':491C 'bp.route':106C,239C 'builtin':408C 'cach':505C 'cache-control':504C 'chang':81C,190C,216C,376C 'charset':513C 'check':247C 'choos':184C 'code':97C,472C 'config':310C 'content':397C,510C 'content-typ':509C 'control':133C,178C,506C 'craft':88C,233C,387C,399C 'd':490C 'data':120C,126C,344C,349C,351C 'def':110C,251C,482C 'dest':270C 'detail':99C 'differ':147C,453C,460C 'dir':383C 'download':83C,192C,220C,378C 'dynam':484C 'earlier':448C 'endpoint':108C,243C 'env.get':533C 'eval':409C 'evil':175C 'exampl':100C 'except':324C,325C 'execut':98C 'expir':487C 'extens':156C,467C 'file':103C,134C,154C,176C,235C,288C,291C,306C,318C,322C,389C,395C,401C,464C,518C 'file.filename':293C,305C,316C 'file.save':317C 'filenam':112C,116C,123C,404C 'find':201C 'first':356C 'flask.current_app.config':255C 'flask.request.files':289C 'flask.request.form':268C,276C 'flask.request.form.get':260C,281C 'flask.response':125C 'folder':84C,93C,193C,205C,221C,314C,374C,379C,458C 'func':162C 'general':312C 'general/general':186C 'get':368C 'github.com':196C,211C,417C,428C,432C 'github.com/pyload/pyload/assets/48705773/0b239138-9aaa-45c4-bf84-c1c3103c452a)':195C 'github.com/pyload/pyload/assets/48705773/136236f2-9b00-4506-a8ac-29a14a537bbe)':431C 'github.com/pyload/pyload/assets/48705773/6e9d363a-f0e0-4d25-92b3-b1587188a235)':210C 'github.com/pyload/pyload/assets/48705773/80a1ba00-2774-4ce5-bc9e-dd32f189634e)':427C 'github.com/pyload/pyload/assets/48705773/a933a95b-bb18-4e2e-a442-973585e7d1fc)':416C 'gmt':496C 'h':493C 'imag':194C,209C,415C,426C,430C 'impact':434C 'import':410C 'info':365C 'inject':171C 'instal':204C,373C,382C,457C 'int':267C 'j':535C 'js':158C,468C,471C,481C,483C 'jsonifi':353C 'l':274C 'l.strip':272C 'last':419C 'latest':140C 'lead':94C 'like':165C 'link':271C,278C,332C 'links.insert':320C 'login':248C,357C 'm':494C 'method':241C 'mimetyp':113C,127C,128C 'mimetypes.guess':114C 'module/web/media/js':145C 'mootool':528C 'must':465C 'n':285C 'name':157C,259C,262C,297C,300C,304C,339C 'new':263C,301C 'older':150C 'option':185C 'os':411C 'os.path.join':308C 'pack':335C,350C 'packag':245C,253C,258C,264C,296C,299C,302C,303C,337C,338C,348C 'page':181C,208C,361C,366C 'paramet':393C 'pass':326C 'password':283C,345C 'path':137C,143C,225C,307C,319C,323C,370C,459C,479C,485C,526C,531C 'poc':355C 'popen':412C 'post':242C 'public':507C 'pw':280C,343C,346C 'pyload':203C,256C,372C,381C,456C 'pyload/webui/app/templates':138C 'python':105C,238C,476C 'queue':266C,341C 'r':286C 'rce':237C,425C,438C 're':480C 'read':414C 'remot':96C 'render':109C,111C,121C,153C,160C,173C,470C,521C 'requir':249C 'response.headers':486C,503C,508C 'return':124C,352C 'rout':477C 'second':375C 'server':168C 'server-sid':167C 'side':169C 'specifi':92C 'splitlin':279C 'src/pyload/webui/app/blueprints/app_blueprint.py':104C 'ssti':166C 'static':517C,523C 'storag':313C 'strip':265C,284C 'summari':76C 'target/render/tmp_341.html':421C 'templat':89C,122C,161C,170C,224C,234C,388C,400C,534C 'text/html':119C 'text/javascript':512C 'think':442C 'third':385C 'time.gmtime':497C 'time.strftime':488C 'time.time':498C 'tmp':315C 'tri':287C,516C 'trigger':423C,452C 'true':354C 'type':115C,511C 'upload':86C,231C,386C,463C 'url':327C,328C,330C,340C 'url.strip':334C 'user':79C 'utf':514C 'valu':218C,311C 'version':101C,141C,446C,449C,474C 'version0.4.20':151C 'visit':363C,420C 'vulner':439C 'webui/app/templates':384C 'whoami':413C 'work':164C 'x.__init__.__globals__':407C 'y':492C","cause_entry":null,"cause_path":null,"disclosures_checked_at":null,"first_public_at":"2024-04-24T20:42:50+00:00","kev":null,"cvss_vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H","cvss_by":"GitHub","poc_count":0,"sources":[{"source":"ghsa","external_id":"GHSA-3f7w-p8vr-4v5f","url":"https://github.com/advisories/GHSA-3f7w-p8vr-4v5f","severity":"critical","published_at":"2024-04-24T21:16:59+00:00","modified_at":"2026-11-16T16:02:08+00:00","first_seen_at":"2026-11-16T16:03:22+00:00","fetched_at":"2026-11-16T16:07:02+00:00","note":null},{"source":"nvd","external_id":"CVE-2024-32880","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-32880","severity":null,"published_at":"2024-04-26T18:15:45+00:00","modified_at":"2026-06-17T07:30:36+00:00","first_seen_at":"2026-11-16T16:08:50+00:00","fetched_at":"2026-11-16T16:08:50+00:00","note":null}],"documents":[{"id":170864,"url":"https://api.github.com/repos/pyload/pyload/security-advisories/GHSA-3f7w-p8vr-4v5f","title":"Maintainer's advisory: api.github.com","kind":"vendor","source":"ghsa","publisher":"vendor","text":null,"published_at":null,"relation":"advisory","confidence":null,"note":"Maintainer's advisory: api.github.com"},{"id":170865,"url":"https://github.com/pyload/pyload/security/advisories/GHSA-3f7w-p8vr-4v5f","title":"Maintainer's advisory: github.com","kind":"vendor","source":"ghsa","publisher":"vendor","text":null,"published_at":"2024-04-24T20:42:50+00:00","relation":"advisory","confidence":null,"note":"Maintainer's advisory: github.com"}],"disclosures":[],"exploit_sources":[{"type":"epss","score":0.01354,"url":"https://api.first.org/data/v1/epss?cve=CVE-2024-32880"}],"notice":"Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai"}