Angular has XSS in i18n attribute bindings
@angular compiler · @angular core
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| @angular/core npm |
|
|
@angular compiler · @angular core
| Product | Affected | Fixed in |
|---|---|---|
| @angular/core npm |
|
|
19.2.20| @angular/compiler npm |
|
|
Angular is a development platform for building mobile and desktop web applications using TypeScript/JavaScript and other languages. Prior to 22.0.0-next.3, 21.2.4, 20.3.18, and 19.2.20, a Cross-Site Scripting (XSS) vulnerability has been identified in the Angular runtime and compiler. It occurs when the application uses a security-sensitive attribute (for example href on an anchor tag) together with Angular's ability to internationalize attributes. Enabling internationalization for the sensitive attribute by adding i18n-<attribute> name bypasses Angular's built-in sanitization mechanism, which when combined with a data binding to untrusted user-generated data can allow an attacker to inject a malicious script. This vulnerability is fixed in 22.0.0-next.3, 21.2.4, 20.3.18, and 19.2.20.
From the CVE record · GitHub_M
Angular’s runtime and compiler can bypass sanitization when an application internationalizes a security-sensitive attribute and binds it to untrusted user-generated data. An attacker who controls that data can inject a malicious script; the input does not specify authentication or user-interaction requirements.
Teams using npm @angular/core or @angular/compiler should check versions from 17.0.0-next.0 through 18.2.14, or versions before the listed fixes in the 19, 20, 21, and 22.0.0-next release lines.