Skip to content

Claude/review project codebase gt hy8#7

Merged
jackson-jpeg merged 2 commits intov2from
claude/review-project-codebase-gtHY8
Feb 21, 2026
Merged

Claude/review project codebase gt hy8#7
jackson-jpeg merged 2 commits intov2from
claude/review-project-codebase-gtHY8

Conversation

@jackson-jpeg
Copy link
Copy Markdown
Owner

No description provided.

Security fixes:
- Card pack update/delete now require author authentication (previously any socket could modify any pack)
- Whitelist allowed fields in updateCardPack to prevent field injection (id, isBuiltIn, rating, authorId were overwritable)
- Enforce authorId from authenticated socket on card pack creation to prevent spoofing
- Validate reactionType at runtime to prevent arbitrary key injection into reactionCounts object
- Remove window.__plotTwistsSocket debug exposure that leaked authenticated socket + Firebase token to any page script
- Use crypto.randomUUID() for anonymous player IDs instead of predictable Math.random() + Date.now()
- Sanitize spectator message text through sanitizeInput() instead of just trim+slice

Test fixes:
- Add missing runTransaction mock to credit.service.test.ts (6 tests were failing)
- Use mockTxn for transaction assertions instead of mockDb
- Add .unref() to setInterval timers in audience.service and rateLimiter to prevent test process hangs

https://claude.ai/code/session_01FSxLdUboxPNmW6rSPaQ2vw
- player_jump_to_line: Add room membership check and restrict to players
  only (spectators could previously control the teleprompter for everyone)
- submit_cards: Add SELECTION state check and SPECTATOR role rejection
  (spectators could submit cards, and submissions during wrong phases
  would pollute state for sequels/new games)
- submit_vote: Add VOTING state check, self-vote prevention, and target
  player validation (premature votes during PERFORMING could end the game
  early, phantom target IDs produced broken results)
- Card selections: Sanitize character/setting/circumstance strings before
  storing (unsanitized strings flow directly into AI prompts, enabling
  prompt injection)
- startScriptGeneration: Add state guard against double invocation when
  two players submit final cards simultaneously (race condition could
  deduct 2 credits and generate 2 scripts in parallel)

https://claude.ai/code/session_01FSxLdUboxPNmW6rSPaQ2vw
@vercel
Copy link
Copy Markdown

vercel bot commented Feb 21, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
plot-twists Ready Ready Preview, Comment Feb 21, 2026 3:35am

@jackson-jpeg jackson-jpeg merged commit f181099 into v2 Feb 21, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants