
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
github.com/miguer-dev/cors_watcher
Advanced tools
A Go tool to check CORS policies on websites, with configurable options for HTTP requests.

Download release binary
./cors-watcher [flags]
-url: URL to check its CORS policy. It must start with http:// orhttps://.-method: Set the request method (GET, POST, PUT, DELETE, PATCH).-headers: Set request headers in the format key:value, key:value, ....-data: Data to send in the request (for methods like POST).-origins-file: Specify the filename containing the list of origins.-only-origins: Use only the origins from the specified origins list file.-requests-file: Specify the filename containing the list of requests, using JSON format for each entry:
{"url": "https://url1.com", "method": "POST", "headers": {"header1": "value1", "header2": "value2"}, "data": "data1"}-timeout: Set the request timeout (in seconds).-delay: Set the delay between requests (in seconds).-proxy: Set the proxy (HTTP or SOCKS5).-output: Specify the filename to save the results in a readable format.-output-json: Specify the filename to save the results in json format.-output-csv: Specify the filename to save the results in csv format.-output-yaml: Specify the filename to save the results in yaml format.-version: Show the tool's version.Tags highlight relevant information found regarding the website's CORS policies. The color of the tag indicates the risk level (green = low, yellow = medium, red = high).
- Headers containing Access-Control-* were found.
- The Access-Control-Allow-Origin header was found. The color may vary depending on its value and the risk it represents:
- Low risk as it matches the website's origin.
- Low risk as it automatically disables Access-Control-Allow-Credentials.
- Medium risk although the value is a possible domain of the attacker, it depends on the Access-Control-Allow-Credentials value for higher risk.
- The Access-Control-Allow-Credentials header was found. The color may vary depending on its value and the associated risk:
- Low risk as it’s set to false, not allowing credential transmission.
- High risk if set to true and Access-Control-Allow-Origin is misconfigured.
- Low risk as although it's set to true, Access-Control-Allow-Origin is not vulnerable.
- The http protocol is used in Access-Control-Allow-Origin, which could be exploited by a Man-in-the-Middle attack.
- The Vary: Origin header is missing, which could lead to client-side cache poisoning../cors-watcher -url https://example.com
./cors-watcher -url "https://example.com" -method POST -headers "Content-Type:application/json" -data '{"key": "value"}'
./cors-watcher -url https://example.com -origins-file origins
./cors-watcher -requests-file requests
./cors-watcher -requests-file requests -delay 0.5
Access-Control-Allow-Origin header, potentially allowing attackers to control the allowed origin.null origin, which can bypass origin restrictions.http:// in Access-Control-Allow-Origin: Checks if http:// origins are allowed, which can enable man-in-the-middle attacks.Vary: Origin Header): Checks if the Vary: Origin header is missing, potentially leading to cache poisoning.For more details on these vulnerabilities -> exploiting-cors-misconfigurations-for-bitcoins-and-bounties
This project is licensed under the MIT License.
FAQs
Unknown package
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.