Angular has XSS Vulnerability via Unsanitized SVG Script Attributes
angular
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| @angular/compiler npm |
|
|
angular
| Product | Affected | Fixed in |
|---|---|---|
| @angular/compiler npm |
|
|
19.2.18| @angular/core npm |
|
|
Angular is a development platform for building mobile and desktop web applications using TypeScript/JavaScript and other languages. Prior to versions 19.2.18, 20.3.16, 21.0.7, and 21.1.0-rc.0, a cross-site scripting (XSS) vulnerability has been identified in the Angular Template Compiler. The vulnerability exists because Angular’s internal sanitization schema fails to recognize the href and xlink:href attributes of SVG <script> elements as a Resource URL context. This issue has been patched in versions 19.2.18, 20.3.16, 21.0.7, and 21.1.0-rc.0.
From the CVE record · GitHub_M
Angular’s Template Compiler does not treat the href and xlink:href attributes of SVG <script> elements as Resource URLs, creating a cross-site scripting vulnerability. The input does not specify whether exploitation requires network or local access, authentication, or user interaction.
Teams using npm @angular/compiler or @angular/core should check versions >=21.1.0-next.0 <21.1.0-rc.0, >=21.0.0-next.0 <21.0.7, >=20.0.0-next.0 <20.3.16, >=19.0.0-next.0 <19.2.18, or <=18.2.14.