CVE-2026-88057
Angular: Sanitization bypass via directive host bindings on concrete host elements in @angular/core and @angular/compiler
Description
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://).
Affected Maven artifacts (4)
| Artifact | Affected versions | Fixed in |
|---|---|---|
| org.mvnpm.at.angular » compilervia npm @angular/compiler | <= 19.2.25>= 20.0.0, < 20.3.28>= 21.0.0, < 21.2.20>= 22.0.0, < 22.1.0 | 20.3.28, 21.2.20, 22.1.0 |
| org.mvnpm.at.angular » corevia npm @angular/core | <= 19.2.25>= 20.0.0, < 20.3.28>= 21.0.0, < 21.2.20>= 22.0.0, < 22.1.0 | 20.3.28, 21.2.20, 22.1.0 |
| org.webjars.npm » angular__compilervia npm @angular/compiler | <= 19.2.25>= 20.0.0, < 20.3.28>= 21.0.0, < 21.2.20>= 22.0.0, < 22.1.0 | 20.3.28, 21.2.20, 22.1.0 |
| org.webjars.npm » angular__corevia npm @angular/core | <= 19.2.25>= 20.0.0, < 20.3.28>= 21.0.0, < 21.2.20>= 22.0.0, < 22.1.0 | 20.3.28, 21.2.20, 22.1.0 |
Blast radius
46% of the dependent artifacts (13) still pull an affected version in their latest release.
| Depth | Dependent versions |
|---|---|
| Direct | 912 |
| 2 hops | 284 |
| 3 hops | 18 |
Most used dependents
- org.mvnpm.at.angular » core19 usages
- org.mvnpm.at.angular » platform-browser10 usages
- org.mvnpm.at.angular » common10 usages
- org.mvnpm.at.angular » compiler7 usages
- org.mvnpm.at.angular » forms5 usages
- org.mvnpm.at.angular » router4 usages
- org.mvnpm.at.angular » platform-browser-dynamic3 usages
- org.mvnpm.at.angular » animations2 usages
- org.mvnpm.at.angular » compiler-cli2 usages
- org.fujion » fujion-angular-core2 usages
- org.mvnpm.at.angular » elements1 usages
- org.fujion » fujion-angular-example1 usages
- org.fujion » fujion-testharness0 usages
- org.webjars.npm » ng2-datetime0 usages
- org.webjars.npm » ng2-datetime-picker0 usages
Computed from the dependency graph of build 20261124.0621 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.
Other ecosystems
Also affects npm (2 packages) . See all on OSV
References
| Package | angular/angular | github.com |
| Web | angular/angular advisory GHSA-hh8m-fm6v-7cvg | github.com |
| Web | angular/angular issue #69550 | github.com |
| Web | angular/angular pull request #69558 | github.com |
| Web | angular/angular commit 2f96c80 | github.com |
| Web | angular/angular commit 6afe6fa | github.com |
| Web | angular/angular commit 6caa298 | github.com |
| Web | angular/angular release v20.3.28 | github.com |
| Web | angular/angular release v21.2.20 | github.com |
| Web | angular/angular release v22.1.0 | github.com |
