You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug (watch the full video)
The API endpoint PUT /api/games/:game_id/players/:player_id/card (play_card action) has no rate limiting protection. Testing shows 100 simultaneous requests are all processed, with 29 succeeding and 71 returning 406 errors. This creates a resource exhaustion vulnerability where attackers can flood the database with concurrent operations and disrupt game state integrity.
Expected behavior
API should implement rate limiting to reject excessive requests with HTTP 429 status after a reasonable threshold (e.g., 10 requests per minute per IP). Only the first valid request should succeed; subsequent duplicate requests should be blocked before database operations.
Video Demo
2026-03-07.20-08-44.mp4
Desktop (please complete the following information):
OS: Any (tested on Windows)
Browser: Chrome, Firefox, Safari
Version: Latest
Additional context
Vulnerability confirmed via browser console attack script
Each request triggers database queries and game state updates
Race conditions allow multiple successful card plays (29% success rate)
WebSocket broadcasts triggered for each successful play
Production server vulnerable to DoS attacks
Fix: Add RateLimiterPlug to :api pipeline in router.ex
Describe the bug (watch the full video)
The API endpoint
PUT /api/games/:game_id/players/:player_id/card(play_card action) has no rate limiting protection. Testing shows 100 simultaneous requests are all processed, with 29 succeeding and 71 returning 406 errors. This creates a resource exhaustion vulnerability where attackers can flood the database with concurrent operations and disrupt game state integrity.Expected behavior
API should implement rate limiting to reject excessive requests with HTTP 429 status after a reasonable threshold (e.g., 10 requests per minute per IP). Only the first valid request should succeed; subsequent duplicate requests should be blocked before database operations.
Video Demo
2026-03-07.20-08-44.mp4
Desktop (please complete the following information):
OS: Any (tested on Windows)
Browser: Chrome, Firefox, Safari
Version: Latest
Additional context
Worst-Case Scenario
Script Used