Repository navigation
Normalize redirect URL authority before host matching - #14348
Conversation
Require a host[:port] authority on http(s) URLs so parse_url() and browser URL parsers agree on the host before platform matching. Co-authored-by: Jake Barnby <[email protected]>
Security rulesNo new WARNING or ERROR findings from security rules. 19 existing findings tracked in
|
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
|
Review complete. No issues found — approved ✅. This PR hardens origin/redirect URL validation by rejecting backslashes, userinfo (
The validator is shared by the CSRF origin check and all url-taking endpoints (recovery, verification, magic URL, OAuth callbacks, team invites), so the fix is global by construction. Note: userinfo in http(s) redirect URLs is now rejected entirely, a deliberate behavioral tightening worth a changelog mention. Reviewed commit: 4329a56 |
🟢 Tier S · Ready to merge
The Origin validator now rejects HTTP(S) URLs with backslashes, userinfo, or control characters in the authority before matching the host against allowed platforms. The change adds unit and account recovery E2E coverage and maps the validator files to the Account E2E lane.
📂 Walkthrough · 4
Merged |
What does this PR do?
parse_url()and browser URL parsers can split an http(s) authority differently when the authority contains\. Host matching then sees a different host than the one a browser would use.This change requires a normalized
host[:port]authority on http(s) URLs before comparing the host to the project's platform list:\in the authority@in the authority)Ordinary platform URLs stay accepted, including ports, paths, query strings, and custom schemes used by mobile platforms.
Test Plan
tests/unit/Network/Validators/OriginTest.phpcover backslash forms (\@,\\,/\), userinfo forms, control characters, and accepted platform URLsPOST /account/recoveryrejects a backslash authority and a userinfo URLcomposer linton the touched PHP files andvendor/bin/phpunit tests/unit/Network/Validators/OriginTest.phpRelated PRs and Issues
Checklist