Skip to content

Enforce IP block after routing so SEF password-reset URLs stay reachable - #230

Merged
codeling merged 1 commit into
mainfrom
fix-sef-password-reset-block-after-route
Oct 2, 2026
Merged

codeling merged 1 commit into
mainfrom
fix-sef-password-reset-block-after-route

Conversation

@codeling

@codeling codeling commented Oct 1, 2026

Copy link
Copy Markdown
Owner

Problem

With search-engine-friendly URLs (Joomla's default), a blocked user can't reach the password-reset page. isPasswordRecoveryRequest() ran in onAfterInitialise, before Joomla routed the request, so option/view were still empty for URLs like /index.php/component/users/reset. Joomla also redirects the non-SEF reset link to the SEF one. The same applied to the unblock-token and login-only checks, which read the same input.

Change

  • Subscribe to onAfterRoute; block enforcement (allow-list, active-block lookup, unblock/password-recovery/login-only exemptions, block response) moved there.
  • onAfterInitialise keeps setup and the purge of old entries.
  • Test harness (fixtures/request.php) dispatches onAfterRoute after onAfterInitialise (--no-route skips it); new test testBlockIsEnforcedOnlyAfterRouting.

Notes

  • Blocked requests are now routed before being rejected; a routing error for a nonexistent URL could precede the block page.
  • Integration tests were not run (no Joomla install available in the authoring session), only PHP lint. The in-process harness passes parameters directly, so it can't reproduce the SEF case; please verify over HTTP with SEF on: /index.php/component/users/reset and /remind as a blocked IP should load, other URLs stay blocked.

🤖 Generated with Claude Code

https://claude.ai/code/session_012WRXzvnnYWqSNzhQUDLdWB


Generated by Claude Code

With search-engine-friendly URLs, option/view are empty during
onAfterInitialise, so the password recovery exemption never matched.
Move block enforcement to onAfterRoute.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012WRXzvnnYWqSNzhQUDLdWB
@codeling
codeling merged commit b11a6bc into main Oct 2, 2026
9 checks passed
@codeling
codeling deleted the fix-sef-password-reset-block-after-route branch October 2, 2026 20:46
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.

2 participants