My Ubuntu 18 system did an upgrade to Firefox 68 (presumably from 67.x).
I have a simple XSRF demo that I use for class --- the demo is extremely simple: I have a login program that sets a sessionid
cookie once there is a successful login. To simplify the demo, the cookie is set with a hardcoded value.
Then, I have an "add user" server app (a plain'old CGI program) that is intended to add the user only of there is a log in --- that is, if the sessionid
cookie contains the expected (hardcoded) value. The program simply checks:
if (cookie["sessionid"] == "the-hardcoded-value")
{
// execute SQL: insert into users values ........
}
Then, I have a third page (on a separate domain) that just has an embedded img
tag that looks like this:
<img src="https://mydomain.com/cgi-bin/add_user.cgi?username=AddedViaXSRF" />
(the img shows as a little empty square on the displayed HTML page)
The thing worked like a charm..... until this morning. It just won't work with Firefox 68. I check the server logs (the "add user" program logs the requests that it receives, including the cookies) --- it is not receiving the sessionid
cookie even though I see, via the menu Web developer → Storage Inspector
, that the cookie has been set in the browser. I also checked: the sameSite
attribute is not set (httpOnly
is, because the login program sets it).
The demo still works with Firefox 61 (I tried from a virtual machine --- two, actually: a Windows 7 with FF 61, and also an unpatched Ubuntu 18.04.1 that happens to also have FF 61). But I'm fairly certain that it was also working on FF 67.x (I had tried the demo a couple days ago, in preparation for today's class where I showed the demo).
Is it really some change in FF 68 that's preventing this simple "classic" img-based CSRF attack from succeeding? (if so, what is the change? I can't see anything remotely close to related in the list of security fixes for FF 68)
[[EDIT]]: I just tried with FF 65 (a "live booted" Ubuntu 18.04.2 system), and the demo works without a glitch (i.e., the XSRF attack succeeds in adding a user to the table).
<html> <body> <h2>.....
)