CVE-2024-12492

6.3 MEDIUM

📋 TL;DR

This critical SQL injection vulnerability in Farmacia 1.0 allows remote attackers to execute arbitrary SQL commands via the 'id' parameter in /visualizar-usuario.php. Attackers can potentially read, modify, or delete database contents, including sensitive user data. All users running Farmacia 1.0 with the vulnerable file accessible are affected.

💻 Affected Systems

Products:
  • Farmacia
Versions: 1.0
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Vulnerability exists in default installation. Requires /visualizar-usuario.php to be accessible.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete database compromise allowing data theft, data destruction, or full system takeover via SQL injection leading to remote code execution.

🟠

Likely Case

Unauthorized access to sensitive user data, database manipulation, or potential authentication bypass.

🟢

If Mitigated

Limited impact with proper input validation and database permissions, potentially only error messages or partial data exposure.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

Public exploit available on GitHub. Simple SQL injection via URL parameter manipulation.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Unknown

Vendor Advisory: https://code-projects.org/

Restart Required: No

Instructions:

No official patch available. Consider workarounds or migrating to alternative software.

🔧 Temporary Workarounds

Input Validation Filter

all

Add input validation to sanitize the 'id' parameter before processing

Modify /visualizar-usuario.php to validate 'id' parameter as integer using is_numeric() or filter_var()

Web Application Firewall

all

Deploy WAF with SQL injection protection rules

🧯 If You Can't Patch

  • Restrict access to /visualizar-usuario.php using IP whitelisting or authentication
  • Implement database user with minimal permissions (read-only if possible)

🔍 How to Verify

Check if Vulnerable:

Test by accessing /visualizar-usuario.php?id=1' OR '1'='1 and checking for SQL errors or unexpected behavior

Check Version:

Check software version in admin panel or configuration files

Verify Fix Applied:

Test with SQL injection payloads and verify proper error handling or parameter rejection

📡 Detection & Monitoring

Log Indicators:

  • SQL syntax errors in web server logs
  • Multiple requests to /visualizar-usuario.php with unusual parameters
  • Database error messages in application logs

Network Indicators:

  • HTTP requests containing SQL keywords (SELECT, UNION, etc.) in URL parameters
  • Unusual database connection patterns from web server

SIEM Query:

source="web_logs" AND uri="/visualizar-usuario.php" AND (param="id" AND value MATCH "[';]|OR|UNION|SELECT")

🔗 References

📤 Share & Export