Loading advisory.
Loading advisory.
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).
Published 2026-09-10 18:46 UTC · Modified 2026-09-11 20:32 UTC
Severity and EPSS are shown separately. Helm does not combine them into one score.
| Package | Ecosystem | Affected | Fixed in | Upgrade command |
|---|---|---|---|---|
| @angular/core | npm | >= 22.0.0, < 22.1.0 >= 21.0.0, < 21.2.20 >= 20.0.0, < 20.3.28 <= 19.2.25 | 22.1.0, 21.2.20, 20.3.28 | npm install @angular/core@22.1.0npm install @angular/core@21.2.20npm install @angular/core@20.3.28 |
| @angular/compiler | npm | >= 22.0.0, < 22.1.0 >= 21.0.0, < 21.2.20 >= 20.0.0, < 20.3.28 <= 19.2.25 | 22.1.0, 21.2.20, 20.3.28 | npm install @angular/compiler@22.1.0npm install @angular/compiler@21.2.20npm install @angular/compiler@20.3.28 |
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:
hostDirectives composition,
Class inheritance of host bindings,
Dynamic component instantiation (createComponent with custom hostElement or 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.
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).
This issue has been resolved in versions:
22.1.0
21.2.20
20.3.28
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://).
No public exploit code known to Helm's sources (Nuclei templates, Metasploit, Exploit-DB and PoC-in-GitHub). That does not mean none exists.
EPSS went from 0.004 on 2026-11-24 to 0.006 on 2026-11-26, over 2 recorded scores.
| Date | Score | Previous | Model |
|---|---|---|---|
| 2026-11-24 | 0.004 | first score | v2026.06.15 |
| 2026-11-26 | 0.006 | 0.004 | v2026.06.15 |