id: CVE-2020-35489

info:
  name: WordPress Contact Form 7 - Unrestricted File Upload
  author: soyelmago
  severity: critical
  description: WordPress Contact Form 7 before 5.3.2 allows unrestricted file upload and remote code execution because a filename may contain special characters.
  impact: |
    Successful exploitation of this vulnerability could result in unauthorized access to the target system and potential remote code execution.
  remediation: |
    Update to the latest version of the Contact Form 7 plugin to mitigate this vulnerability.
  reference:
    - https://nvd.nist.gov/vuln/detail/CVE-2020-35489
    - https://web.archive.org/web/20210125141546/https://www.getastra.com/blog/911/plugin-exploit/contact-form-7-unrestricted-file-upload-vulnerability/
    - https://wordpress.org/plugins/contact-form-7/#developers
    - https://www.jinsonvarghese.com/unrestricted-file-upload-in-contact-form-7/
    - https://contactform7.com/2020/12/17/contact-form-7-532/
  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
    cve-id: CVE-2020-35489
    cwe-id: CWE-434
    epss-score: 0.88428
    epss-percentile: 0.98435
    cpe: cpe:2.3:a:rocklobster:contact_form_7:*:*:*:*:*:wordpress:*:*
  metadata:
    max-request: 1
    vendor: rocklobster
    product: contact_form_7
    framework: wordpress
  tags: cve,cve2020,wordpress,wp-plugin,rce,rocklobster

http:
  - method: GET
    path:
      - "{{BaseURL}}/wp-content/plugins/contact-form-7/readme.txt"

    matchers-condition: and
    matchers:
      - type: dsl
        dsl:
          - compare_versions(version, '< 5.3.2')

      - type: word
        part: body
        words:
          - "Contact Form 7"
          - '== Changelog =='
        condition: and

      - type: status
        status:
          - 200

    extractors:
      - type: regex
        name: version
        group: 1
        regex:
          - "(?m)Stable tag: ([0-9.]+)"
        internal: true

      - type: regex
        group: 1
        regex:
          - "(?m)Stable tag: ([0-9.]+)"
# digest: 4a0a0047304502200119d40e914be20d2c6e92899c0f92c4d47e25598a6a62e070775ac3598541ac022100f55d4088bdcb51738c6039670f2b8f9a5196c7f7458c1f9094355d76e42655ad:922c64590222798bb761d5b6d8e72950