René's URL Explorer Experiment


Title: Angular SSR pathname normalization can turn a same-origin navigation into an open redirect · Issue #71076 · angular/angular · GitHub

Open Graph Title: Angular SSR pathname normalization can turn a same-origin navigation into an open redirect · Issue #71076 · angular/angular

X Title: Angular SSR pathname normalization can turn a same-origin navigation into an open redirect · Issue #71076 · angular/angular

Description: Description A route whose path ends in a parameter and has children is enough for AngularNodeAppEngine to return a cross-origin redirect from the request path alone — no application redirectTo, no guard, no resolver, no X-Forwarded-* con...

Open Graph Description: Description A route whose path ends in a parameter and has children is enough for AngularNodeAppEngine to return a cross-origin redirect from the request path alone — no application redirectTo, no ...

X Description: Description A route whose path ends in a parameter and has children is enough for AngularNodeAppEngine to return a cross-origin redirect from the request path alone — no application redirectTo, no ...

Opengraph URL: https://github.com/angular/angular/issues/71076

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Angular SSR pathname normalization can turn a same-origin navigation into an open redirect","articleBody":"### Description\n\nA route whose path ends in a parameter and has children is enough for `AngularNodeAppEngine` to return a cross-origin redirect from the request path alone — no application `redirectTo`, no guard, no resolver, no `X-Forwarded-*` control, no authentication:\n\n```text\nGET /.;/(//evil.test)   ->   302 Location: //evil.test\n```\n\nA browser resolves `//evil.test` as protocol-relative and leaves the application's origin.\n\nThe Router serializes the navigation to `/.//evil.test`. That string starts with `/.`, not `//`, and resolves to the application's own origin, so neither guard in `ServerPlatformLocation.replaceState()` fires , but WHATWG normalization pops the preceding segment, leaving `pathname === '//evil.test'`.\n`@angular/ssr` then emits that pathname as the redirect target without normalizing it:\n\n```ts\nconst { pathname, search, hash } = envInjector.get(PlatformLocation);\n\nif (urlToRenderString !== finalUrl) {\n  redirectTo = [pathname, search, hash].join(\"\");\n}\n```\n\nA pathname may legally begin with `//`, so nothing upstream is malformed. The comparison arm normalizes its inputs; the redirect arm does not.\n\n### Minimal Reproduction\n\n```ts\nimport { Component } from \"@angular/core\";\nimport { RouterOutlet, Routes } from \"@angular/router\";\n\n@Component({ imports: [RouterOutlet], template: \"\u003crouter-outlet />\" })\nexport class TenantLayout {}\n\n@Component({ template: \"tenant page\" })\nexport class TenantPage {}\n\nexport const routes: Routes = [\n  {\n    path: \":tenant\",\n    component: TenantLayout,\n    children: [{ path: \"**\", component: TenantPage }],\n  },\n];\n```\n\n```bash\nnpm run build\nNG_ALLOWED_HOSTS=localhost PORT=4000 node dist/repro/server/server.mjs\n```\n\n```bash\nfor p in '/.;/(//evil.test)' '/xx;/(//evil.test)' '/acme'; do\n  printf '%-22s ' \"$p\"\n  curl -s -o /dev/null -w '%{http_code}  %{redirect_url}\\n' --path-as-is \"http://localhost:4000$p\"\ndone\n```\n\n```text\n/.;/(//evil.test)      302  http://evil.test/\n/xx;/(//evil.test)     302  http://localhost:4000/xx//evil.test\n/acme                  200\n```\n\nThe second line is the control: `.` replaced with `xx` removes the dot-segment pop and the redirect stays on the origin. `/.;/(/evil.test)` gives `location: /evil.test`, also same-origin , both the popping dot segment and the leading empty segment are required.\n\n\n### Minimal Reproduction\n\nSee https://github.com/SkyZeroZx/angular-ssr-router-open-redirect\n\n### Your Environment\n\n```text\n22.2.0\n```\n\n### Anything else relevant?\n\n**The canonical application-side mitigation does not stop it.** A `returnUrl` check requiring a relative, non-protocol-relative path accepts `/.;/(//evil.test)`, so an application that validated correctly still redirects off-origin:\n\n```ts\nexport const returnUrlGuard = (route: ActivatedRouteSnapshot) => {\n  const target = route.queryParamMap.get(\"returnUrl\") ?? \"/\";\n  if (!target.startsWith(\"/\") || target.startsWith(\"//\")) {\n    return true;\n  }\n  return inject(Router).parseUrl(target);\n};\n```\n\nWith `{ path: \"login\", component: Login, canActivate: [returnUrlGuard] }` added to the config above:\n\n```text\n/login?returnUrl=%2F.%3B%2F(%2F%2Fevil.test)   302  location: //evil.test   \u003c- accepted\n/login?returnUrl=https%3A%2F%2Fevil.test       200  no redirect             \u003c- rejected\n/login?returnUrl=%2F%2Fevil.test               200  no redirect             \u003c- rejected\n```\n\n`router.navigateByUrl(target)` behaves the same. This moves the payload into a query parameter, so the delivered link is `/login?returnUrl=...` rather than a visibly odd path. `search` is concatenated unchanged, so query parameters reach the redirect target.\n\n**Also reachable without a literal `.` or `//` in the request:** `GET /%2e;/(/\\evil.test)` returns `location: //evil.test`, since `%2e` is decoded and `\\` normalized after any inspection of the raw path.\n\n**Affected shapes:** a parameter route with children, plain or lazy, whose descendants can match a two-segment group, at URL depth ≤ 2. Childless parameter routes, children without a `**`, a `**` child using `redirectTo`.","author":{"url":"https://github.com/SkyZeroZx","@type":"Person","name":"SkyZeroZx"},"datePublished":"2026-09-30T04:50:22Z","url":"https://github.com/angular/angular/issues/71076"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:265f6023-6210-1102-5e7d-32fe5cf805a2
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idD146:3458B4:D6B6:123A7:6AFDC9BA
html-safe-noncebecb8a6a6540bb811b28c3a5def011b74ddd0327f62fb992811362e2b32ea177
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMTQ2OjM0NThCNDpENkI2OjEyM0E3OjZBRkRDOUJBIiwidmlzaXRvcl9pZCI6IjExNjc0Mjk4NzU4NjI5ODEwNTAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac7441e2b66da269a9ad04ad1d97d1dbf6b7f7bf6f5e35bded98437c8ee79d9ab7
hovercard-subject-tagissue:5643357465
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/71076/issue_layout
twitter:imagehttps://opengraph.githubassets.com/9791a3710f1e21e361448d633b6f139c00bce101333ffeb27b96498f56ea7dbd/angular/angular/issues/71076
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/9791a3710f1e21e361448d633b6f139c00bce101333ffeb27b96498f56ea7dbd/angular/angular/issues/71076
og:image:altDescription A route whose path ends in a parameter and has children is enough for AngularNodeAppEngine to return a cross-origin redirect from the request path alone — no application redirectTo, no ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameSkyZeroZx
hostnamegithub.com
expected-hostnamegithub.com
None9ab00cc3b4fa90bbd3da70765dd38efc23cfa9d9b0930e41feea2bf67f60ecaf
turbo-cache-controlno-preview
go-importgithub.com/angular/angular git https://github.com/angular/angular.git
octolytics-dimension-user_id139426
octolytics-dimension-user_loginangular
octolytics-dimension-repository_id24195339
octolytics-dimension-repository_nwoangular/angular
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id24195339
octolytics-dimension-repository_network_root_nwoangular/angular
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release1b795ba060b92691fc16c5a12cf2bf95e83432b4
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/angular/angular/issues/71076#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F71076
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F71076
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=angular%2Fangular
Reloadhttps://github.com/angular/angular/issues/71076
Reloadhttps://github.com/angular/angular/issues/71076
Reloadhttps://github.com/angular/angular/issues/71076
angularhttps://github.com/angular
angularhttps://github.com/angular/angular
Codehttps://github.com/angular/angular
Issues833 (833)https://github.com/angular/angular/issues
Pull requests126 (126)https://github.com/angular/angular/pulls
Discussionshttps://github.com/angular/angular/discussions
Actionshttps://github.com/angular/angular/actions
Projectshttps://github.com/angular/angular/projects
Security and quality40 (40)https://github.com/angular/angular/security
Insightshttps://github.com/angular/angular/insights
https://github.com/angular/angular
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/71076
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/71076
#71094https://github.com/angular/angular/pull/71094
#71077https://github.com/angular/angular/pull/71077
Angular SSR pathname normalization can turn a same-origin navigation into an open redirecthttps://github.com/angular/angular/issues/71076#top
#71094https://github.com/angular/angular/pull/71094
#71077https://github.com/angular/angular/pull/71077
area: serverIssues related to server-side renderinghttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20server%22
needsTriagehttps://github.com/angular/angular/milestone/83
https://github.com/SkyZeroZx
SkyZeroZxhttps://github.com/SkyZeroZx
on Sep 30, 2026https://github.com/angular/angular/issues/71076#issue-5643357465
https://github.com/SkyZeroZx/angular-ssr-router-open-redirecthttps://github.com/SkyZeroZx/angular-ssr-router-open-redirect
SkyZeroZxhttps://github.com/SkyZeroZx
on Sep 30, 2026https://github.com/angular/angular/issues/71076#event-32147328992
fix(@angular/ssr): prevent open redirect via protocol-relative pathnamehttps://github.com/SkyZeroZx/angular-cli/commit/ce252f848a74801ff825f829a1363f46ee8575b5
ce252f8https://github.com/SkyZeroZx/angular-cli/commit/ce252f848a74801ff825f829a1363f46ee8575b5
angular-robothttps://github.com/apps/angular-robot
area: serverIssues related to server-side renderinghttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20server%22
gemini-triagedhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22gemini-triaged%22
on Sep 30, 2026https://github.com/angular/angular/issues/71076#event-32147340212
ngbothttps://github.com/apps/ngbot
needsTriagehttps://github.com/angular/angular/milestone/83
on Sep 30, 2026https://github.com/angular/angular/issues/71076#event-32147341959
alan-agius4https://github.com/alan-agius4
angular/angular-clihttps://github.com/angular/angular-cli
on Sep 30, 2026https://github.com/angular/angular/issues/71076#event-32147358658
atscotthttps://github.com/atscott
completedhttps://github.com/angular/angular/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
d7d81e1https://github.com/angular/angular/commit/d7d81e189d227108c3b9d39178dbb7389f6f970d
on Sep 30, 2026https://github.com/angular/angular/issues/71076#event-32172941280
atscotthttps://github.com/atscott
on Sep 30, 2026https://github.com/angular/angular/issues/71076#event-32172946338
fix(platform-server): reject protocol-relative paths in resolveUrlhttps://github.com/angular/angular/commit/928dcfd2582152655b5559509d057bf6a5a19521
https://docs.github.com/articles/closing-issues-via-commit-messages
928dcfdhttps://github.com/angular/angular/commit/928dcfd2582152655b5559509d057bf6a5a19521
fix(platform-server): reject protocol-relative paths in resolveUrlhttps://github.com/angular/angular/commit/83944fc8c50e86be90e8ec4184cd15002b5af262
https://docs.github.com/articles/closing-issues-via-commit-messages
83944fchttps://github.com/angular/angular/commit/83944fc8c50e86be90e8ec4184cd15002b5af262
fix(platform-server): reject protocol-relative paths in resolveUrlhttps://github.com/angular/angular/commit/450af9c813c7660b9bd91e5635f705ee3ed7b32a
https://docs.github.com/articles/closing-issues-via-commit-messages
450af9chttps://github.com/angular/angular/commit/450af9c813c7660b9bd91e5635f705ee3ed7b32a
angular-robothttps://github.com/angular-robot
on Sep 30, 2026https://github.com/angular/angular/issues/71076#event-32174333773
fix(platform-server): reject protocol-relative paths in resolveUrlhttps://github.com/angular-robot/angular/commit/d7d81e189d227108c3b9d39178dbb7389f6f970d
https://docs.github.com/articles/closing-issues-via-commit-messages
d7d81e1https://github.com/angular-robot/angular/commit/d7d81e189d227108c3b9d39178dbb7389f6f970d
atscotthttps://github.com/atscott
on Sep 30, 2026https://github.com/angular/angular/issues/71076#event-32181891625
fix(router): fall back when serializing protocol-relative URLshttps://github.com/atscott/angular/commit/aa3c99070a597b38d98e071579d0865540f80525
https://docs.github.com/articles/closing-issues-via-commit-messages
aa3c990https://github.com/atscott/angular/commit/aa3c99070a597b38d98e071579d0865540f80525
fix(router): fall back when serializing protocol-relative URLshttps://github.com/atscott/angular/commit/e8098dbafeedd7f556b00d51f17b7463903cfce1
https://docs.github.com/articles/closing-issues-via-commit-messages
e8098dbhttps://github.com/atscott/angular/commit/e8098dbafeedd7f556b00d51f17b7463903cfce1
fix(router): fall back when serializing protocol-relative URLshttps://github.com/atscott/angular/commit/f10507ef89d14a331a02693ecff5dc9b11973f7a
https://docs.github.com/articles/closing-issues-via-commit-messages
f10507ehttps://github.com/atscott/angular/commit/f10507ef89d14a331a02693ecff5dc9b11973f7a
kirjshttps://github.com/kirjs
on Oct 2, 2026https://github.com/angular/angular/issues/71076#event-32340859873
fix(router): fall back when serializing protocol-relative URLshttps://github.com/angular/angular/commit/a1bffc29dda1d2ead36cf21cfd6f5c7dd39e629c
https://docs.github.com/articles/closing-issues-via-commit-messages
a1bffc2https://github.com/angular/angular/commit/a1bffc29dda1d2ead36cf21cfd6f5c7dd39e629c
fix(router): fall back when serializing protocol-relative URLshttps://github.com/angular/angular/commit/576df28471a5007f7eec56cc56cc8b87c5c74be5
https://docs.github.com/articles/closing-issues-via-commit-messages
576df28https://github.com/angular/angular/commit/576df28471a5007f7eec56cc56cc8b87c5c74be5
https://github.com/apps/angular-automatic-lock-bot
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on Oct 31, 2026https://github.com/angular/angular/issues/71076#issuecomment-6536289590
automatic conversation locking policyhttps://github.com/angular/angular/blob/f0fbced1c55bc8b8ed9df01cea99df42f3e7eae3/contributing-docs/auto-issue-locking.md
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on Oct 31, 2026https://github.com/angular/angular/issues/71076#event-34743085507
Sign up for freehttps://github.com/signup?return_to=https://github.com/angular/angular/issues/71076
Sign in to commenthttps://github.com/login?return_to=https://github.com/angular/angular/issues/71076
area: serverIssues related to server-side renderinghttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20server%22
needsTriageNo due datehttps://github.com/angular/angular/milestone/83
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.