CORS Whitelist Origin Validation
Validates the Cross-Origin Resource Sharing (CORS) whitelist, ensuring only authorized origins are included, enhancing application security.
Cross-Origin Resource Sharing (CORS)
Business Logic
How this template works
APIs Selection
The API selection filters in this template specify the criteria for selecting the API requests to be executed. In this case, the filters include checking the response code to be greater than or equal to 200 and less than 300, and extracting the value of the "Host" header as "host_val".
Execute request
The execute section defines the type of request to be executed, which is a single request in this case. It also specifies the request headers to be added, where the "origin" header is set to "${host_val}.evil.com". This simulates a potential attack by setting a malicious origin.
Validation
The validation section defines the criteria for validating the response of the executed request. It checks that the response code is within the range of 200 to 300. It also verifies that the response headers contain either the "access-control-allow-origin" header with a value containing "${host_val}.evil.com" and the "access-control-allow-credentials" header with a value containing "true". This ensures that the CORS whitelist is properly configured and does not allow unauthorized origins.
Frequently asked questions
What is the purpose of the CORS Whitelist Origin Validation test
How does the CORS Whitelist Origin Validation test enhance application security
What impact can a misconfigured CORS have on web application security
What category does the CORS Whitelist Origin Validation test belong to
What severity level is assigned to the CORS Whitelist Origin Validation test
What are some of the tags associated with the CORS Whitelist Origin Validation test
"The text editor in Akto is absolutely remarkable. Its user-friendly YAML format strikes the perfect balance between simplicity and power. With intuitive features like 'API selection filter', 'Execute', Validate' creating test rules becomes incredibly easy. Akto's test editor is a game-changer, enabling seamless creation of highly personalized and effective tests that could meet the needs of any modern day organization. "

Security team,
Rippling