René's URL Explorer Experiment


Title: SVG `` `href` bindings bypass sanitization allowing XSS · Issue #71618 · angular/angular · GitHub

Open Graph Title: SVG `` `href` bindings bypass sanitization allowing XSS · Issue #71618 · angular/angular

X Title: SVG `` `href` bindings bypass sanitization allowing XSS · Issue #71618 · angular/angular

Description: Which @angular/* package(s) are the source of the bug? core / compiler Is this a regression? No Description SECURITY_SCHEMA registers one attribute for the SVG namespace, on (dom_security_schema.ts#L106): registerContext(SecurityCont...

Open Graph Description: Which @angular/* package(s) are the source of the bug? core / compiler Is this a regression? No Description SECURITY_SCHEMA registers one attribute for the SVG namespace, on (dom_security_schem...

X Description: Which @angular/* package(s) are the source of the bug? core / compiler Is this a regression? No Description SECURITY_SCHEMA registers one attribute for the SVG namespace, on <a> (dom_security...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"SVG `\u003cuse>` `href` bindings bypass sanitization allowing XSS","articleBody":"### Which @angular/* package(s) are the source of the bug?\n\ncore / compiler\n\n### Is this a regression?\n\nNo\n\n### Description\n\n\n`SECURITY_SCHEMA` registers one attribute for the SVG namespace, on `\u003ca>` ([`dom_security_schema.ts#L106`](https://github.com/angular/angular/blob/v22.2.3/packages/compiler/src/schema/dom_security_schema.ts#L106)):\n\n```ts\nregisterContext(SecurityContext.URL, SVG_NAMESPACE, [['a', ['href', 'xlink:href']]]);\n```\n\n`use` is not there, so `securityContext(':svg:use', 'href', true)` lands on `checkSecurityContext('use', 'href', 'svg')` and returns `SecurityContext.NONE`, and `'xlink:href'`\nresolves through the same lookup to the same thing. The compiler emits `ɵɵattribute` with the sanitizer slot empty, and its own checked-in golden uses this element and shows it\n([`namespace_attr.js#L7`](https://github.com/angular/angular/blob/v22.2.3/packages/compiler-cli/test/compliance/test_cases/r3_compiler_compliance/elements/namespace_attr.js#L7)):\n\n```js\n$r3$.ɵɵattribute('href', ctx.value, null, 'xlink');\n//                                  ^^^^ the sanitizer argument\n```\n\n`\u003cuse href>` fetches a document and clones it into the page, and handlers and hyperlinks in that clone are live, so the attribute does what `iframe[src]`, `object[data]` and `embed[src]` do. Those three are `RESOURCE_URL`. That one missing schema entry is the whole defect, and since every spelling of the binding fails through the same lookup, one entry fixes all of them.\n\nA dangerous form is the one where the bound value reaches the document part of the URL, and `[attr.href]` / `[attr.xlink:href]` is the only way to bind this attribute, so there is no other syntax an application can move to.\n\n**Route A, a `data:` URL in any field the app binds.** An\nattacker's: one stored text field that the app later binds is the entire vector.\n\n```html\n\u003c!-- iconUrl = 'data:image/svg+xml;base64,' + btoa(profile.icon) + '#x' -->\n\u003csvg>\u003cuse [attr.href]=\"iconUrl\">\u003c/use>\u003c/svg>\n```\n\nIt executed on Chrome 116 and on Firefox 104 to 121, and on Chrome 113, 114 and 115, with\n15, 20 and 16 hits out of 24 launches against 24 of 24 on 116. I bound it as a literal string and as one\nbuilt with `btoa()` at runtime, with the same result. On WebKit no `data:` URL reached the document in 30\nspellings and the `\u003cuse>` box stayed 0x0, so there the refusal is at the load and not at the handler.\n\n**Route B, bytes at a URL on the app's own origin.** Two ways to put them there, an upload the app serves\nback or any endpoint whose response parses as XML and carries the attacker's `\u003csvg>` somewhere inside it:\n\n```html\n\u003csvg>\u003cuse [attr.href]=\"iconUrl\">\u003c/use>\u003c/svg>\n\u003c!-- iconUrl  = '/uploads/avatar.png#x' -->\n\u003csvg>\u003cuse [attr.xlink:href]=\"iconUrl\">\u003c/use>\u003c/svg>\n\u003c!-- the more common spelling in real code -->\n\u003csvg>\u003cuse [attr.href]=\"apiUrl\">\u003c/use>\u003c/svg>\n\u003c!-- apiUrl   = '/api/profile.xml#x', no upload -->\n\u003csvg>\u003cuse [attr.href]=\"assetUrl\">\u003c/use>\u003c/svg>\n\u003c!-- assetUrl = '/asset.svg', WebKit from 26.5 -->\n```\n\n`\u003cuse>` resolves the fragment to an element id, so the response does not have to be an SVG file. 9 of the 12 envelopes I served through the app's own `/api/profile.xml` ran on Chrome 121, and the same 9 onWebKit: a feed, a SOAP body, a sitemap, an XML API response, an XHTML page, a record list, an `\u003c?xml?>`prologue, bytes after the root element, and the `\u003csvg>` four levels deep in an unrelated namespace. Firefox 156 stops at the trailing bytes, so it ran 8; a JSON envelope, bytes before the root and no\n`xmlns` never ran.\n\nRoute B needs from that response is the follow Same-origin, with or without CORS, and a 2xx status, on every engine.\n\nChrome and Firefox also require an XML or SVG media type and a fragment in the URL. WebKit never checks the media type: the same bytes run as `image/png`, `text/plain`,\n`application/octet-stream` and `text/html`, which are the four a team picks on purpose to be safe. And from 26.5 it needs no fragment either, which is the fragmentless shape above. `Content-Disposition: attachment`, `X-Content-Type-Options: nosniff`, a `.png` path and a CSP on the response itself change nothing anywhere, and that is the usual \"serve user uploads safely\" configuration, the default in Rails ActiveStorage proxy mode and Django `FileResponse(as_attachment=True)`. On WebKit nothing on the response blocks it, and the only control left is serving uploads from another origin.\n\nBy browser build:\n\n| Browser          | Route A | Route B                |\n| ---------------- | ------- | ---------------------- |\n| Chrome 113–115   | yes     | no                     |\n| Chrome 116       | yes     | yes                    |\n| Chrome 117–121   | no      | yes                    |\n| Chrome 122–158   | no      | no, the sprite renders |\n| Firefox 104–121  | yes     | yes                    |\n| Firefox 122–159  | no      | yes                    |\n| WebKit 16.0–27.2 | no      | yes                    |\n\nFirefox still runs Route B, and Mozilla closed [bug 1912763](https://bugzilla.mozilla.org/show_bug.cgi?id=1912763) as INVALID because these handlers only run when everything is same-origin, which an app serving user SVG from its own origin is.\n\nTwo things in the clone are a different mechanism rather than another route. The cloned `\u003ca>` is not a handler at all but a live hyperlink, so `\u003ca href=\"javascript:\">` runs on a trusted click on Chrome **115 and 122**, where every handler sink is inert, which puts its window at 115 to 122 rather than 116 to 121. And `\u003cforeignObject>\u003cdetails open=\"open\" ontoggle>` fires with **no interaction and no resource load**, which is what defeats stripping `on*` from uploads or refusing `\u003cimage>`.\n\n\n### Please provide a link to a minimal reproduction of the bug\n\nSee https://github.com/SkyZeroZx/ng-bypass-svg-xss\n\nYou can run \n\n```bash\nnpm install\nnpm run fixtures\nnpm run matrix -- --angular 22 --chrome 121 --firefox 121 --suite floor\nnpm run matrix -- --angular 22 --chrome 121 --suite xml\n```\n\n### Please provide the environment you discovered this bug in (run `ng version`)\n\n```true\nAngular: 20.3.34, 21.2.25, 22.2.3\nNode: 24.16.0\nOS: Windows 11 x64\n\nChrome for Testing 113–123, 125, 130, 135, 140, 145, 150, 155–158; Chromium 107–116, 121, 122\nFirefox 104, 112, 115, 117–123, 133, 138, 143, 148, 153, 156, 159; ESR 115, 140, 153\nWebKit 16.0 to 27.2, 19 Playwright builds over 11 versions (not Safari itself)\n```\n\n### Anything else?\n\nAll tests were performed on Windows, so I can't give a completely reliable guarantee for Safari. I believe the WebKit validation should be relatively reliable, and I would appreciate it if someone could validate it manually. (I have validated this completely manually in both Chrome and Firefox.)","author":{"url":"https://github.com/SkyZeroZx","@type":"Person","name":"SkyZeroZx"},"datePublished":"2026-10-26T04:58:13Z","url":"https://github.com/angular/angular/issues/71618"}

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:883540d4-d879-e94b-80bd-3666ee853b8d
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB78C:2D2F2F:181ED41:1EE54D4:6B012F70
html-safe-nonce0cb48cc49bd4bdd6c990aada08e18fa674a7abe0ae87f9ccc33dcaa697b18779
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNzhDOjJEMkYyRjoxODFFRDQxOjFFRTU0RDQ6NkIwMTJGNzAiLCJ2aXNpdG9yX2lkIjoiNjgyOTMxOTU4ODExMTUyNzc5MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac786752aff5a783411f93b04c84b2ff5250dc84daf14f3752458a0fba47f618a2
hovercard-subject-tagissue:6033631349
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/71618/issue_layout
twitter:imagehttps://opengraph.githubassets.com/5171480ba256d3d59b6f015e24e289a784a4a7cb474c32eb847125515958d437/angular/angular/issues/71618
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/5171480ba256d3d59b6f015e24e289a784a4a7cb474c32eb847125515958d437/angular/angular/issues/71618
og:image:altWhich @angular/* package(s) are the source of the bug? core / compiler Is this a regression? No Description SECURITY_SCHEMA registers one attribute for the SVG namespace, on (dom_security_schem...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameSkyZeroZx
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
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
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/angular/angular/issues/71618#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F71618
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%2F71618
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/71618
Reloadhttps://github.com/angular/angular/issues/71618
Reloadhttps://github.com/angular/angular/issues/71618
angularhttps://github.com/angular
angularhttps://github.com/angular/angular
Codehttps://github.com/angular/angular
Issues836 (836)https://github.com/angular/angular/issues
Pull requests141 (141)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/71618
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/71618
#71619https://github.com/angular/angular/pull/71619
SVG href bindings bypass sanitization allowing XSShttps://github.com/angular/angular/issues/71618#top
#71619https://github.com/angular/angular/pull/71619
area: securityIssues related to built-in security features, such as HTML sanitationhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20security%22
needsTriagehttps://github.com/angular/angular/milestone/83
https://github.com/SkyZeroZx
SkyZeroZxhttps://github.com/SkyZeroZx
on Oct 26, 2026https://github.com/angular/angular/issues/71618#issue-6033631349
dom_security_schema.ts#L106https://github.com/angular/angular/blob/v22.2.3/packages/compiler/src/schema/dom_security_schema.ts#L106
namespace_attr.js#L7https://github.com/angular/angular/blob/v22.2.3/packages/compiler-cli/test/compliance/test_cases/r3_compiler_compliance/elements/namespace_attr.js#L7
bug 1912763https://bugzilla.mozilla.org/show_bug.cgi?id=1912763
https://github.com/SkyZeroZx/ng-bypass-svg-xsshttps://github.com/SkyZeroZx/ng-bypass-svg-xss
angular-robothttps://github.com/apps/angular-robot
area: securityIssues related to built-in security features, such as HTML sanitationhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20security%22
on Oct 26, 2026https://github.com/angular/angular/issues/71618#event-34225629940
angular-robothttps://github.com/apps/angular-robot
needsTriagehttps://github.com/angular/angular/milestone/83
on Oct 26, 2026https://github.com/angular/angular/issues/71618#event-34225631327
ngbothttps://github.com/apps/ngbot
needsTriagehttps://github.com/angular/angular/milestone/83
on Oct 26, 2026https://github.com/angular/angular/issues/71618#event-34225631453
SkyZeroZxhttps://github.com/SkyZeroZx
on Oct 26, 2026https://github.com/angular/angular/issues/71618#event-34225743295
fix(compiler): sanitize href and xlink:href bindings on SVG use elementshttps://github.com/SkyZeroZx/angular/commit/e0a1ca6b37474cad86417ad24541f1c606646ff9
https://docs.github.com/articles/closing-issues-via-commit-messages
e0a1ca6https://github.com/SkyZeroZx/angular/commit/e0a1ca6b37474cad86417ad24541f1c606646ff9
SkyZeroZxhttps://github.com/SkyZeroZx
on Oct 26, 2026https://github.com/angular/angular/issues/71618#event-34225766258
SkyZeroZxhttps://github.com/SkyZeroZx
on Oct 27, 2026https://github.com/angular/angular/issues/71618#event-34386496793
fix(compiler): sanitize href and xlink:href bindings on SVG use elementshttps://github.com/SkyZeroZx/angular/commit/93b351c7ed1fc528726a0277c4a2afcf52e2bace
https://docs.github.com/articles/closing-issues-via-commit-messages
93b351chttps://github.com/SkyZeroZx/angular/commit/93b351c7ed1fc528726a0277c4a2afcf52e2bace
fix(compiler): sanitize href and xlink:href bindings on SVG use elementshttps://github.com/SkyZeroZx/angular/commit/160e1ce5d5853314600845e3f418e28ef30d5b55
https://docs.github.com/articles/closing-issues-via-commit-messages
160e1cehttps://github.com/SkyZeroZx/angular/commit/160e1ce5d5853314600845e3f418e28ef30d5b55
SkyZeroZxhttps://github.com/SkyZeroZx
on Nov 11, 2026https://github.com/angular/angular/issues/71618#event-35751072116
fix(compiler): sanitize href and xlink:href bindings on SVG use elementshttps://github.com/SkyZeroZx/angular/commit/0382c251c127175eaebc439780b117e399664575
https://docs.github.com/articles/closing-issues-via-commit-messages
0382c25https://github.com/SkyZeroZx/angular/commit/0382c251c127175eaebc439780b117e399664575
Sign up for freehttps://github.com/signup?return_to=https://github.com/angular/angular/issues/71618
Sign in to commenthttps://github.com/login?return_to=https://github.com/angular/angular/issues/71618
area: securityIssues related to built-in security features, such as HTML sanitationhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20security%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.