fix: trim whitespace from IP whitelist entries in failed-login protection#39918
fix: trim whitespace from IP whitelist entries in failed-login protection#39918Atharva76-cpu wants to merge 3 commits into
Conversation
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
🦋 Changeset detectedLatest commit: 7617fe1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 41 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
WalkthroughFixes whitelist parsing in failed-login protection: the IP whitelist string is split on commas, each entry is trimmed of whitespace, and empty entries are removed before checking membership against the incoming IP. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
I have signed the CLA |
Proposed changes (including videos or screenshots)
The
Block_Multiple_Failed_Logins_Ip_Whitelistsetting splits IPs bycomma but never trimmed whitespace, causing valid whitelisted IPs to
still get blocked when entries had spaces after commas.
192.168.0.10(with leading space) failed strict equality againstactual IP
192.168.0.10.Fix: Added
.map((entry) => entry.trim()).filter(Boolean)after.split(',')inrestrictLoginAttempts.tsBefore:
After:
Issue(s)
Closes #39915
Steps to test or reproduce
Block_Multiple_Failed_Logins_EnabledBlock_Multiple_Failed_Logins_By_Ip127.0.0.1, 192.168.0.10(space after comma)192.168.0.10Further comments
Minimal, focused fix with no side effects.
.filter(Boolean)alsohandles empty strings from trailing commas in the setting value.
Note: A changeset file will be added if required by maintainers.
Summary by CodeRabbit