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.
Nothing a little recon or social engineering can't solve.
> it's not as easy as it sounds to find a VPN or an open proxy in any country
Only for some small/niche countries perhaps. Worst case, an attacker can rent a VPS in the target country.
Perhaps a city-based lock would be more effective.
Attacker do not maintain proxies, especially not proxies across tens of developers countries, and if they that would be organized crime and it's a whole new level. By the way, banking trojans evolved to operate from the browser of the victim specifically to evade these protections.
Should I cover all these in a blog post if it's something you're interested in?
In their case, let's say the victim analyst was based in the United States, and they have implemented your proposed session country-lock. I also happen to reside in the US, so the country-lock protection is worthless.
For other cases, you can _try_ to block proxies, VPNs, TOR, VPSs... but that in itself is perhaps a usability fail.
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...