CVE-2022-30352

9.8 CRITICAL

📋 TL;DR

CVE-2022-30352 is a SQL injection vulnerability in phpABook 0.9i that allows attackers to execute arbitrary SQL commands via the 'auth_user' parameter in index.php. This can lead to unauthorized data access, modification, or deletion, affecting users of the vulnerable phpABook version.

💻 Affected Systems

Products:
  • phpABook
Versions: 0.9i
Operating Systems: All operating systems running PHP
Default Config Vulnerable: ⚠️ Yes
Notes: Vulnerability exists in the default installation of phpABook 0.9i due to lack of input sanitization.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full database compromise, including data theft, manipulation, or deletion, and potential remote code execution if database privileges allow.

🟠

Likely Case

Unauthorized access to sensitive contact data stored in the database, such as names, emails, and phone numbers.

🟢

If Mitigated

Limited impact with proper input validation and parameterized queries in place, preventing SQL injection.

🌐 Internet-Facing: HIGH, as the vulnerability is exploitable via a web interface accessible from the internet.
🏢 Internal Only: MEDIUM, as internal attackers could still exploit it if the application is accessible on the network.

🎯 Exploit Status

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

Exploit code is publicly available, making it easy for attackers to leverage this vulnerability.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Not available

Vendor Advisory: Not available

Restart Required: No

Instructions:

No official patch; consider upgrading to a newer version if available or applying manual fixes like input validation.

🔧 Temporary Workarounds

Implement Input Validation and Sanitization

all

Add server-side validation to sanitize the 'auth_user' parameter to prevent SQL injection.

Edit index.php to use prepared statements or escape user inputs.

Web Application Firewall (WAF) Rule

all

Deploy a WAF to block SQL injection attempts targeting the 'auth_user' parameter.

Configure WAF rules to detect and block SQL injection patterns.

🧯 If You Can't Patch

  • Restrict network access to the phpABook application to trusted IPs only.
  • Monitor logs for unusual SQL queries or access patterns related to the 'auth_user' parameter.

🔍 How to Verify

Check if Vulnerable:

Test by injecting SQL payloads into the 'auth_user' parameter and observing database errors or behavior changes.

Check Version:

Check the phpABook version in the application's configuration or source files.

Verify Fix Applied:

After applying fixes, retest with SQL injection payloads to ensure no errors or unauthorized access occurs.

📡 Detection & Monitoring

Log Indicators:

  • SQL syntax errors in web server logs
  • Unusual database queries from the phpABook application

Network Indicators:

  • HTTP requests with SQL injection patterns in the 'auth_user' parameter

SIEM Query:

Example: 'source=web_logs AND (auth_user CONTAINS "' OR '1'='1" OR auth_user CONTAINS "UNION SELECT")'

🔗 References

📤 Share & Export