-
-
Notifications
You must be signed in to change notification settings - Fork 83
Open
Description
Describe the bug
Critical authorization bypass in voting system. Any authenticated player can vote on any dealt card (including their own) by executing JavaScript commands in browser console. The toggle_vote handler in player_live/show.ex lacks ownership validation, allowing complete voting manipulation and player can get more votes than voting limit.
Expected behavior
- Players can only vote on other players' cards
- Self-voting should be blocked server-side
- Vote access should be validated by card ownership (
dealt_card.player_id != current_player.id)
Desktop
- OS: Windows 11
- Browser: Chrome 120+
- Version: Latest
Video Demo
2026-03-08.01-05-33.mp4
Additional context
Root cause: Line 132 in player_live/show.ex - DealtCard.find(dealt_card_id) fetches any card without checking dealt_card.player_id.
Impact:
- Game integrity compromised
- Players can boost own scores
- Fair competition destroyed
- Test case in
player_live_test.exs:120confirms vulnerability
Fix needed: Add authorization check in handle_event("toggle_vote", ...) before processing votes.
Script Used
const fake = document.createElement('div');
fake.setAttribute('phx-click', 'toggle_vote');
fake.setAttribute('phx-value-dealt_card_id', '47588');
document.body.appendChild(fake);
fake.click();
document.body.removeChild(fake);
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels