Hardening: allowed_redirect_hosts widening also relaxes core's SSRF guard for configured hosts #11
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 (not a confirmed vulnerability). Found by security audit run 3 (commit
01195c8), observed in a local WordPress 7.1.3 lab.What happens
RedirectGuard::filterAllowedHosts(src/Rewrite/RedirectGuard.php:60-69) adds every configured host toallowed_redirect_hosts. Core also consults that list from its outbound-request guard: thehttp_request_host_is_externalfilter callswp_validate_redirect. As a result, any configured host that resolves to a private/internal IP becomes fetchable bywp_safe_remote_*(pingback source fetches, oEmbed discovery, etc.) on ports 80/443/8080.Lab: with the plugin active,
wp_http_validate_url()acceptedhttp://example.test/,http://example.test:8080/andhttp://<onion>/(all resolving to a private 172.16.x address); with the plugin inactive core rejected all three.Why it is only hardening
Reach is limited to admin-configured hosts, which by the plugin's contract are aliases of this same install, so no attacker-chosen destination is reachable. On multisite, though, a sub-site admin chooses the list (see #6).
Suggested fix
Either document this next to the existing allowed_redirect_hosts warning in the settings page/README, or scope the filter so it does not widen the SSRF check, e.g. skip adding hosts while
http_request_host_is_externalis running, or add only the current request host rather than every configured host.