CVE-2025-3146
📋 TL;DR
This critical SQL injection vulnerability in PHPGurukul Bus Pass Management System 1.0 allows attackers to execute arbitrary SQL commands via the 'viewid' parameter in /view-pass-detail.php. Attackers can remotely exploit this to access, modify, or delete database contents. All users running the vulnerable version are affected.
💻 Affected Systems
- PHPGurukul Bus Pass Management System
📦 What is this software?
⚠️ Risk & Real-World Impact
Worst Case
Complete database compromise including data theft, data destruction, authentication bypass, and potential remote code execution via database functions.
Likely Case
Unauthorized access to sensitive passenger data, administrative credentials theft, and database manipulation.
If Mitigated
Limited impact with proper input validation and database permissions, potentially only read access to non-sensitive data.
🎯 Exploit Status
Exploit details are publicly available. SQL injection via GET/POST parameters is straightforward to weaponize.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Unknown
Vendor Advisory: https://phpgurukul.com/
Restart Required: No
Instructions:
No official patch available. Consider migrating to alternative software or implementing workarounds.
🔧 Temporary Workarounds
Input Validation and Sanitization
allAdd parameter validation and sanitization to the viewid parameter in /view-pass-detail.php
Modify /view-pass-detail.php to validate viewid as integer: if(!is_numeric($_GET['viewid'])) { die('Invalid input'); }
Web Application Firewall (WAF)
allDeploy WAF rules to block SQL injection patterns
Add WAF rule: SecRule ARGS:viewid "@rx (?i:(union|select|insert|update|delete|drop|exec|sleep|benchmark|waitfor)\s+.*)" "id:1001,phase:2,deny,status:403,msg:'SQLi attempt detected'"
🧯 If You Can't Patch
- Isolate the system behind a firewall with strict access controls
- Implement database user with minimal privileges (read-only if possible)
🔍 How to Verify
Check if Vulnerable:
Test /view-pass-detail.php?viewid=1' OR '1'='1 and observe if SQL error or unexpected behavior occurs
Check Version:
Check system documentation or admin panel for version information
Verify Fix Applied:
Test with SQL injection payloads after implementing fixes and confirm they are blocked
📡 Detection & Monitoring
Log Indicators:
- Multiple requests to /view-pass-detail.php with SQL keywords in parameters
- Database error logs showing SQL syntax errors
Network Indicators:
- HTTP requests containing SQL injection patterns in viewid parameter
- Unusual database query patterns from web server
SIEM Query:
source="web_logs" AND uri_path="/view-pass-detail.php" AND (viewid="*union*" OR viewid="*select*" OR viewid="*insert*" OR viewid="*' OR '*"*)