Any control that trusts a location reported by the client, whether a GPS fix from a phone or a country looked up from an IP address, can be fooled by a user who controls that client or that network path. Location spoofing is the practice of making a service believe a device is somewhere it is not, and it sits behind geofencing bypass, licensing and regional pricing abuse, delivery and gig platform fraud, attendance fraud and evasion of impossible travel rules. This guide is for fraud, product security and identity teams who use location as a signal in apps and sign-in policies. It covers how device and network location is faked, which platform signals help (Android mock flags, Apple location source information, Play Integrity, App Attest), how to score location as one input rather than a gate, and how to measure the result. Device fingerprinting itself is covered in the Device Intelligence and Fingerprinting Guide, and radio level GNSS interference in the GNSS Spoofing and Jamming Guide.
Key takeaways
- Client location is a claim, not a fact. The W3C Geolocation specification states that no guarantee is given that the API returns the device's actual location, and both major mobile platforms provide ways to simulate location for testing.
- Two layers can be spoofed separately. Device location (GPS, Wi-Fi, cell) is faked on the handset; network location (IP geolocation) is faked with VPNs, proxies and residential proxy networks. Check that the two agree.
- Platform flags help but are not enough on their own. Android's Location.isMock() and Apple's CLLocationSourceInformation.isSimulatedBySoftware catch simple simulation; a rooted or jailbroken device can hide them, so pair them with server verified attestation.
- Score, do not block on a single signal. Combine location consistency, device integrity, network type and behaviour into a risk score, and reserve hard blocks for cases where law or contract requires a location guarantee.
- Measure friction as well as fraud. Track false positive rates from travellers, corporate VPNs and mobile carriers, because a location rule that blocks real customers is a cost too.
What location spoofing is and where it hurts
Location spoofing targets any decision that depends on where a user or device is. The attacker is usually the legitimate account holder or a fraud ring operating many accounts, not an outside intruder, which changes the defence: the device is in hostile hands, so anything computed on it can be altered.
| Use case | What the location decides | Typical spoofing goal |
|---|---|---|
| Regulated geofencing (betting, lotteries, sanctions screening) | Whether a transaction is lawful in that jurisdiction | Appear inside a permitted region or outside a blocked one |
| Content licensing and regional pricing | Catalogue, price or currency shown | Access cheaper or unlicensed regional offers |
| Gig, delivery and ride platforms | Job allocation, proof of arrival, surge areas | Claim jobs or payments without being present |
| Workforce attendance and field service | Clock in and site visit records | Record presence while elsewhere |
| Promotions and referral schemes | Eligibility by area, one offer per locality | Farm offers across many accounts. See the Promotion and Bonus Abuse Guide. |
| Sign-in and Conditional Access | Allow, challenge or block by country or named location | Defeat country blocks or impossible travel rules after credential theft |
The sign-in case overlaps with account takeover: a criminal using stolen credentials routes traffic through a proxy in the victim's home city so that location rules see nothing unusual. The analytics side of that problem is covered in Impossible Travel and Anomalous Sign-In Detection; this guide focuses on how the location itself is faked and how to test whether a reported location is trustworthy.
How device location is faked
A phone works out its position from several sources, and the W3C Geolocation specification lists GPS, IP address, Wi-Fi and Bluetooth MAC addresses, cell IDs and user input as possible sources. Every one of them can be influenced by whoever holds the device.
- Developer mock providers (Android): Android lets a test location provider supply positions. Since API level 31 the platform marks these with
Location.isMock(), which replacedisFromMockProvider()(added in API 18, deprecated in API 31). Android's own documentation says that a mock location "may not be related to the actual location of the device" and advises rejecting mock locations only where accepting real locations alone is essential, because users can have legitimate reasons to mock location. - Software simulation (Apple): from iOS 15 and macOS 12, each
CLLocationcan carryCLLocationSourceInformationwith two properties:isSimulatedBySoftware(generated by on-device software simulation) andisProducedByAccessory(received from an external accessory). Apple suggests an app may reject locations whereisSimulatedBySoftwareis true outside debugging and testing. - Browser overrides: desktop browsers include developer tools that replace the Geolocation API result. Chrome DevTools' Sensors panel accepts a preset city or custom coordinates, so a browser location should be treated as user input.
- Hooked or modified environments: on rooted Android or jailbroken iOS devices, hooking frameworks can intercept location APIs and hide the mock or simulation flags. This is why platform flags are a first filter, not the final answer.
- External accessories and radio spoofing: an external GNSS receiver or a radio transmitter can feed false positions to the device. Radio level spoofing is costly and mostly a concern for aviation, maritime and timing systems; see the GNSS Spoofing and Jamming Guide.
- Emulators and device farms: emulators set location from a control panel, and device farms run many handsets with scripted positions. Device integrity verdicts are the main counter.
How network location is faked
IP geolocation maps an address to a place using commercial databases. It was never precise: MaxMind, a large geolocation data provider, estimates its country accuracy at 99.8%, US state accuracy at about 80% and US city accuracy at about 66% within a 50 km radius, and notes that a lookup through a VPN or proxy identifies the server, not the user. Mobile carrier addresses may only resolve to country or state.
| Method | What the service sees | Useful counter signals |
|---|---|---|
| Commercial VPN | Data centre address in the chosen country | Hosting or VPN classification from IP intelligence; mismatch with device time zone and locale |
| Residential proxy network | A home broadband or mobile address, often in the victim's city | Proxy reputation feeds, connection timing, many accounts per exit address. See the Residential Proxy Networks and Abuse Guide. |
| Tor and multi-hop proxies | A published exit relay | Exit relay lists. See the Anonymity Networks for Defenders Guide. |
| Cloud or corporate proxy | The proxy's egress address, not the user's | Known corporate ranges; Microsoft Entra ID ignores X-Forwarded-For from cloud proxies because its source cannot be validated |
| Forged headers | A client supplied header claiming an origin address | Trust headers only from your own proxies. See the X-Forwarded-For and Proxy Header Trust Guide. |
Network operators can improve accuracy for their own ranges by publishing geofeeds. RFC 8805 (Informational, August 2020) defines a simple CSV format of prefix, country, region and city, and RFC 9632 (Proposed Standard, August 2024) defines how registry records point to a geofeed through a geofeed: attribute, with optional RPKI signatures. Publishing an accurate geofeed for your corporate egress ranges reduces false positives in other providers' location checks for your own staff. Country blocking and data accuracy are covered in Geo-IP Blocking.
Signals that a location is trustworthy
No single signal proves location. The practical approach is to collect several on the server, compare them and score the result. Signals computed inside the app must be sent with integrity protection, because Apple notes that an app cannot rely on its own logic to check itself when the app may be compromised.
| Signal | Source | What it shows | Limit |
|---|---|---|---|
| Mock flag | Android Location.isMock() | Position came from a test provider | Can be hidden on rooted devices |
| Simulation flag | Apple isSimulatedBySoftware | Position came from on-device simulation | iOS 15 and later only; jailbreaks can alter it |
| Device integrity verdict | Play Integrity deviceRecognitionVerdict | MEETS_DEVICE_INTEGRITY means a genuine certified Android device; an empty verdict indicates signs of attack, compromise or a non-physical device | Must be verified server side; MEETS_STRONG_INTEGRITY and MEETS_BASIC_INTEGRITY are opt-in labels |
| App and environment verdicts | Play Integrity appRecognitionVerdict, appAccessRiskVerdict | Unmodified Play build; apps running that can capture, control or overlay | appAccessRiskVerdict is opt-in in Play Console |
| App attestation | Apple App Attest assertions | Request signed by a Secure Enclave key certified for a genuine app instance | Keys do not survive reinstall, device migration or restore |
| Device and network agreement | Your server | GPS country and IP country match; time zone and locale fit | Travellers and roaming produce honest mismatches |
| Physical plausibility | Your server | Speed between fixes is possible; accuracy radius and altitude look real | Needs a history of fixes per device |
Two plausibility checks catch many low effort spoofs. First, compare the distance and time between consecutive fixes and flag implied speeds no vehicle could reach. Second, look at the reported accuracy: the W3C specification defines accuracy as a radius in metres at 68% confidence, and fixes with a perfectly constant accuracy, a value of zero or coordinates repeated to many decimal places over time suggest scripted input. Treat these as scores, since poor signal and indoor positioning create odd values too. Attestation design is covered in depth in the Mobile App Attestation guide.
Choosing a response: decision guidance
The right response depends on what a wrong answer costs. Hard blocks on mock flags lock out developers and accessibility tools, and blocking all VPNs blocks staff and privacy conscious customers.
- Legal or contractual location guarantee: when a regulator or licence requires that a transaction happens inside a jurisdiction, require device location plus network location plus device integrity, deny on failure, and keep evidence of each check. Confirm the exact obligation with the regulator's own rules and your counsel.
- Revenue protection (pricing, promotions, licensing): score and step up. Ask for a payment instrument or billing address from the region, or limit high value offers, rather than refusing service.
- Workforce and field service: combine location with a second presence signal such as scanning an on-site code or connecting to site Wi-Fi, and be transparent with staff about what is collected. Workplace location monitoring has privacy duties; see the Location Data Privacy Guide.
- Sign-in policies: use location to raise risk, not as proof of identity. Phishing resistant authentication does more against account takeover than any location rule; see the Account Takeover Prevention Guide.
Small versus large organisations: a small team can get most of the value from server side Play Integrity and App Attest checks, an IP intelligence feed with VPN and hosting classification, and a simple speed check. Large platforms usually add per device location history, graph analysis linking accounts that share devices or exit addresses, and dedicated geolocation compliance services where regulation demands it.
Where identity fits
Location appears in identity policy in two places. In Microsoft Entra Conditional Access, GPS-based country locations ask the Microsoft Authenticator app for the device's GPS position, check hourly while the user is active, require the user to approve sharing again after 24 hours, run jailbreak detection each time (Play Integrity on Android) and deny authentications where the reported location might not match the device's actual GPS location. IP-based named locations use a periodically updated mapping table, and policies are re-evaluated when apps request new access tokens, about once an hour by default, so a location change can take up to an hour to take effect. For workload identities, location is far more reliable because the egress addresses are yours: pin service principals and API keys to known ranges. See Conditional Access for Workload Identities and How to Detect aws access key use from unusual locations.
How to implement: a phased approach
- Inventory location decisions. List every feature, policy and rule that uses location, what it controls, and the cost of a false accept and a false reject.
- Move decisions to the server. Make sure the server, not the app, decides. Send raw fixes, the mock or simulation flag, accuracy, timestamp and provider to the backend inside a request protected by an integrity token or App Attest assertion bound to a server nonce.
- Add attestation. Integrate Play Integrity and App Attest. On the server, verify the token's request details (package name, nonce or request hash, timestamp) before reading verdicts, as Google's documentation requires.
- Add network intelligence. Enrich each request with IP country, connection type and VPN, hosting, proxy or Tor classification. See the Security Log Enrichment Guide.
- Run in monitor mode. Compute a location risk score for every event but take no action for two to four weeks. Review the distribution, sample flagged cases by hand and tune thresholds.
- Pilot actions on one flow. Apply step-up or holds to the highest value flow first, with a manual review queue and a clear customer message.
- Roll back safely. Keep every rule behind a feature flag with a documented owner, so it can return to monitor mode within one release if false rejects spike, for example after an OS update changes a flag's behaviour.
Detection and measurement
Log per event: account and device identifiers, raw coordinates and accuracy, mock or simulation flag, integrity and attestation result, IP address with its geolocation and classification, time zone and locale, and the decision taken. Keep raw coordinates only as long as needed, because precise location is personal data in most regimes.
- Spoof signal rate: share of location events with a mock flag, failed integrity verdict or impossible speed, tracked weekly by flow.
- Device and network mismatch rate: share of events where GPS country and IP country differ, split by mobile carrier, VPN and travel.
- Confirmed fraud caught: location related fraud cases found by the score versus found later by chargebacks or audits.
- False reject rate: blocked or stepped up events later confirmed legitimate, from support tickets and reviews.
- Accounts per exit address and device: clusters of accounts sharing a proxy exit or handset, a sign of farming.
- Attestation coverage: share of sensitive requests carrying a verified integrity token or assertion.
Framework mapping
| Framework | Reference | How it applies |
|---|---|---|
| NIST SP 800-53 Rev 5 | IA-10 Adaptive Authentication | Step-up when location signals raise risk |
| NIST SP 800-53 Rev 5 | AC-2(12) Account Monitoring for Atypical Usage | Flag atypical locations and clusters |
| NIST SP 800-53 Rev 5 | SI-10 Information Input Validation; SI-7 Software, Firmware, and Information Integrity | Treat client location as untrusted input; verify app and device integrity |
| NIST CSF 2.0 | DE.CM-09, DE.AE-02 | Monitor runtime environments and analyse location anomalies |
| NIST CSF 2.0 | PR.AA-03 | Users, services and hardware are authenticated, with location as a risk input |
| MITRE ATT&CK v20 | T1090 Proxy; T1090.003 Multi-hop Proxy; T1078 Valid Accounts | Proxies used to hide origin when stolen accounts are used |
| MITRE D3FEND | D3-UGLPA User Geolocation Logon Pattern Analysis | Defensive analysis of logon locations. See D3-UGLPA User Geolocation Logon Pattern Analysis. |
| OWASP MASVS | MASVS-RESILIENCE | Resilience against tampering, with server side validation as the base |
Common failure patterns
- Trusting a client side check. The app evaluates the mock flag and sends only "location ok" to the server. A modified app sends the same answer every time.
- Attestation without nonce or request binding. Integrity tokens are requested once and replayed, or the server never checks request details, so a captured token passes for other requests.
- IP country as the only geofence. A residential proxy in the target region defeats it, and MaxMind's own figures show city level IP location is approximate.
- Blocking every VPN. Corporate VPNs, privacy relays and mobile carriers produce honest mismatches; blanket blocks drive up support costs while fraud rings move to residential proxies.
- Ignoring platform versions. Apple's simulation flag needs iOS 15 or later and Android's
isMock()needs API 31, so older devices need the deprecated method or a different weighting. - Keeping precise history too long. Storing every coordinate indefinitely creates a privacy liability that outweighs its fraud value.
Practitioner checklist
- List every location based decision with its owner and the cost of false accepts and false rejects.
- Make every location decision on the server, never in the client.
- Collect
isMock()orisSimulatedBySoftware, accuracy, timestamp and provider with each fix. - Verify Play Integrity tokens and App Attest assertions server side, bound to a one-time nonce.
- Enrich IP addresses with country and VPN, hosting, proxy and Tor classification.
- Compare device location with network location, time zone and locale, and check implied speed between fixes.
- Run new rules in monitor mode first, then pilot on one flow behind a feature flag.
- Publish accurate RFC 8805 geofeeds for your own egress ranges.
- Track spoof signal rate, false reject rate and attestation coverage monthly.
- Set a retention period for raw coordinates and document the lawful basis.
Standards and references
- W3C: Geolocation
- Android Developers: Location class reference
- Apple Developer: CLLocationSourceInformation
- Android Developers: Play Integrity API integrity verdicts
- Apple Developer: Establishing your app's integrity
- Microsoft Learn: Network assignment in Conditional Access policy
- IETF: RFC 9632 Finding and Using Geofeed Data
- MaxMind: Geolocation Accuracy
Related NHI Mgmt Group resources: Device Intelligence and Fingerprinting Guide · Impossible Travel and Anomalous Sign-In Detection · Residential Proxy Networks and Abuse Guide · Mobile App Attestation · GNSS Spoofing and Jamming Guide