osuAkatsuki / bancho.py

An osu! server for the generic public, optimized for maintainability in modern python
https://akatsuki.gg
MIT License
201 stars 126 forks source link

Per-checksum score submission locks to prevent score duplicates #557

Closed cmyui closed 5 months ago

cmyui commented 5 months ago

Describe your changes

There is an ongoing issue due to this TOCTOU bug where scores (with identical checksums) may submit more than a single time (and award duplicate pp/score/etc.) if multiple get between the start and end conditions simultaneously.

This change adds a concurrency lock around the affected area to ensure only one runs at a time.

Related Issues / Projects

Checklist

cmyui commented 5 months ago

cc @minisbett