Fix Hellenistic comprehensive Admin cache IDOR - #48
Draft
cursor[bot] wants to merge 2 commits into
Draft
cursor[bot] wants to merge 2 commits into
cursor[bot] wants to merge 2 commits into
Conversation
Unauthenticated POST /api/hellenistic/comprehensive trusted body userId for Admin-SDK cache reads and writes. A caller could overwrite another user's hellenistic-astrology/current document. Gate cache R/W to the owned Firebase UID; missing tokens stay stateless for Stage B. Co-authored-by: ANDY OLIVER ROZARIO <AndyOliverR@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Aug 23, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
POST /api/hellenistic/comprehensive: bodyuserIdis no longer trusted forusers/{userId}/hellenistic-astrology/currentreads/writes.decideUserScopedAccesshelper: owned Firebase UID can read/write cache; missing token stays stateless (Stage B); invalid token → 401; UID mismatch → 403.fetchWithFirebaseAuthRequiredso owned cache access works.Why this change is safe
useCacheoption + tests; no unrelated refactors).Verification
pnpm exec eslinton touched files (0 errors; pre-existing warnings only)pnpm test— 64 suites / 331 tests passedpnpm run lint:securitypassed (pnpm run securityaudit still reports pre-existing highnanoid+extract-zip)Regression prevention
tests/unit/userScopedAccess.test.ts,tests/unit/hellenisticAstrologyCache.test.ts, andtests/integration/hellenistic-comprehensive-auth.test.ts(mismatch 403, missing-token skips cache, owned cache allowed, invalid token 401).Release checklist (solo-friendly)
CI / Lint + JestCI / Playwright smokemain.POST /api/hellenistic/comprehensivewith a victimuserIddoes not writeusers/{victim}/hellenistic-astrology/current.