The _finishGame()
and _handleTie()
functions fail to fully reset critical game state variables, allowing residual player scores and commitments to persist after game resolution. This compromises fairness in subsequent games involving the same players.
Affected Functions
RockPaperScissors:_finishGame()
RockPaperScissors:_handleTie()
Root Cause Analysis
The state reset logic in _determineWinner()
only partially clears game data:
Attack Flow
Game 1: Patrick wins 2-1
scoreA = 2
persists in storage
Game 2: New game starts
Inherits residual scoreA
value
Result: Patrick begins Game 2 with 2-0 advantage
Unearned advantage in subsequent games
Score inflation exploits
Manual Code Review
Immediate Fix
Call _resetGameState() in both:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.