CVE-2025-0299

6.3 MEDIUM

📋 TL;DR

A critical SQL injection vulnerability in code-projects Online Book Shop 1.0 allows remote attackers to execute arbitrary SQL commands via the 's' parameter in /search_result.php. This affects all installations of version 1.0 that expose the vulnerable endpoint. Attackers can potentially access, modify, or delete database content without authentication.

💻 Affected Systems

Products:
  • code-projects Online Book Shop
Versions: 1.0
Operating Systems: All operating systems running PHP
Default Config Vulnerable: ⚠️ Yes
Notes: All installations with the vulnerable /search_result.php file are affected. No special configuration required.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

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

🟠

Likely Case

Unauthorized access to sensitive data (user credentials, payment information, personal data) and potential data manipulation.

🟢

If Mitigated

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

🌐 Internet-Facing: HIGH - The vulnerability is remotely exploitable without authentication and affects internet-facing web applications.
🏢 Internal Only: MEDIUM - Internal systems are still vulnerable but attack surface is reduced compared to internet-facing deployments.

🎯 Exploit Status

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

Public exploit code is available in the GitHub gist reference. SQL injection via GET parameter manipulation is straightforward.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Unknown

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

Restart Required: No

Instructions:

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

🔧 Temporary Workarounds

Input Validation and Sanitization

all

Implement strict input validation and parameterized queries for the 's' parameter in search_result.php

Modify search_result.php to use prepared statements: $stmt = $conn->prepare('SELECT * FROM books WHERE title LIKE ?'); $stmt->bind_param('s', $search_term);

Web Application Firewall (WAF) Rules

all

Deploy WAF rules to block SQL injection patterns in the search parameter

Add WAF rule: Detect and block requests containing SQL keywords (UNION, SELECT, INSERT, etc.) in the 's' parameter

🧯 If You Can't Patch

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

🔍 How to Verify

Check if Vulnerable:

Test by sending a SQL injection payload to the 's' parameter: http://target/search_result.php?s=' OR '1'='1

Check Version:

Check the software version in admin panel or by examining source code files

Verify Fix Applied:

Test with the same payload and verify no SQL errors or unexpected data is returned

📡 Detection & Monitoring

Log Indicators:

  • Unusual SQL error messages in web server logs
  • Multiple rapid requests to /search_result.php with suspicious parameters
  • Requests containing SQL keywords (UNION, SELECT, DROP, etc.)

Network Indicators:

  • Unusual database connection patterns from web server
  • Large volume of data being transferred from database

SIEM Query:

source="web_logs" AND uri="/search_result.php" AND (query_string="*UNION*" OR query_string="*SELECT*" OR query_string="*INSERT*")

🔗 References

📤 Share & Export