CVE-2024-0524
Executive Summary
CVE-2024-0524 is a critical SQL injection vulnerability discovered in CXBSoft Url-shorting, a URL shortening application, up to version 1.3.1. The vulnerability resides in the index.php file, where the url parameter is not properly sanitized before being used in a SQL query. This allows an unauthenticated attacker to inject arbitrary SQL commands, potentially leading to unauthorized data access, modification, or deletion. The exploit has been publicly disclosed, and no patch is currently available from the vendor, who did not respond to disclosure attempts. The CVSS score is 5.5 (Medium), but the impact is considered critical due to the ease of exploitation and potential for data compromise.
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 specific package manager (NPM, PyPI, Go, Ruby). It is a standalone PHP application. However, organizations using CXBSoft Url-shorting should treat it as a high-risk component in their software supply chain due to the lack of vendor support and public exploit availability.
CVSS Breakdown & Threat Level
- CVSS Score: 5.5 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N
- Attack Vector: Network (AV:N) – The vulnerability can be exploited remotely.
- Attack Complexity: Low (AC:L) – No special conditions are required.
- 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: None (A:N) – No direct denial of service.
Threat Level: High. Despite the medium CVSS score, the public availability of a working exploit and the lack of a patch make this a significant threat. An attacker can easily enumerate databases, extract sensitive information, and potentially escalate privileges.
Deep Dive & Mechanics
The vulnerability is a classic SQL injection in the index.php file of CXBSoft Url-shorting. The application likely takes a user-supplied URL via the url parameter (e.g., index.php?url=http://example.com) and stores it in a database. The code does not properly sanitize or parameterize the input before constructing a SQL query.
Vulnerable Code Snippet (Conceptual):
<?php
$url = $_GET['url'];
$sql = "INSERT INTO urls (original_url) VALUES ('$url')";
$result = mysqli_query($conn, $sql);
?>
An attacker can inject SQL by providing a malicious value for the url parameter. For example:
index.php?url='); DROP TABLE urls; --
This would result in the following SQL query:
INSERT INTO urls (original_url) VALUES (''); DROP TABLE urls; --')
The -- comments out the rest of the query, allowing the attacker to execute arbitrary SQL commands.
Vulnerable vs. Patched Code
Vulnerable Code (Conceptual):
<?php
$url = $_GET['url'];
$sql = "INSERT INTO urls (original_url) VALUES ('$url')";
$result = mysqli_query($conn, $sql);
?>
Patched Code (Conceptual):
<?php
$url = $_GET['url'];
$stmt = $conn->prepare("INSERT INTO urls (original_url) VALUES (?)");
$stmt->bind_param("s", $url);
$stmt->execute();
?>
The patched version uses prepared statements with parameterized queries, which prevents SQL injection by separating SQL logic from user input. Since no official patch is available, this is a recommended fix.
Exploitation & Lab Setup
Red Team (Offensive)
Prerequisites:
- A target running CXBSoft Url-shorting <= 1.3.1.
- A web browser or tool like
curl.
Exploit Steps:
- Identify the vulnerable endpoint:
http://target/index.php?url=. - Test for SQL injection by injecting a single quote (
') and observing an error. - Use a payload to extract data. For example, to retrieve all tables:
index.php?url=' UNION SELECT table_name FROM information_schema.tables -- - To extract user credentials (if stored):
index.php?url=' UNION SELECT username, password FROM users --
Example using curl:
curl "http://target/index.php?url=' UNION SELECT 1,2,3 --"
Blue Team (Defensive)
Detection:
- Monitor web server logs for unusual SQL keywords in the
urlparameter (e.g.,UNION,SELECT,DROP,--). - Use a Web Application Firewall (WAF) to block SQL injection patterns.
- Implement input validation and parameterized queries.
Honeypot:
- Deploy a honeypot that mimics the vulnerable application to capture attacker behavior.
Indicators of Compromise (IOCs)
- Network IOCs:
- HTTP requests to
index.phpwith theurlparameter containing SQL keywords. - Unusual database error messages in HTTP responses.
- HTTP requests to
- File IOCs:
- Modified
index.phpfile (if attacker uploads a web shell). - New files in the web root (e.g.,
shell.php).
- Modified
- Log IOCs:
- Web server logs showing SQL injection attempts.
- Database logs showing unexpected queries.
Detection Engineering
YARA Rule
rule CVE_2024_0524_SQLi_Detection {
meta:
description = "Detects SQL injection attempts targeting CVE-2024-0524 in CXBSoft Url-shorting"
author = "Valters IT"
date = "2024-01-01"
reference = "https://nvd.nist.gov/vuln/detail/CVE-2024-0524"
strings:
$sqli1 = "UNION SELECT" nocase
$sqli2 = "DROP TABLE" nocase
$sqli3 = "information_schema" nocase
$sqli4 = "1=1" nocase
$sqli5 = "admin' --" nocase
condition:
any of ($sqli*)
}
Sigma Rule
title: CVE-2024-0524 SQL Injection Attempt
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects SQL injection attempts against CXBSoft Url-shorting
author: Valters IT
logsource:
category: webserver
product: apache
detection:
selection:
c-uri|contains: "index.php"
cs-uri-query|contains:
- "UNION SELECT"
- "DROP TABLE"
- "information_schema"
- "1=1"
- "admin' --"
condition: selection
falsepositives:
- Legitimate use of SQL keywords in URL (unlikely)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-0524 SQL Injection Attempt"; flow:to_server; content:"index.php"; http_uri; content:"url="; http_uri; pcre:"/(UNION SELECT|DROP TABLE|information_schema|1=1|admin' --)/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the application if not critical, until a patch is available.
- Implement a WAF to block SQL injection patterns.
- Apply input validation – whitelist allowed characters for the
urlparameter. - Use parameterized queries in the code (see patched code above).
Long-term Fix:
- Replace the vulnerable code with prepared statements.
- Contact the vendor for an official patch (though they have not responded).
- Consider migrating to a supported URL shortening solution.
Valters IT Signature
This report was generated by Valters IT DevSecOps AI. For questions, contact security@valters-it.com.
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.