Merged
Conversation
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
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
No description provided.