# xaitax/x-account-location-device — AlpLab Radar Static Code Audit

- Ring: `trial`
- Category: `dev`
- Overall score: `3.8/5`
- Implementation check: `verified`
- Maturity: `active`
- Audited commit: `7e93b046766f` (read-only; nothing from the repository was executed)
- Reviewed at: 2026-11-30T12:43:25Z
- Repository: https://github.com/xaitax/x-account-location-device
- Radar entry: https://radar.alplab.co/#repo/xaitax/x-account-location-device
- Tags: `browser-extension`, `x-twitter`, `osint`, `content-filtering`, `privacy`, `cloud-cache`

## Summary

Browser extension (Chrome MV3 + Firefox) that surfaces X's About-this-account data (country/region, connection source, location warning) as inline badges, with local hide/highlight filters, statistics, share-image and an optional community cache on the author's Cloudflare Worker; a legacy userscript is included but explicitly not feature-equivalent.

## Implementation Check

Every README feature is implemented in code: badge pipeline in extension/src/content/observer.js and page-script.js, AboutAccountQuery lookups with rate-limit persistence in extension/src/background/api-client.js, hide/highlight filters, statistics, share and the opt-out cloud cache (extension/src/background/cloud-cache.js); the iOS app and donation addresses are the only README items outside this repo.

## When to Use

Use it when you want X's own account-location/connection labels shown inline and want to hide or highlight whole countries, regions or patterns locally without blocking anyone on X. Not for live location tracking, per-post device forensics, or anything requiring verified data — the README itself says labels can be stale or wrong.

## Sub-scores

| Dimension | Score |
|---|---|
| quality | 4.5/5 |
| usability | 4.0/5 |
| reliability | 3.0/5 |
| security | 3.5/5 |
| integration | 4.0/5 |

## Code Evidence

extension/src/content/page-script.js hooks fetch/XHR/Response.json in the MAIN world to harvest user objects from X's own GraphQL responses (bounded walks, dedup, debug counters); extension/src/background/api-client.js implements paced AboutAccountQuery calls honoring x-rate-limit-reset/retry-after with MV3-restart persistence; extension/src/background/cloud-cache.js sends only handle + location/device/accuracy/affiliation metadata (sanitizeInput caps 100 chars, strips tags) and never auth headers; PRIVACY.md documents all flows; 20 check-*.mjs harnesses (~500KB) assert parser, filter, hovercard, chat and backup behavior incl. 'backup contains no authorization header' (check-profiles.mjs:199).

## Issues Found

Legacy userscript/x-account-location-flag.user.js builds badge HTML via innerHTML with interpolated location/device strings (lines 617, 800, 835, 926, 1036) — a minor injection surface the extension itself avoids (zero-innerHTML, see hovercard.js header); its @match '*://*x.com/*' (line 7) is a malformed host pattern that would also match non-x.com hosts ending in x.com; no CI configuration anywhere despite the substantial check suite; repo-root LICENSE file missing.

## Key Risks

Nothing was executed: the check scripts are hand-rolled harnesses with no CI config to run them, so behavior is unproven. Core lookups depend on an undocumented X GraphQL endpoint with a hardcoded query ID (page-script.js ABOUT_QUERY_ID) that breaks when X rotates it, and on reusing the signed-in session's auth headers — an implicit ToS/enforcement risk the README acknowledges. Community cache is enabled by default on new installs (opt-out, disclosed): lookups reveal to the author's server which handles you view. No LICENSE file despite MIT claims in package.json/README. Store builds may lag this source.

## Reviewed Files

- `README.md`
- `PRIVACY.md`
- `extension/package.json`
- `extension/src/manifest.chrome.json`
- `extension/src/background/service-worker.js`
- `extension/src/background/api-client.js`
- `extension/src/background/cloud-cache.js`
- `extension/src/content/page-script.js`
- `extension/src/shared/request-policy.js`
- `extension/src/shared/x-api-headers.js`
- `extension/scripts/check-build.mjs`
- `extension/scripts/zip.js`
- `userscript/x-account-location-flag.user.js`
