<form id="attack" action="https://bank.com/transfer" method="post">
<input type="hidden" name="to" value="attacker">
<input type="hidden" name="amount" value="10000">
</form>
<script>document.getElementById("attack").submit();</script><img src="https://bank.com/transfer?to=attacker&amount=10000">fetch requestfreemoney4you.com's JavaScript cannot read any response from bank.comhttp, https, ws, ftpcse312.com443https://api.cse312.com and https://cse312.com are the same sitehttps://autograder.cse.buffalo.edu and https://buffalo.edu are the same sitehttp://localhost:8080 and http://localhost:5000 are the same sitehttp://localhost:8080 and http://127.0.0.1:8080 which are different sites, but both reach your serverSameSite cookie directivefetch a URL on another origin
Access to fetch at '...' from origin '...' blocked by CORSfreemoney4you.com send bank.com:
DELETE request?A cross-origin request is simple if all of these are true:
GET, POST, or HEAD (A request for only headers)Accept, Accept-Language, Content-Language, Content-TypeContent-Type, if set, is one of:
application/x-www-form-urlencodedmultipart/form-datatext/plainEvery other request is "to be preflighted"
AJAX and fetch existedfetch wouldn't make anything safer so it's allowed. An attacker would simply use a form if it were notPUT, DELETE, a JSON body, a custom header) could not be sent cross-origin when the SOP rules were written
OPTIONS for the intended pathAccess-Control-Allow headers
Access-Control-Allow-Method: PATCHAccess-Control-Allow-Origin: https://cse312.comGET /transfer?to=attacker&amount=10000 is exploitable even with all the protections built into modern browsers
SameSite are enforced by the user's browser. We have limited control
SameSite value<form action="/image-upload" id="image-form" method="post" enctype="multipart/form-data">
<input type="hidden" name="xsrf_token" value="AQAAAjppCA8mhugn2UvwOTaKnVY">
<label for="form-file">Image: </label>
<input id="form-file" type="file" name="upload">
<br/>
<label for="image-form-name">Caption: </label>
<input id="image-form-name" type="text" name="name">
<input type="submit" value="Submit">
</form>fetch request with a XSRF token
meta tag403 Forbiddenfreemoney4you.com from reading your pagesSameSite setting