geo blocking VPN users in PHP is a losing game, change my mind

ChrisM85

New Member
Messages
62
Reaction score
0
Location
Dublin, IE

Spent the last three weeks rebuilding the geo layer on our site because the old MaxMind integration was flagging half of Ohio as... well, we can't even serve Ohio, so that part's moot. Whole thing started because legal wanted a new blocked region added and the old code had state rules hardcoded in like four different places. Fun week.

The actual problem isn't the lookup, it's VPN detection. Cloudflare's bot score catches the lazy ones. Residential proxies and mobile carrier IPs walk right through. And then legit players on T-Mobile get flagged because their CGNAT address geolocates to a datacenter in Kansas. Support tickets pile up, refund requests, the occasional chargeback. Nobody wins except the proxy vendors.

What I landed on: layered it. MaxMind for the base lookup, cached in Redis for 24h, then a second pass against a proxy/VPN ASN list, then a manual whitelist table for known carrier ranges that we keep patching by hand. Sounds clean on paper. It isn't. We still eat roughly 2-3% false positives and I get a Slack ping every time someone important complains.

Honestly the whole thing is security theater. The guys who want around it will get around it. I've watched dudes in banned states do it with a $4 VPS and a fingerprint spoofer. Meanwhile someone's grandma in Nebraska can't deposit because her ISP routes through Denver.

Curious what the rest of you run in prod. Anyone using IPQualityScore or the IP2Location VPN addon? Worth the per-lookup cost or am I just paying to feel like I did something?

Been lurking this section for ages before posting, the payment and queue threads alone saved me twice

https://websiteforums.info/forums/php-and-backend-development.6/

nightowl87

New Member
Messages
60
Reaction score
0
Location
Portland, OR

The T-Mobile CGNAT thing is what scares me the most tbh. I'm just standing up geo checks on a much smaller project and half my test users are on mobile so I'd probably flag my own friends lol.

Question on the whitelist table, how often are you actually patching it? We've got carrier ranges shifting and I'm worried I'll be updating that thing monthly forever. Do you keep it in the DB or a config file?

Also curious why IPQualityScore over something like MaxMind's own anonymous IP db? Their per-lookup pricing scared me off but I haven't actually compared them.

kewldad

New Member
Messages
60
Reaction score
0
Location
Calgary, AB

Whitelist lives in the DB, not a config file. Learned that the hard way after a deploy wiped a carrier range and we locked out half of Cricket for a weekend. I patch it maybe every two weeks now, but honestly the trick isn't chasing ASN lists, it's watching your false positive tickets. Every time someone complains, that's a row. After a few months the table kind of patches itself.

On IPQS, I ran it for about six months. It's decent at catching residential proxies, better than MaxMind's anon db in my experience, but the per-lookup cost creeps up fast once you're hitting it on every request. Cache aggressively or you'll blow through your budget by mid-month. I ended up only calling it on the second pass, after the base lookup and ASN check, so maybe 10% of traffic actually touches it.

Also, mild pushback on the "security theater" thing. Yeah, the determined guys get around it, but you're not really fighting them. You're fighting the 80% who saw a TikTok about a $4 VPS and gave up halfway. That 2-3% false positive rate is annoying but it's the actual cost of doing business, and it's cheaper than the chargebacks.

What's your Redis TTL actually set to? 24h feels long if a range gets burned and you're still serving cached results from yesterday.

ahmed_khan92

New Member
Messages
63
Reaction score
0
Location
Toronto, ON

TTL is 24h on the base MaxMind result but 1h on the ASN pass. That split does most of the work. Proxy ranges churn way faster than geo does, and we got burned early when a Linode block got reassigned and we were still serving the old verdict half a day later.

kewldad the ticket thing is real. We dump every false positive support ticket into a sheet and I go through it every Friday. Sounds dumb, beats anything I've paid for. And yeah, I'll take the L on the security theater rant. You're right, it's the 80% who gave up on the TikTok VPS tutorial, not the guys running fingerprint spoofers. I just get annoyed when the same /24 files chargebacks three months straight.

nightowl87 on IPQS vs MaxMind's anon db, IPQS caught noticeably more residential proxies for me, but you're paying per lookup even on clean results, which is the part that stings. MaxMind's anon db is basically free if you already have GeoIP2, it just flags less. For a small project I'd skip both and lean on your own ticket pile for the first couple months. Five real complaints will teach you more than a subscription will.

You must log in or register to reply here.