CVE-2023-23155

9.8 CRITICAL

📋 TL;DR

This SQL injection vulnerability in Art Gallery Management System 1.0 allows attackers to execute arbitrary SQL commands via the username parameter in the admin login page. This can lead to authentication bypass, data theft, or complete system compromise. Anyone using this specific PHP application version is affected.

💻 Affected Systems

Products:
  • Art Gallery Management System Project in PHP
Versions: 1.0
Operating Systems: Any OS running PHP
Default Config Vulnerable: ⚠️ Yes
Notes: Vulnerability exists in default installation. Requires PHP with MySQL/MariaDB database.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete system takeover: attacker gains admin access, extracts all database content (including user credentials), and potentially executes arbitrary code on the server.

🟠

Likely Case

Authentication bypass leading to unauthorized admin access, followed by data exfiltration or manipulation of gallery content.

🟢

If Mitigated

Attack fails due to input validation or WAF blocking malicious SQL patterns.

🌐 Internet-Facing: HIGH - The admin login page is typically internet-facing, making it directly accessible to attackers.
🏢 Internal Only: MEDIUM - If deployed internally only, risk is reduced but still significant if internal threats exist.

🎯 Exploit Status

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

Simple SQL injection via POST parameter. Public proof-of-concept available in GitHub gist.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Not available

Vendor Advisory: Not available

Restart Required: No

Instructions:

No official patch exists. Replace vulnerable code with parameterized queries or input validation.

🔧 Temporary Workarounds

Input Validation and Sanitization

all

Add input validation to sanitize username parameter before SQL query execution.

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

Web Application Firewall (WAF)

all

Deploy WAF rules to block SQL injection patterns in login requests.

Add WAF rule: Detect and block SQL keywords in POST parameters

🧯 If You Can't Patch

  • Isolate the system behind VPN or restrict access to trusted IP addresses only.
  • Implement strong authentication (MFA) for admin access and monitor login attempts.

🔍 How to Verify

Check if Vulnerable:

Test admin login page with SQL injection payload: username=admin' OR '1'='1

Check Version:

Check project files for version information or review source code for vulnerable login.php

Verify Fix Applied:

Attempt SQL injection after implementing parameterized queries - should return login failure instead of bypass.

📡 Detection & Monitoring

Log Indicators:

  • Unusual SQL errors in application logs
  • Multiple failed login attempts with SQL patterns
  • Successful admin login from unexpected IP

Network Indicators:

  • POST requests to login.php containing SQL keywords (UNION, SELECT, OR, --)
  • Abnormal response patterns from login endpoint

SIEM Query:

source=web_logs AND uri="/admin/login.php" AND (post_param="*UNION*" OR post_param="*SELECT*" OR post_param="*OR '1'='1*")

🔗 References

📤 Share & Export