Add IP-based rate limiting for draft-creating form submissions#47
Open
dd32 wants to merge 4 commits intoproductionfrom
Open
Add IP-based rate limiting for draft-creating form submissions#47dd32 wants to merge 4 commits intoproductionfrom
dd32 wants to merge 4 commits intoproductionfrom
Conversation
Non-logged-in users are now limited to 3 form submissions per hour per IP address. This prevents pentesters and bots from spamming call-for-speakers, call-for-sponsors, and call-for-volunteers forms with thousands of submissions that create excessive draft posts. Logged-in users bypass the rate limit entirely. Fixes WordPress#1269 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Owner
Author
|
There's an existing anti-spam form thing for this: |
Replace custom transient-based rate limiting with the existing Form_Spam_Prevention class from mu-plugins/utilities, which already provides IP-based throttling via transients with configurable score thresholds and durations. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tests cover the rate_limit_submissions() method: logged-in user bypass, already-spam passthrough, threshold enforcement after 4 submissions, and transient-based reset behavior. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
jetpack_contact_form_is_spamfilter when the limit is exceeded, with a message suggesting the user wait or log inContext
Pentesters and bots have been spamming these forms with thousands of submissions (see montclair.wordcamp.org/2024 with 13,000+ spam entries), creating excessive draft speaker/session/sponsor/volunteer posts. This is a simple first line of defense as suggested in WordPress#1269.
Test plan
Fixes WordPress#1269
🤖 Generated with Claude Code