by user5994461 · 6y ago · 0 comments
Do NOT bind session cookies to an IP. It breaks usability on mobiles, they change networks quite often.
What you can try to do instead is to associate the cookie to the country is user currently is in. It's available in the CF-IPCountry header if you use CloudFlare. This may also cause usability issues for frequent travelers or border workers.
https://support.cloudflare.com/hc/en-us/articles/200168236-C...
It's simple and it's extremely effective. It benefits security immensely.
1. Target leaks session cookie
2. Attacker uses VPN to connect from target's country with the leaked session cookie
3. Attacker's session is deemed validIf you're thinking of Tor, Tor is trivial to detect and block.
I've been working in fintech companies and e-commerce, handling real money or wallets that could be stolen or emptied by a successful attacker. If you don't do defense in depth, users lose. One trivial example, the days after a new breach is published on Hacker News, there will be bots on the door attempting to brute force login with all these new email and password combinations.
Any other question? I feel like I have a context to start writing a blog post on that.