Hardening: plain-http wp-login.php redirect loop under FORCE_SSL_ADMIN #16
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type: hardening / availability (fails closed). Found by security audit run 3 (commit
01195c8) in a local lab. Shares the root cause of #9.What happens
Under
FORCE_SSL_ADMIN, core'swp-login.phpandauth_redirect()issue an https-upgrade redirect for plain-http requests.RedirectGuard::filterRedirect(src/Rewrite/RedirectGuard.php:31-38) passes thatLocationthroughUrlRewriter::rewrite, which replaces the scheme with the request scheme (src/Rewrite/UrlRewriter.php:61), so the upgrade redirect points back tohttp://and the browser loops. No credentials are sent (it fails closed), but login and wp-admin are unavailable over plain http.Suggested fix
The never-downgrade rule proposed in #9 (keep https when the input URL is https, for clearnet hosts) also fixes this. Add a regression test:
filterRedirect('https://<configured>/wp-login.php')on an http request returns https.