Week 3: Flock's map key sat in 53 public pages. Here's how to find keys in your own JavaScript
One unrestricted ArcGIS key, served from 53 Flock Safety pages, opened 50 private map layers. A step-by-step hunt for secrets in your own front end.
Contents
January 7 to 13. The stories people read most, then a hands-on walkthrough you can run against your own site.
What people were reading
These got the most upvotes on Hacker News this week. More upvotes means more people read and talked about it.
- Bose opened the API for its discontinued SoundTouch speakers, about 2,500 upvotes. Instead of bricking them, Bose published the docs so owners can keep them working.
- Flock hardcoded the password for its surveillance maps 53 times, about 520. This week’s walkthrough.
- Vietnam blocks rooted phones from banking apps, about 550. The cat-and-mouse game between root hiding and app checks.
- Iran went into an IPv6 blackout, about 490, visible live on Cloudflare Radar.
- Cloudflare’s CEO on Italy’s fines, about 660, over Italy’s piracy-blocking rules.
Not security, but people were talking about them: resizing windows on macOS Tahoe, Tailwind laying off 75% of its engineers and Apple picking Gemini for Siri.
Walkthrough: finding secrets in your own front-end code
What happened, from the write-up: Flock Safety’s mapping system used an ArcGIS API key. That key sat in the JavaScript of public development sites, the same key on 53 endpoints. It had no referrer, IP or origin limits. Querying ArcGIS with it showed 50 permissions, each opening a private map item. The researcher didn’t open all 50, so what’s in each one isn’t confirmed. The write-up lists the key as rotated after disclosure.
The lesson isn’t “never put a key in JavaScript.” Some keys are meant to be public, like a Supabase anon key or a Google Maps browser key. The lesson is: know every key your front end ships, and make sure each one is locked down. Here’s how to check. Only run this against sites you own or are authorized to test.
1. Download the JavaScript. Grab every script your site loads:
mkdir site-js && cd site-js
wget -q -r -l 2 -nd -A "*.js" https://your-app.example.com/
ls | wc -l
For apps behind a login, open the browser dev tools instead, go to Sources, and save the bundles from there. Don’t forget staging and dev subdomains. Flock’s key came from development sites.
2. Grep for the obvious patterns. A few prefixes give keys away:
grep -oE "AKIA[0-9A-Z]{16}" *.js # AWS access key IDs
grep -oE "AIza[0-9A-Za-z_-]{35}" *.js # Google API keys
grep -oE "AAPK[0-9A-Za-z_-]{20,}" *.js # older ArcGIS API keys
grep -oiE "(api|secret|token)[_-]?key['\": ]+[^'\" ,]{16,}" *.js | head
3. Run a proper scanner. Grep misses a lot. TruffleHog knows hundreds of key formats and can check whether a key still works:
trufflehog filesystem . --results=verified
Gitleaks is a good second opinion:
gitleaks dir . -v
4. For each key you find, answer three questions.
- Is it meant to be public? A Stripe publishable key is fine. A Stripe secret key is not. An AWS access key ID should never be in a browser at all.
- What can it do? Look it up in the provider’s console. For the Flock key, the answer was 50 private items.
- Who can use it? A browser key should be locked to your domain (a referrer restriction) and to only the APIs it needs.
5. Fix it. Restrict the key in the provider’s console (referrer, IP, allowed APIs). If it was never supposed to be public, rotate it now and move the call to your backend, so the secret stays on the server. Then run step 3 again to confirm it’s gone.
6. Keep it from coming back. Add a scanner to your build so a new key fails the pipeline:
gitleaks git . --exit-code 1
Also this week
Flock has a second issue still open. The same researcher reported a token-minting bug on November 13, 2025. Flock acknowledged it on November 19, and it was still unpatched on January 7 (write-up).
End-of-life devices don’t have to become e-waste. Bose publishing the SoundTouch API is the good version of a product dying (Ars Technica). If you test IoT, a published local API is also a published way in. Check what it accepts without a login.
Want this every week? Subscribe.