I have a web client making requests to AWS Lambda via the AWS API Gateway. I'm using AWS Cognito, alongside Auth0, to authenticate users.
My question is related to the CORS response headers from the AWS API Gateway endpoint, specifically the Access-Control-Allow-Origin response header that is set to any "' * '". This article indicates the risks of using the any "' * '" parameter, namely that a 'hacker can coopt our site to request any method' on our back-end: (CORS Security link).
While Cognito's authentication may prove that the end user making the request is who he says he is, Cognito's authentication does not necessarily prove that the website that is making the request on behalf of the user is mywebsite.com rather than attacker.com.
Does Cognito guarantee that the request is coming from mywebsite.com?
Is there a secure way to implement the any "' * '" Access-Control-Allow-Origin response header?
Access-Control-Allow-Origin
is a response header, not a request header, so this isn't being "sent to," it's being "received from" ...from what, exactly? – Michael - sqlbot