Angular: Sanitization bypass via directive host bindings on concrete host elements in @angular/core and @angular/compiler (CVE-2026-88057)
A vulnerability in Angular's @angular/core and @angular/compiler allows sanitization bypass via directive host bindings on certain concrete host elements. This occurs because the Angular compiler incorrectly determines the security context for directive host bindings based on the directive or component selector rather than the actual host element. This flaw can lead to untrusted inputs, such as javascript: URLs, being inserted into DOM attributes without sanitization, enabling Cross-Site Scripting (XSS) attacks. The issue affects multiple Angular versions prior to patched releases. Official patches are available in versions 22.1.0, 21.2.20, and 20.3.28. Users are advised to sanitize inputs explicitly or restrict URL schemes as a workaround.
AI Analysis
Technical Summary
Angular automatically sanitizes untrusted values bound to security-sensitive DOM sinks to prevent XSS. Prior to the fix, the Angular compiler determined the SecurityContext for directive host bindings based on the declaring directive or component selector at compile time, not the concrete host element. When directives with security-sensitive host bindings were applied to different concrete host elements (e.g., via hostDirectives composition, class inheritance, dynamic component instantiation, SVG/MathML elements, or tag-neutral selectors), the compiler failed to associate the correct sanitizer or security context. This allowed untrusted inputs bound via host bindings to be written to DOM attributes without sanitization, enabling arbitrary JavaScript execution in the user's browser. The vulnerability is tracked as CVE-2026-88057 and has been patched in Angular versions 22.1.0, 21.2.20, and 20.3.28.
Potential Impact
An attacker who can control values bound to affected directive host bindings can execute arbitrary JavaScript in the context of the user's browser, resulting in Cross-Site Scripting (XSS). This compromises user security by potentially stealing data, hijacking sessions, or performing actions on behalf of the user.
Mitigation Recommendations
A fix is available in Angular versions 22.1.0, 21.2.20, and 20.3.28; upgrading to these versions or later is recommended. As a workaround, explicitly sanitize any user-controlled values assigned to directive host bindings using DomSanitizer.sanitize(SecurityContext.URL, ...) before assignment, or restrict inputs to validated safe URL schemes such as http:// and https://.
Angular: Sanitization bypass via directive host bindings on concrete host elements in @angular/core and @angular/compiler (CVE-2026-88057)
Description
A vulnerability in Angular's @angular/core and @angular/compiler allows sanitization bypass via directive host bindings on certain concrete host elements. This occurs because the Angular compiler incorrectly determines the security context for directive host bindings based on the directive or component selector rather than the actual host element. This flaw can lead to untrusted inputs, such as javascript: URLs, being inserted into DOM attributes without sanitization, enabling Cross-Site Scripting (XSS) attacks. The issue affects multiple Angular versions prior to patched releases. Official patches are available in versions 22.1.0, 21.2.20, and 20.3.28. Users are advised to sanitize inputs explicitly or restrict URL schemes as a workaround.
CVSS v4.0
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
Angular automatically sanitizes untrusted values bound to security-sensitive DOM sinks to prevent XSS. Prior to the fix, the Angular compiler determined the SecurityContext for directive host bindings based on the declaring directive or component selector at compile time, not the concrete host element. When directives with security-sensitive host bindings were applied to different concrete host elements (e.g., via hostDirectives composition, class inheritance, dynamic component instantiation, SVG/MathML elements, or tag-neutral selectors), the compiler failed to associate the correct sanitizer or security context. This allowed untrusted inputs bound via host bindings to be written to DOM attributes without sanitization, enabling arbitrary JavaScript execution in the user's browser. The vulnerability is tracked as CVE-2026-88057 and has been patched in Angular versions 22.1.0, 21.2.20, and 20.3.28.
Potential Impact
An attacker who can control values bound to affected directive host bindings can execute arbitrary JavaScript in the context of the user's browser, resulting in Cross-Site Scripting (XSS). This compromises user security by potentially stealing data, hijacking sessions, or performing actions on behalf of the user.
Mitigation Recommendations
A fix is available in Angular versions 22.1.0, 21.2.20, and 20.3.28; upgrading to these versions or later is recommended. As a workaround, explicitly sanitize any user-controlled values assigned to directive host bindings using DomSanitizer.sanitize(SecurityContext.URL, ...) before assignment, or restrict inputs to validated safe URL schemes such as http:// and https://.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-hh8m-fm6v-7cvg
- Osv Schema Version
- 1.4.0
- Aliases
- ["CVE-2026-88057"]
- Ecosystems
- ["npm"]
- Database Specific Severity
- MODERATE
- Cvss Version
- 4.0
Threat ID: 6aa3295e91cc7f3848d18df6
Added to database: 09/10/2026, 22:04:14 UTC
Last enriched: 09/10/2026, 22:06:31 UTC
Last updated: 09/10/2026, 22:06:31 UTC
Views: 1
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.