Skip to content

fix(security): honor the allow list for IP rate limits - #66541

Open
xO-ox-ai wants to merge 1 commit into
nextcloud:masterfrom
xO-ox-ai:fix/ratelimit-ip-allowlist
Open

xO-ox-ai wants to merge 1 commit into
nextcloud:masterfrom
xO-ox-ai:fix/ratelimit-ip-allowlist

Conversation

@xO-ox-ai

@xO-ox-ai xO-ox-ai commented Nov 12, 2026 •

Copy link
Copy Markdown

Summary

Fix rate limiting for E2EE requests from allowed IPs when "Bypass rate limiting for allowed IPs" is enabled. The existing allow-list check only covers user-specific limits, so the E2EE server-key endpoint still applies its IP limit to allowed clients, including authenticated users falling back to an anonymous limit.

Move the existing opt-in bypass check before selecting user or IP limits. Add regression coverage for both annotations and attributes, anonymous requests, authenticated fallback requests, user-specific limits, and enabled/disabled settings with listed/unlisted IPs.

Validation

  • PHPUnit 11.5.57 / PHP 8.4.27: 24 isolated middleware tests, 156 assertions, all passing. The unchanged middleware fails the four IP-bypass regression cases.
  • Nextcloud coding standard: both changed files pass PHP CS Fixer; PHP syntax and Git whitespace checks pass.
  • The autoloader checker was attempted but cannot complete in this sparse checkout because apps/dav/composer is absent. The full Nextcloud test suite has not been run locally.

Checklist

  • Code is properly formatted.
  • Sign-off message is added to all commits; the contributor will sign personally.
  • Unit tests are included.
  • No frontend changes or documentation changes are required.

AI

Codex (GPT-6) assisted with implementation and regression tests. The commit includes an Assisted-by trailer.

Apply the configured allow-list bypass before selecting user or IP rate
limits, including authenticated requests falling back to an anonymous limit.

Assisted-by: Codex:GPT-6
Signed-off-by: liwei01 <liwei01@h3d.com.cn>
@xO-ox-ai
xO-ox-ai force-pushed the fix/ratelimit-ip-allowlist branch from 390a585 to f7bed0e Compare November 12, 2026 14:44
@xO-ox-ai
xO-ox-ai marked this pull request as ready for review November 12, 2026 14:48
@xO-ox-ai
xO-ox-ai requested a review from a team as a code owner November 12, 2026 14:48
@xO-ox-ai
xO-ox-ai requested review from icewind1991 and provokateurin and removed request for a team November 12, 2026 14:49

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant