{"id":"CVE-2026-88057","aliases":["CVE-2026-88057","GHSA-hh8m-fm6v-7cvg"],"related":[],"kind":"vulnerability","state":"published","title":"Angular: Sanitization bypass via directive host bindings on concrete host elements in @angular/core and @angular/compiler","summary":"Angular is a development platform for building mobile and desktop web applications using TypeScript/JavaScript and other languages. Prior to 20.3.28, 21.2.20, and 22.1.0, Angular's compiler and runtime in @angular/core and @angular/compiler could omit or select an incorrect sanitizer for security-sensitive directive host bindings because SecurityContext was derived from the declaring directive or component selector rather than the concrete host element. The mismatch is reachable through hostDirectives composition, inherited HostBinding declarations, createComponent with a custom hostElement or dynamic directives, SVG/MathML namespace elements, and tag-neutral selectors such as :not(...). Attacker-controlled href, src, action, xlink:href, or data values can therefore reach DOM attributes without Angular's built-in sanitizer and execute arbitrary JavaScript in the user's browser context. Applications unable to upgrade can use DomSanitizer.sanitize with SecurityContext.URL before assignment or restrict inputs to validated HTTP and HTTPS URL schemes. This issue is fixed in versions 20.3.28, 21.2.20, and 22.1.0.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Angular is a development platform for building mobile and desktop web applications using TypeScript/JavaScript and other languages. Prior to 20.3.28, 21.2.20, and 22.1.0, Angular's compiler and runtime in @angular/core and @angular/compiler could omit or select an incorrect sanitizer for security-sensitive directive host bindings because SecurityContext was derived from the declaring directive or component selector rather than the concrete host element. The mismatch is reachable through hostDirectives composition, inherited HostBinding declarations, createComponent with a custom hostElement or dynamic directives, SVG/MathML namespace elements, and tag-neutral selectors such as :not(...). Attacker-controlled href, src, action, xlink:href, or data values can therefore reach DOM attributes without Angular's built-in sanitizer and execute arbitrary JavaScript in the user's browser context. Applications unable to upgrade can use DomSanitizer.sanitize with SecurityContext.URL before assignment or restrict inputs to validated HTTP and HTTPS URL schemes. This issue is fixed in versions 20.3.28, 21.2.20, and 22.1.0.","source":"cvelist"},{"lang":"en","text":"Angular automatically sanitizes untrusted values bound to security-sensitive DOM sinks (such as `href`, `src`, `action`, `xlink:href`, and `data`) to protect against Cross-Site Scripting (XSS).\n\nPrior to the fix, the Angular compiler determined the `SecurityContext` for directive host bindings (`host: {'[attr.href]': 'value'}` or `@HostBinding('attr.href')`) based solely on the declaring directive or component selector at compile time, rather than the concrete host element that the directive was applied to.\n\nWhen a directive with a security-sensitive host binding was applied to a different concrete host element—such as through:\n- `hostDirectives` composition,\n- Class inheritance of host bindings,\n- Dynamic component instantiation (`createComponent` with custom `hostElement` or dynamic directives),\n- Elements with SVG/MathML namespaces (e.g. `<svg:a>`, `<math>`), or\n- Elements using tag-neutral selectors (e.g. `:not(...)`),\n\nthe compiler either failed to associate a sanitizer with the host binding or attached an incorrect security context. As a result, untrusted inputs (e.g. `javascript:...` URLs) bound via the host binding would be written to the DOM attribute without passing through Angular's built-in sanitizer.\n\n### Impact\nAn attacker capable of controlling the value bound to an affected directive host binding could execute arbitrary JavaScript in the user's browser context (Cross-Site Scripting).\n\n### Patches\nThis issue has been resolved in versions:\n- `22.1.0` \n- `21.2.20`\n- `20.3.28`\n\n### Workarounds\nEnsure that any user-controlled values assigned to properties bound via directive host bindings are explicitly sanitized using `DomSanitizer.sanitize(SecurityContext.URL, ...)` before assignment, or restrict the input to validated safe URL schemes (e.g. `http://`, `https://`).","format":"markdown","source":"ghsa"}],"published":"2026-09-10T18:46:51.847Z","modified":"2026-09-29T19:02:03.160Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N","score":5.3,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N","score":5.3,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N","rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"}],"cwes":["CWE-79"],"affected":[{"ranges":[{"version":"<= 19.2.25","status":"affected"},{"version":">= 20.0.0, < 20.3.28","status":"affected"},{"version":">= 21.0.0, < 21.2.20","status":"affected"},{"version":">= 22.0.0, < 22.1.0","status":"affected"}],"vendor":"angular","product":"angular","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"22.0.0","status":"affected","fixed":"22.1.0"}],"ecosystem":"npm","package":"@angular/core","purl":"pkg:npm/%40angular/core","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"22.0.0","status":"affected","fixed":"22.1.0"}],"ecosystem":"npm","package":"@angular/compiler","purl":"pkg:npm/%40angular/compiler","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"21.0.0","status":"affected","fixed":"21.2.20"}],"ecosystem":"npm","package":"@angular/core","purl":"pkg:npm/%40angular/core","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"21.0.0","status":"affected","fixed":"21.2.20"}],"ecosystem":"npm","package":"@angular/compiler","purl":"pkg:npm/%40angular/compiler","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"20.0.0","status":"affected","fixed":"20.3.28"}],"ecosystem":"npm","package":"@angular/core","purl":"pkg:npm/%40angular/core","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"20.0.0","status":"affected","fixed":"20.3.28"}],"ecosystem":"npm","package":"@angular/compiler","purl":"pkg:npm/%40angular/compiler","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","lastAffected":"19.2.25"}],"ecosystem":"npm","package":"@angular/core","purl":"pkg:npm/%40angular/core","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","lastAffected":"19.2.25"}],"ecosystem":"npm","package":"@angular/compiler","purl":"pkg:npm/%40angular/compiler","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"19.0.0","lastAffected":"19.2.25"},{"status":"affected","introduced":"20.0.0","fixed":"20.3.28"},{"status":"affected","introduced":"21.0.0","fixed":"21.2.20"},{"status":"affected","introduced":"22.0.0","fixed":"22.1.0"}],"vendor":"angular","product":"angular","cpe":"cpe:2.3:a:angular:angular:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://github.com/angular/angular/security/advisories/GHSA-hh8m-fm6v-7cvg","tags":["exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/angular/angular/issues/69550","tags":["issue-tracking","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/angular/angular/pull/69558","tags":["issue-tracking","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/angular/angular/commit/2f96c8020f85ccb715a76de4b79a0c680c2c7264","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/angular/angular/commit/6afe6fa781c2f0931f0aedd729b9884a8fe212ee","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/angular/angular/commit/6caa298dee58319b2d674dc91364e26ffe3ecb2b","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/angular/angular/releases/tag/v20.3.28","tags":["release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/angular/angular/releases/tag/v21.2.20","tags":["release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/angular/angular/releases/tag/v22.1.0","tags":["release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/angular/angular","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"partial","date":"2026-09-11T16:34:33.902Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-88057","url":"https://www.cve.org/CVERecord?id=CVE-2026-88057","licence":"CVE Terms of Use","modified":"2026-09-11T20:32:49.884Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-hh8m-fm6v-7cvg","url":"https://github.com/advisories/GHSA-hh8m-fm6v-7cvg","licence":"CC-BY-4.0","modified":"2026-09-10T20:30:04.438Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-88057","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-88057","licence":"Public domain","modified":"2026-09-29T19:02:03.160Z"}],"updatedAt":"2026-11-25T22:59:37.893Z","epss":{"score":0.00362,"percentile":0.32055,"date":"2026-12-01T12:00:22.000Z"}}