Summary
Angular i18n: Cross-Site Scripting (XSS) via event-handler attributes
A Cross-Site Scripting (XSS) vulnerability has been identified in the Angular compiler's internationalization (i18n) pipeline. Although Angular disallows binding to event-handler attributes such as onclick and onerror through standard attribute validation (validateAttribute() / validateProperty()), the i18n metadata collection path allowed these same attribute names to be marked for translation using i18n-on* attributes (e.g., i18n-onerror).
When exploited, a lower-trust translation file could replace a benign static handler such as onerror="void 0" with arbitrary executable JavaScript in the localized build.
The following example illustrates a vulnerable pattern:
<img src="foo.jpg" onerror="void 0" i18n-onerror />
Patched Versions
- 22.0.1
- 21.2.19
- 20.3.27
Workarounds
Ensure that static event-handler attributes (e.g., onerror, onclick) are never marked for internationalization (i18n-on*) in application templates, and ensure translation files are sourced from trusted origins.
Impact
When exploited, this vulnerability allows arbitrary JavaScript execution within the context of the vulnerable application's domain if an attacker can control or influence the translation files used during localization. This can lead to:
- Session Hijacking: Accessing session cookies, tokens, or sensitive user data.
- Unauthorized Actions: Performing actions on behalf of the authenticated user.
Untrusted input is rendered as active markup in a victim's browser, which can run script in their session. Typical impact: session or credential theft, and actions taken as the user.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
@angular/compiler to 22.0.1 or later; @angular/compiler to 21.2.19 or later; @angular/compiler to 20.3.27 or later; @angular/core to 22.0.1 or later; @angular/core to 21.2.19 or later; @angular/core to 20.3.27 or later
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
Frequently Asked Questions
- What is CVE-2026-69151? CVE-2026-69151 is a high-severity cross-site scripting (XSS) vulnerability in @angular/compiler (npm), affecting versions >= 22.0.0-next.0, < 22.0.1. It is fixed in 22.0.1, 21.2.19, 20.3.27. Untrusted input is rendered as active markup in a victim's browser, which can run script in their session.
- Which packages are affected by CVE-2026-69151?
@angular/compiler(npm) (versions >= 22.0.0-next.0, < 22.0.1)@angular/core(npm) (versions >= 22.0.0-next.0, < 22.0.1)
- Is there a fix for CVE-2026-69151? Yes. CVE-2026-69151 is fixed in 22.0.1, 21.2.19, 20.3.27. Upgrade to this version or later.
- Is CVE-2026-69151 exploitable, and should I be worried? Whether CVE-2026-69151 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2026-69151 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2026-69151?
- Upgrade
@angular/compilerto 22.0.1 or later - Upgrade
@angular/compilerto 21.2.19 or later - Upgrade
@angular/compilerto 20.3.27 or later - Upgrade
@angular/coreto 22.0.1 or later - Upgrade
@angular/coreto 21.2.19 or later - Upgrade
@angular/coreto 20.3.27 or later
- Upgrade