CVE-2025-66412: Angular Compiler Stored XSS Vulnerability via SVG Animation and URL Attributes

@angular/compiler Updated 02 Dec 2025

Summary

02/12/2025
Yes i
High
8.5

CVE-2025-66412: Angular Stored XSS Vulnerability via SVG Animation, SVG URL and MathML Attributes. Affects @angular/compiler across 4 version ranges.

< 18.2.14 >= 19.0.0-next.0, < 19.2.17 >= 20.0.0-next.0, < 20.3.15 >= 21.0.0-next.0, < 21.0.2

Fixed in 4 releases; the minimum fixed version depends on the release line you run. How to fix ↓

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The Angular framework is a widely-used platform for building web applications. It provides a robust set of tools for developing dynamic single-page applications. The Angular Template Compiler is responsible for compiling Angular templates into executable code. However, it has been found to have security vulnerabilities that can lead to stored cross-site scripting (XSS) attacks, particularly through SVG animation and URL attributes.

Vulnerability Detail

A Stored Cross-Site Scripting (XSS) vulnerability exists in the Angular Template Compiler due to an incomplete internal security schema. This flaw allows attackers to bypass Angular's built-in security sanitization, particularly with certain URL-holding attributes and SVG animation elements. Attackers can inject malicious scripts by binding untrusted user-controlled data to vulnerable attributes, leading to potential session hijacking, data exfiltration, and unauthorized actions within the application context.

How To Fix

Latest published version: 22.2.3 as of 23 Oct 2026

npm install @angular/compiler@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.

  • < 18.2.14 18.2.14
    npm install @angular/compiler@18.2.14
  • >= 19.0.0-next.0, < 19.2.17 19.2.17
    npm install @angular/compiler@19.2.17
  • >= 20.0.0-next.0, < 20.3.15 20.3.15
    npm install @angular/compiler@20.3.15
  • >= 21.0.0-next.0, < 21.0.2 21.0.2
    npm install @angular/compiler@21.0.2

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

If upgrading is not an option, ensure that any data bound to vulnerable attributes is never sourced from untrusted input. Avoid using template bindings like [attr.xlink:href]="maliciousURL" and do not bind untrusted data to the attributeName attribute of SVG animation elements. Additionally, implement a robust Content Security Policy (CSP) to disallow javascript: URLs.

Conclusion

The CVE-2025-66412 vulnerability in the Angular Template Compiler poses significant security risks due to its potential for stored XSS attacks. It is crucial for developers to apply the necessary patches or implement workarounds to mitigate these risks and protect their applications.

See every vulnerability recorded for @angular/compiler →

Share this vulnerability

FAQ

The vulnerability is a Stored XSS flaw that allows attackers to inject malicious scripts through SVG animation and URL attributes.

Attackers can exploit this vulnerability by binding untrusted data to vulnerable attributes, which can lead to arbitrary code execution when users interact with the affected elements.

The impacts include session hijacking, data exfiltration, and unauthorized actions performed on behalf of users.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

If you cannot upgrade, ensure that untrusted data is not bound to vulnerable attributes and implement a strong Content Security Policy.

Related vulnerabilities

Recent vulnerabilities recorded for @angular/compiler.

How To Fix

Latest published version: 22.2.3 as of 23 Oct 2026

npm install @angular/compiler@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.

  • < 18.2.14 18.2.14
    npm install @angular/compiler@18.2.14
  • >= 19.0.0-next.0, < 19.2.17 19.2.17
    npm install @angular/compiler@19.2.17
  • >= 20.0.0-next.0, < 20.3.15 20.3.15
    npm install @angular/compiler@20.3.15
  • >= 21.0.0-next.0, < 21.0.2 21.0.2
    npm install @angular/compiler@21.0.2

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback