• Your Name's avatar
    Fix timing-attack: lock extraction result before signalling video player · 28ab7f76
    Your Name authored
    Commit match.result, under_over_result, and winning_outcomes atomically to
    the DB before sending PLAY_VIDEO_MATCH. A crash after this commit always
    recovers the same outcome on restart; before this fix, killing the process
    between extract_match() and the bet-settlement commit re-rolled the random
    draw on each restart, allowing an attacker to loop until a desired outcome
    was selected.
    
    Also adds an idempotency guard at the top of _handle_match_start: if the
    result is already committed (crash between lock and settlement), bets are
    re-settled from the stored result without re-extraction.
    
    Replaces the random fallback in _handle_play_video_match_done with a DB
    lookup of match.result, which is now always committed before the video
    player is signalled.
    Co-Authored-By: 's avatarClaude Sonnet 4.6 <noreply@anthropic.com>
    28ab7f76
Name
Last commit
Last update
assets Loading commit data...
docs/superpowers Loading commit data...
mbetterclient Loading commit data...
web Loading commit data...
.gitignore Loading commit data...
AI.PROMPT Loading commit data...
API_AUTHENTICATION_DOCUMENTATION.md Loading commit data...
BROKER_BILLING_SYSTEM_PLAN.md Loading commit data...
CHANGELOG.md Loading commit data...
CLIENT_SYNC_MINIMAL_PROMPT.md Loading commit data...
DISCOVERY_README.md Loading commit data...
DOCUMENTATION.md Loading commit data...
EXTRACTION_ALGORITHM.md Loading commit data...
FULL_RESYNC_IMPLEMENTATION_SUMMARY.md Loading commit data...
GAME_FLOW_DIAGRAM.md Loading commit data...
GAME_LOGIC_DOCUMENTATION.md Loading commit data...
HEADLESS_STREAMING_IMPLEMENTATION.md Loading commit data...
LICENSE Loading commit data...
MbetterClient_wrapper.sh Loading commit data...
PyQt6_UPGRADE_SUMMARY.md Loading commit data...
PyQt6_VIDEO_PLAYER_DOCUMENTATION.md Loading commit data...
README.md Loading commit data...
REPORTS_SYNC_500_ERROR_DEBUG_GUIDE.md Loading commit data...
REPORTS_SYNC_API_SPECIFICATION.txt Loading commit data...
REPORTS_SYNC_FIX_SUMMARY.md Loading commit data...
REPORTS_SYNC_IMPLEMENTATION_SUMMARY.md Loading commit data...
REPORTS_SYNC_PROTOCOL_DOCUMENTATION.md Loading commit data...
USER_WORKFLOW_DOCUMENTATION.md Loading commit data...
analyze_keyframes.sh Loading commit data...
build.bat Loading commit data...
build.py Loading commit data...
build.sh Loading commit data...
build_pyqt6.sh Loading commit data...
build_test.sh Loading commit data...
check_bets.py Loading commit data...
check_database_matches.py Loading commit data...
check_database_schema.py Loading commit data...
clean.sh Loading commit data...
clean_pyqt6.sh Loading commit data...
cleanup_orphans.sh Loading commit data...
cookies.txt Loading commit data...
create_bet_all_outcomes.py Loading commit data...
create_icon.py Loading commit data...
create_test_matches.py Loading commit data...
create_test_yesterday_fixture.py Loading commit data...
create_yesterday_fixture_test.py Loading commit data...
delete_all_bets.py Loading commit data...
gpu_debug.py Loading commit data...
main.py Loading commit data...
mbetter_discovery.py Loading commit data...
mbetter_discovery_icon.ico Loading commit data...
mbetter_discovery_icon_preview.png Loading commit data...
mysql.conf.sample Loading commit data...
nginx.conf Loading commit data...
pyqt6_amd64-2026-01-05T23:47:39Z.build Loading commit data...
pyqt6_amd64.build Loading commit data...
qt.conf Loading commit data...
remote_debug.sh Loading commit data...
requirements.txt Loading commit data...
setup_discovery.py Loading commit data...
test_api_authentication.py Loading commit data...
test_api_key_endpoints.py Loading commit data...
test_api_key_model.py Loading commit data...
test_api_keys.py Loading commit data...
test_auth_verification.py Loading commit data...
test_broker_api_key.py Loading commit data...
test_cancel_bet.py Loading commit data...
test_cancel_logic.py Loading commit data...
test_config_auth.py Loading commit data...
test_cross_day_fixture_fix.py Loading commit data...
test_extract_match_updated.py Loading commit data...
test_extraction_accounting.py Loading commit data...
test_full_resync.py Loading commit data...
test_headless_streaming.py Loading commit data...
test_hls_diagnosis.sh Loading commit data...
test_last_sync_query.py Loading commit data...
test_overlay_scaling_simple.py Loading commit data...
test_progress_bar.html Loading commit data...
test_reports_daily_alignment.py Loading commit data...
test_reports_stats_repair_migration.py Loading commit data...
test_reports_sync.py Loading commit data...
test_reports_sync_db.py Loading commit data...
test_reports_sync_fix.py Loading commit data...
test_reports_sync_summary.py Loading commit data...
test_scaling_calculation.py Loading commit data...
test_settlement_consistency.py Loading commit data...
test_version_bump_1031.py Loading commit data...