Fix: apply rate limiting to save and submit operations #898
Draft
Fix: apply rate limiting to save and submit operations #898
Conversation
added 9 commits
January 20, 2026 22:01
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Protection from spamming save and/or submit buttons by bots or very angry humans.
Changes
api/security.php.csrf_token.phpto act as a lightweight endpoint that fetches tokens via the new security API.postData:Notes for Reviewer
Checks for save and submit happen independently (Dual rate limiting)
Dual rate limiting - Each operation type has its own independent rate limit:
send_xml_file.php rate-limits submits to 10/hour (action: 'submit')
save_data.php rate-limits saves to 300/hour (action: 'save')
When a submit happens:
Rate limit check 1: send_xml_file.php checks 'submit' action (10/hour)
Rate limit check 2: save_data.php checks 'save' action (300/hour) when internally called
Both checks pass independently; they don't consume each other's quota.
Checklist
Known Issues
The protection in this PR and in feedback-protection is based on IP, which can be problematic if a research group is using the same router. A better solution would be session+IP limiting.