CVE-2025-6871

7.3 HIGH

📋 TL;DR

A critical SQL injection vulnerability in SourceCodester Simple Company Website 1.0 allows remote attackers to execute arbitrary SQL commands via the Username parameter in /classes/Login.php. This affects all users running the vulnerable version of this web application, potentially leading to unauthorized data access or system compromise.

💻 Affected Systems

Products:
  • SourceCodester Simple Company Website
Versions: 1.0
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Affects the default installation. No special configuration required for exploitation.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete database compromise including data exfiltration, privilege escalation, and potential remote code execution via database functions.

🟠

Likely Case

Unauthorized access to sensitive user data, authentication bypass, and potential website defacement.

🟢

If Mitigated

Limited impact with proper input validation and database permissions, potentially only error messages visible.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Public proof-of-concept available on GitHub. SQL injection via login form requires minimal technical skill.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Unknown

Vendor Advisory: https://www.sourcecodester.com/

Restart Required: No

Instructions:

No official patch available. Consider replacing with alternative software or implementing custom fixes.

🔧 Temporary Workarounds

Input Validation Filter

all

Add parameterized queries or input validation to /classes/Login.php to sanitize Username input

Modify Login.php to use prepared statements: $stmt = $conn->prepare('SELECT * FROM users WHERE username = ?'); $stmt->bind_param('s', $username);

Web Application Firewall

all

Deploy WAF with SQL injection rules to block malicious requests

🧯 If You Can't Patch

  • Isolate the application behind a reverse proxy with strict input filtering
  • Implement network segmentation to limit database access from web server

🔍 How to Verify

Check if Vulnerable:

Test login form with SQL injection payloads like ' OR '1'='1 in username field

Check Version:

Check application files for version information, typically in README or configuration files

Verify Fix Applied:

Verify that SQL injection payloads no longer work and return proper error handling

📡 Detection & Monitoring

Log Indicators:

  • Unusual SQL syntax in login attempts
  • Multiple failed login attempts with special characters
  • Database error messages in application logs

Network Indicators:

  • POST requests to /classes/Login.php containing SQL keywords
  • Unusual database query patterns from web server

SIEM Query:

source=web_logs AND (uri="/classes/Login.php" AND (username CONTAINS "' OR" OR username CONTAINS "--" OR username CONTAINS ";"))

🔗 References

📤 Share & Export