Message from JavaScript discussions

January 2018

— "Prevention measures that do NOT work" is a good section


(cookie1=expires in 6h)(cookie2=expires in a week)(cookie3=exipires in a month)... so if img got these, attacker get 3 cookies and tries to access site next day, session doesnt work, see

— Attacker does not get the cookie

— There is no "next day"

— Your browser runs the code to load an image and then makes a request to your app server, browser auto-sends a cookie to your app server, and suddenly now your app server is doing whatever is described in the img tag's query string

Message permanent page


<img src="" width="0" height="0" border="0">

example from that page

Message permanent page

— That is the whole attack right there, nothing more

— There are a lot more ways to do CSRF but that's the easiest

— It will work if this ?a=1&b=2 is how the site works, it could be form request or js request

— img only works for GET requests, yes

— The other attack methods can use other HTTP verbs

— There are tools that make the neccesary code to do this