2021-08-25 22:54:06 +00:00
|
|
|
id: cors-misconfig
|
|
|
|
|
|
|
|
info:
|
2022-04-16 15:36:53 +00:00
|
|
|
name: CORS Misconfiguration
|
2023-01-30 14:21:39 +00:00
|
|
|
author: nadino,g4l1t0,convisoappsec,pdteam,breno_css,nodauf
|
2021-08-25 22:54:06 +00:00
|
|
|
severity: info
|
2022-04-16 15:36:53 +00:00
|
|
|
reference:
|
|
|
|
- https://portswigger.net/web-security/cors
|
|
|
|
- https://www.corben.io/advanced-cors-techniques/
|
|
|
|
- https://www.geekboy.ninja/blog/exploiting-misconfigured-cors-cross-origin-resource-sharing/
|
2023-04-28 08:11:21 +00:00
|
|
|
metadata:
|
|
|
|
max-request: 11
|
2023-10-14 11:27:55 +00:00
|
|
|
tags: cors,generic,misconfig
|
2021-08-25 22:54:06 +00:00
|
|
|
|
2023-04-27 04:28:59 +00:00
|
|
|
http:
|
2021-08-25 22:54:06 +00:00
|
|
|
- raw:
|
|
|
|
- |
|
2022-09-22 06:10:37 +00:00
|
|
|
GET HTTP/1.1
|
2021-08-25 22:54:06 +00:00
|
|
|
Host: {{Hostname}}
|
2022-04-16 15:36:53 +00:00
|
|
|
Origin: {{cors_origin}}
|
|
|
|
|
|
|
|
payloads:
|
|
|
|
cors_origin:
|
2023-10-14 11:27:55 +00:00
|
|
|
- "https://{{tolower(rand_base(5))}}{{RDN}}" # Arbitrary domain
|
|
|
|
- "https://{{tolower(rand_base(5))}}.com" # Arbitrary domain
|
|
|
|
- "https://{{FQDN}}.{{tolower(rand_base(5))}}.com" # Arbitrary domain
|
|
|
|
- "https://{{FQDN}}{{tolower(rand_base(5))}}.com" # Arbitrary domain
|
|
|
|
- "https://{{FQDN}}_.{{tolower(rand_base(5))}}.com" # Arbitrary domain
|
|
|
|
- "https://{{FQDN}}%60.{{tolower(rand_base(5))}}.com" # Arbitrary domain
|
|
|
|
- "null" # null origin
|
|
|
|
- "https://{{tolower(rand_base(5))}}.{{RDN}}" # Arbitrary subdomain
|
|
|
|
- "http://{{tolower(rand_base(5))}}.{{RDN}}" # Arbitrary subdomain over http
|
|
|
|
- "https://{{replace(FQDN,'.','a')}}" # Replace . by a random character to abuse if regex is used
|
|
|
|
- "http://{{replace(FQDN,'.','a')}}" # Replace . by a random character to abuse if regex is used
|
2022-04-16 15:36:53 +00:00
|
|
|
stop-at-first-match: true
|
2021-08-25 22:54:06 +00:00
|
|
|
matchers:
|
|
|
|
- type: dsl
|
|
|
|
name: arbitrary-origin
|
|
|
|
dsl:
|
2023-06-19 21:10:30 +00:00
|
|
|
- "contains(tolower(header), 'access-control-allow-origin: {{cors_origin}}')"
|
|
|
|
- "contains(tolower(header), 'access-control-allow-credentials: true')"
|
2022-06-30 13:04:02 +00:00
|
|
|
condition: and
|
2023-10-20 11:41:13 +00:00
|
|
|
|
|
|
|
# digest: 4a0a0047304502206b1f7d2d431f28b64dfa6b919cf7f12dcaf7c318522caf013e28de52a6a50a96022100baf749a65dd2856645045362bfeb3f53149690c3ceb2f1e23e1c123298dac19c:922c64590222798bb761d5b6d8e72950
|