3 ms·
This is a good vulnerability to be aware of, but the OP is probably wrong about "server maintains the authentication cookie" -- what's probably going on is that
by jrochkind1 12y ago
This is a good vulnerability to be aware of, but the OP is probably wrong about "server maintains the authentication cookie" -- what's probably going on is that the servers simply don't maintain state at all, the cookie alone has the state, so replaying the cookie will always work.
Just about any Rails app using the default cookie-stored sessions will behave the same. Not because the server is "maintaining the authentication cookie", but precisely because the server is maintaining no state at all, it's all in the cookie (which in the latest versions of Rails is by default encrypted and signed, to prevent snooping or tampering -- but that doesn't prevent replay).
I think most people set cookies https only, figure they can't therefore be sniffed, and don't worry about it.
If you wanted to deal with it, still without maintaining session state on the server, I guess the best thing to do would be to put a timestamp in the cookie, and refuse to honor 'old' cookies? That still wouldn't make the cookie invalid as soon as someone pressed 'logout', and would be tricky with intended 'long lived stay logged in' cookies.
Eliminating server session state can make things (especially scaling) a lot simpler. I think it's probably good enough to https-only your cookies and call it a day. No?