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.