CVE-2026-88057: Angular Core and Compiler - Sanitization Bypass via Directive Host Bindings
Summary
CVE-2026-88057: 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). Affects @angular/core across 4 version ranges.
< 19.2.25
>= 20.0.0, < 20.3.28
>= 21.0.0, < 21.2.20
>= 22.0.0, < 22.1.0
Fixed in 4 releases; the minimum fixed version depends on the release line you run. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
Angular is a platform and framework for building single-page client applications using HTML and TypeScript. It provides a robust set of tools for developing dynamic web applications, including a powerful templating engine, dependency injection, and a rich ecosystem of libraries. However, Angular's handling of security-sensitive DOM sinks can be compromised if directives are improperly configured, leading to potential Cross-Site Scripting (XSS) vulnerabilities.
Vulnerability Detail
The vulnerability arises from Angular's method of determining the SecurityContext for directive host bindings, which is based solely on the declaring directive or component selector at compile time. This approach fails to account for the actual host element the directive is applied to, allowing an attacker to exploit this oversight. If a directive with a security-sensitive host binding is applied to an unexpected host element, untrusted inputs can be written directly to the DOM without proper sanitization, potentially enabling arbitrary JavaScript execution in the user's browser context.
How To Fix
Latest published version: 22.2.3 as of 23 Oct 2026
npm install @angular/core@22.2.3
Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.
If you can't move to the latest
The minimum fixed version depends on the release line you run.
-
< 19.2.2519.2.25npm install @angular/core@19.2.25 -
>= 20.0.0, < 20.3.2820.3.28npm install @angular/core@20.3.28 -
>= 21.0.0, < 21.2.2021.2.20npm install @angular/core@21.2.20 -
>= 22.0.0, < 22.1.022.1.0npm install @angular/core@22.1.0
Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →
Workaround
As a temporary workaround, ensure that any user-controlled values assigned to properties bound via directive host bindings are explicitly sanitized using the following code:
import { DomSanitizer, SecurityContext } from '@angular/platform-browser';
constructor(private sanitizer: DomSanitizer) {}
setSafeUrl(value: string) {
return this.sanitizer.sanitize(SecurityContext.URL, value);
}
Conclusion
CVE-2026-88057 is a significant vulnerability affecting Angular's core and compiler packages, allowing for potential XSS attacks through improper handling of directive host bindings. It is crucial to update to the patched versions or implement the suggested workarounds to mitigate the risk.
See every vulnerability recorded for @angular/core →
FAQ
CVE-2026-88057 is a vulnerability in Angular's core and compiler packages that allows for sanitization bypass via directive host bindings, potentially leading to Cross-Site Scripting (XSS).
An attacker can exploit this vulnerability by controlling the value bound to a directive host binding, allowing them to execute arbitrary JavaScript in the user's browser.
Versions of @angular/core and @angular/compiler prior to 22.1.0, 21.2.20, and 20.3.28 are affected by this vulnerability.
If you cannot update immediately, ensure that any user-controlled values assigned to directive host bindings are sanitized using the DomSanitizer service.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. You can check your application against this vulnerability using the Vulert playground at Vulert Scanner without needing to sign up.
References
Related vulnerabilities
Recent vulnerabilities recorded for @angular/core.