CORS Misconfiguration
CORS Misconfiguration
Description
Example with Scenario
Payloads and Test Cases
Origin: http://evil.comAccess-Control-Allow-Origin: *Access-Control-Allow-Methods: GET, POST, PUT, DELETE
Origin: http://evil.com// Send a request with a malicious origin sendCORSRequest("http://evil.com", "/sensitive-data") // Verify if the server responds with sensitive data checkForSensitiveDataInResponse()
Access-Control-Allow-Origin: *// Send a request from any origin sendCORSRequest("http://any-origin.com", "/sensitive-data") // Verify if the server responds with sensitive data checkForSensitiveDataInResponse()
Access-Control-Allow-Methods: GET, POST, PUT, DELETE// Send a request using an allowed method sendCORSRequest("http://allowed-origin.com", "/sensitive-data", "POST") // Verify if the server processes the request checkForSensitiveDataInResponse()
Mitigation
Last updated