CVE-2026-88057: Angular: Sanitization bypass via directive host bindings on concrete host elements in @angular/core and @angular/compiler
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). Prior 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…
Published Sep 10, 2026
Affected packages
@angular/core
- Ecosystem
- npm
- Affected
- >= 22.0.0, < 22.1.0
- Fixed in
- 22.1.0
- Check
npm ls @angular/core
@angular/compiler
- Ecosystem
- npm
- Affected
- >= 22.0.0, < 22.1.0
- Fixed in
- 22.1.0
- Check
npm ls @angular/compiler
@angular/core
- Ecosystem
- npm
- Affected
- >= 21.0.0, < 21.2.20
- Fixed in
- 21.2.20
- Check
npm ls @angular/core
@angular/compiler
- Ecosystem
- npm
- Affected
- >= 21.0.0, < 21.2.20
- Fixed in
- 21.2.20
- Check
npm ls @angular/compiler
@angular/core
- Ecosystem
- npm
- Affected
- >= 20.0.0, < 20.3.28
- Fixed in
- 20.3.28
- Check
npm ls @angular/core
@angular/compiler
- Ecosystem
- npm
- Affected
- >= 20.0.0, < 20.3.28
- Fixed in
- 20.3.28
- Check
npm ls @angular/compiler
@angular/core
- Ecosystem
- npm
- Affected
- <= 19.2.25
- Fixed in
- No patched version yet
- Check
npm ls @angular/core
@angular/compiler
- Ecosystem
- npm
- Affected
- <= 19.2.25
- Fixed in
- No patched version yet
- Check
npm ls @angular/compiler
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
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).
Prior 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.
When a directive with a security-sensitive host binding was applied to a different concrete host element—such as through:
hostDirectivescomposition,- Class inheritance of host bindings,
- Dynamic component instantiation (
createComponentwith customhostElementor dynamic directives), - Elements with SVG/MathML namespaces (e.g.
<svg:a>,<math>), or - Elements using tag-neutral selectors (e.g.
:not(...)),
the 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.
Impact
An 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).
Patches
This issue has been resolved in versions:
22.1.021.2.2020.3.28
Workarounds
Ensure 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://).
Credited to SkyZeroZx, josephperrott, alan-agius4, JeanMeche.
References
- https://github.com/angular/angular/security/advisories/GHSA-hh8m-fm6v-7cvg
- https://github.com/angular/angular/issues/69550
- https://github.com/angular/angular/pull/69558
- https://github.com/angular/angular/commit/2f96c8020f85ccb715a76de4b79a0c680c2c7264
- https://github.com/angular/angular/commit/6afe6fa781c2f0931f0aedd729b9884a8fe212ee
- https://github.com/angular/angular/commit/6caa298dee58319b2d674dc91364e26ffe3ecb2b
- https://github.com/angular/angular/releases/tag/v20.3.28
- https://github.com/angular/angular/releases/tag/v21.2.20
- https://github.com/angular/angular/releases/tag/v22.1.0
- https://github.com/advisories/GHSA-hh8m-fm6v-7cvg
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More npm vulnerabilities
All npm entriesCVE-2026-69151
Angular i18n: Cross-Site Scripting (XSS) via event-handler attributes
high7.6No fixAug 3, 2026CVE-2026-50557
Angular: Template and Attribute Namespace Sanitization Bypass (XSS)
medium6.1No fixJun 15, 2026CVE-2026-52725
@angular/core: Angular Template and Dynamic Component Namespace Bypass leading to Cross-Site Scripting (XSS)
medium6.1No fixJun 15, 2026CVE-2026-54265
@angular/compiler: Two-Way Property Binding Sanitization Bypass (XSS)
medium6.1No fixJun 15, 2026CVE-2026-54267
Angular Client Hydration DOM Clobbering & Response-Cache Poisoning
high6.1No fixJun 15, 2026CVE-2026-32635
Angular vulnerable to XSS in i18n attribute bindings
high9.0No fixMar 13, 2026
