Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
righettod authored May 9, 2024
1 parent 4dd9a93 commit e133133
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions other/corsCredentialedRequestsMisconfiguration.bcheck
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
metadata:
language: v2-beta
name: "Invalid CORS configuration for credentialed requests detected"
description: "Checks for a broken CORS configuration case: Credentialed requests and wildcards."
author: "Dominique Righetto"
tags: "passive", "informative"

# The server must not specify the "*" wildcard for the Access-Control-Allow-Origin response-header value, but must instead specify an explicit origin
# Source: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#requests_with_credentials
given response then
if {latest.response.headers} matches "(?i)Access-Control-Allow-Origin:\s+\*" and
{latest.response.headers} matches "(?i)Access-Control-Allow-Credentials:\s+true" then
report issue:
severity: info
confidence: firm
detail: "Credentialed CORS requests cannot used wildcards origins."
remediation: "Specify an explicit allow origin. Refer to the Mozilla CORS documentation for technical details: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#requests_with_credentials"
end if

0 comments on commit e133133

Please sign in to comment.