CVE-2025-40690

9.8 CRITICAL

📋 TL;DR

This SQL injection vulnerability in Online Fire Reporting System v1.2 allows attackers to manipulate the 'teamid' parameter in '/ofrs/admin/edit-team.php' to execute arbitrary SQL commands, potentially compromising the entire database. It affects users of PHPGurukul's Online Fire Reporting System v1.2, particularly those with internet-facing deployments.

💻 Affected Systems

Products:
  • PHPGurukul Online Fire Reporting System
Versions: v1.2
Operating Systems: Any OS running PHP (e.g., Linux, Windows)
Default Config Vulnerable: ⚠️ Yes
Notes: The vulnerability is present in the default installation of v1.2; no special configurations are required for exploitation.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete database compromise, including data theft, deletion, or unauthorized administrative access, leading to system takeover and data breach.

🟠

Likely Case

Unauthorized data retrieval or modification of database records, such as user credentials or sensitive fire reporting data.

🟢

If Mitigated

Limited impact if input validation and parameterized queries are enforced, preventing SQL injection but potentially still exposing error messages.

🌐 Internet-Facing: HIGH, as the vulnerable endpoint is accessible over the internet, making it an easy target for automated attacks.
🏢 Internal Only: MEDIUM, as internal attackers or compromised accounts could exploit it, but network segmentation might reduce exposure.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: LIKELY
Unauthenticated Exploit: ✅ No
Complexity: LOW

Exploitation requires access to the admin endpoint, but SQL injection techniques are well-known and easy to automate.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Unknown

Vendor Advisory: https://www.incibe.es/en/incibe-cert/notices/aviso/multiple-vulnerabilities-phpgurukuls-online-fire-reporting-system

Restart Required: No

Instructions:

No official patch is available; apply workarounds such as input validation and use parameterized queries in the code.

🔧 Temporary Workarounds

Implement Input Validation and Sanitization

all

Add server-side validation to sanitize the 'teamid' parameter, rejecting non-numeric or malicious inputs.

Edit '/ofrs/admin/edit-team.php' to include: if (!is_numeric($_GET['teamid'])) { die('Invalid input'); }

Use Parameterized Queries

all

Modify the SQL query in the PHP code to use prepared statements with bound parameters to prevent injection.

Replace raw SQL with PDO or mysqli prepared statements, e.g., $stmt = $pdo->prepare('SELECT * FROM teams WHERE id = ?'); $stmt->execute([$teamid]);

🧯 If You Can't Patch

  • Restrict access to '/ofrs/admin/edit-team.php' using firewall rules or web application firewalls (WAF) to block unauthorized IPs.
  • Monitor and log all access attempts to the vulnerable endpoint for suspicious activity and review database logs for SQL errors.

🔍 How to Verify

Check if Vulnerable:

Test the endpoint by sending a malicious payload like 'teamid=1' OR '1'='1' to '/ofrs/admin/edit-team.php' and check for SQL errors or unexpected data in the response.

Check Version:

Check the system version by reviewing the software documentation or configuration files, as there may not be a direct command; look for version indicators in the codebase.

Verify Fix Applied:

After applying workarounds, retest with the same payload; the system should reject the input or return no sensitive data without errors.

📡 Detection & Monitoring

Log Indicators:

  • Unusual SQL error messages in web server logs (e.g., PHP warnings about SQL syntax)
  • Multiple rapid requests to '/ofrs/admin/edit-team.php' with varying 'teamid' parameters

Network Indicators:

  • HTTP requests containing SQL keywords (e.g., UNION, SELECT, DROP) in the 'teamid' parameter
  • Traffic spikes to the admin endpoint from unknown IPs

SIEM Query:

Example for Splunk: index=web_logs url="/ofrs/admin/edit-team.php" | search teamid=*OR* OR teamid=*UNION* | stats count by src_ip

🔗 References

📤 Share & Export