# ExpressVPN Browser Extension: HTML5 Geolocation Spoof Bypass - Client Physical Location Leak

ExpressVPN extension's geolocation spoof content script trusted window.postMessage from any page, letting a malicious site disable spoofing and leak the user's real physical location.

- Payout: $1,250
- Severity: high
- Program: ExpressVPN
- Found by: Bitspinner
- Disclosed: 2023-08-15
- Write-up quality: 7/10
- Original: https://bugcrowd.com/disclosures/a3ece17b-5da7-452d-a6dc-04398700c71d/expressvpn-browser-extension-html5-geolocation-spoof-bypass-client-physical-location-leak
- Library page: https://bugbountylibrary.com/r/bc%3Ae97730cc-7fc1-4e4a-9e14-e49802f58598
- Tags: area:os domain:browser impact:pii-leak kind:bounty platform:bugcrowd sev:high tech:chromium technique:chained technique:source-review vuln:info-disclosure vuln:misconfiguration

**Target:** ExpressVPN browser extension (gps.js content script, HTML5 geolocation spoof feature)
**Root cause:** The injected gps.js event listener validated only that event.source == window, so any page script could post a 'updateLocation' message with fakeIt:false and flip hookedObj.fakeGeo to false, disabling spoofing.
**Steps:**
1. Install ExpressVPN extension, connect, enable HTML5 location spoofing.
2. Visit attacker page (or XSS on trusted site) that runs `setInterval(()=>{window.postMessage({method:'updateLocation',info:{fakeIt:false,coords:{lat:99.9999,lon:99.9999}}},'*')},1000)`.
3. Approve location permission for the page.
4. Page reads navigator.geolocation and receives the real physical coordinates instead of the spoofed ones.
**How found:** Source review of gps.js: noticed the postMessage listener only checked event.source == window, which is trivially satisfiable by any page script, and that the message handler set hookedObj.fakeGeo directly.
**Exploitation:** Attacker hosts a malicious page or weaponizes XSS on a trusted site (e.g. maps.google.com); the page repeatedly posts an updateLocation message with fakeIt:false, flipping the spoofing flag in the injected closure. Once spoofing is off, the page calls the geolocation API and exfiltrates the victim's real coordinates.
**Escalation:** Chaining with XSS on a trusted origin removes the need for the victim to visit an attacker site; combining timestamp + real location + VPN server IP could correlate the user's private IP.
**Insight:** Content scripts that bridge page and extension via window.postMessage must authenticate the sender (e.g. secret token or checking event.origin against an allowlist); event.source==window is not a trust boundary because the page itself is the sender.

## Proof of concept (copied exactly from the original report)

**postMessage payload disabling geolocation spoof**

```
setInterval(()=>{
 // bypass spoofing by posting a message to update 'hookedObj' in gps.js
 let info = {
 fakeIt: false,
 coords: {
 lat: 99.9999,
 lon: 99.9999,
 }

 window.postMessage({ method: 'updateLocation', info: info }, "*")
 }

}, 1000)
```

