CVE-2025-55156: Pyload ng SQL Injection Vulnerability
HIGHCVE-2025-55156 is a HIGH sql injection vulnerability (CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')) affecting Pyload ng libraries in the PyPI ecosystem. The issue involves pyload vulnerable to sql injection via api /json/add_package in add_links parameter. Remediation is available by upgrading affected packages to version 0.5.0b3.dev91.
CVE-2025-55156 at a Glance
How to Fix CVE-2025-55156
To remediate this vulnerability, upgrade all affected Pyload ng dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install pyload-ng>=0.5.0b3.dev91
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show pyload-ng
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2025-55156, inspect your installed packages using pip:
pip show pyload-ng
Analyze the terminal output to locate any version of Pyload ng in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.5.0b3.dev91), your application is affected.
Note: The pip show pyload-ng command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where the product constructs all or part of an sql command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended sql command when it is sent to a downstream component. without sufficient removal or quoting of sql syntax in user-controllable inputs, the generated sql query can cause those inputs to be interpreted as sql instead of ordinary user data. In Pyload ng, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2025-55156 Affected Pyload ng Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
pyload-ng
|
PyPI |
< 0.5.0b3.dev91
|
0.5.0b3.dev91
|
References
Frequently Asked Questions
What is CVE-2025-55156?
Which Pyload ng versions are affected?
What version fixes CVE-2025-55156?
Is pyload-ng affected?
What CWE is associated with CVE-2025-55156?
How can I check PyPI dependencies for CVE-2025-55156?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-pwh4-6r3m-j2rf",
"modified" : "2025-08-12T13:16:38Z",
"published" : "2025-08-12T00:13:46Z",
"aliases" : [ "CVE-2025-55156" ],
"summary" : "PyLoad vulnerable to SQL Injection via API /json/add_package in add_links parameter",
"details" : "### 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.",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "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"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "pyload-ng"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.5.0b3.dev91"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/pyload/pyload/security/advisories/GHSA-pwh4-6r3m-j2rf"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-55156"
}, {
"type" : "WEB",
"url" : "https://github.com/pyload/pyload/commit/134edcdf6e2a10c393743c254da3d9d90b74258f"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/pyload/pyload"
}, {
"type" : "WEB",
"url" : "https://github.com/pyload/pyload/blob/develop/src/pyload/core/database/file_database.py#L271"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-89" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2025-08-12T00:13:46Z",
"nvd_published_at" : "2025-08-11T23:15:26Z"
}
}