Hoch

Angular has XSS Vulnerability via Unsanitized SVG Script Attributes

  • Veröffentlicht: 09.01.2026
  • Aktualisiert: 11.10.2026 10:22

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.

In a standard security model, attributes that can load and execute code (like a script's source) should be strictly validated. However, because the compiler does not classify these specific SVG attributes correctly, it allows attackers to bypass Angular's built-in security protections.

When template binding is used to assign user-controlled data to these attributes for example, <script [attr.href]="userInput"> the compiler treats the value as a standard string or a non-sensitive URL rather than a resource link. This enables an attacker to provide a malicious payload, such as a data:text/javascript URI or a link to an external malicious script.

Impact

When successfully exploited, this vulnerability allows for arbitrary JavaScript execution within the context of the victim's browser session. This can lead to:

  • Session Hijacking: Stealing session cookies, localStorage data, or authentication tokens.
  • Data Exfiltration: Accessing and transmitting sensitive information displayed within the application.
  • Unauthorized Actions: Performing state-changing actions (like clicking buttons or submitting forms) on behalf of the authenticated user.

Attack Preconditions

  1. The victim application must explicitly use SVG <script> elements within its templates.
  2. The application must use property or attribute binding (interpolation) for the href or xlink:href attributes of those SVG scripts.
  3. The data bound to these attributes must be derived from an untrusted source (e.g., URL parameters, user-submitted database entries, or unsanitized API responses).

Patches

  • 19.2.18
  • 20.3.16
  • 21.0.7
  • 21.1.0-rc.0

Workarounds

Until the patch is applied, developers should:

  • Avoid Dynamic Bindings: Do not use Angular template binding (e.g., [attr.href]) for SVG <script> elements.
  • Input Validation: If dynamic values must be used, strictly validate the input against a strict allowlist of trusted URLs on the server side or before it reaches the template.

Resources

Betroffene Software

Klicken Sie auf eine Technologie, um alle zugehörigen Schwachstellen anzuzeigen.

PlattformPaketAnfällige VersionenBehoben in
npm-Paket @angular/compiler >= 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, <= 18.2.14 21.1.0-rc.0, 21.0.7, 20.3.16, 19.2.18
npm-Paket @angular/core >= 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, <= 18.2.14 21.1.0-rc.0, 21.0.7, 20.3.16, 19.2.18

Verweise

CVSS-Wert -
CVSS-Vektor
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
Schwäche (CWE)
CWE-79
Plattform
npm
Paket
@angular/compiler, @angular/core
Veröffentlicht
09.01.2026
Aktualisiert
11.10.2026 10:22

Quellen und Lizenzen

OSV / GitHub Advisory Database - GHSA-jrmj-c5cx-3cw6 - CC BY 4.0

Schwachstellenhistorie: @angular/compiler

Alle veröffentlichten Schwachstellen dieses Pakets (npm-Paket), neueste zuerst. Zeigt, ob es ein einmaliger Ausrutscher ist oder ein Paket, das man im Auge behalten muss.

Einträge insgesamt
7
Erste → letzte
12.2025 09.2026
Ohne Fix
0
In Angriffen ausgenutzt
0

Verteilung nach Schweregrad

  • Hoch 4
  • Mittel 3

Veröffentlichungen pro Jahr

  1. 2025: 1
  2. 2026: 6
  1. Mittel CVE-2026-88057 >= 22.0.0, < 22.1.0, >= 21.0.0, < 21.2.20, >= 20.0.0, < 20.3.28, <= 19.2.25 22.1.0, 21.2.20, 20.3.28
  2. Hoch CVE-2026-69151 >= 22.0.0-next.0, < 22.0.1, >= 21.0.0-next.0, < 21.2.19, >= 20.0.0-next.0, < 20.3.27, <= 19.2.25 22.0.1, 21.2.19, 20.3.27
  3. Mittel · 6.1 CVE-2026-54265 >= 22.0.0-next.0, < 22.0.1, >= 21.0.0-next.0, < 21.2.17, >= 20.0.0-next.0, < 20.3.25, <= 19.2.25 22.0.1, 21.2.17, 20.3.25
  4. Mittel · 6.1 CVE-2026-50557 >= 21.0.0-next.0, < 21.2.15, >= 22.0.0-next.0, < 22.0.0-rc.2, >= 20.0.0-next.0, < 20.3.22, >= 19.0.0-next.0, < 19.2.22, <= 18.2.14 21.2.15, 22.0.0-rc.2, 20.3.22, 19.2.22
  5. Hoch · 9.0 CVE-2026-32635 >= 22.0.0-next.0, < 22.0.0-next.3, >= 21.0.0-next.0, < 21.2.4, >= 20.0.0-next.0.0.0, < 20.3.18, >= 19.0.0-next.0, < 19.2.20, >= 17.0.0-next.0, <= 18.2.14 22.0.0-next.3, 21.2.4, 20.3.18, 19.2.20
  6. Angular has XSS Vulnerability via Unsanitized SVG Script Attributes dieser Eintrag
    Hoch CVE-2026-22610 >= 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, <= 18.2.14 21.1.0-rc.0, 21.0.7, 20.3.16, 19.2.18
  7. Hoch CVE-2025-66412 >= 21.0.0-next.0, < 21.0.2, >= 20.0.0-next.0, < 20.3.15, >= 19.0.0-next.0, < 19.2.17, <= 18.2.14 21.0.2, 20.3.15, 19.2.17

Erkennen Sie Schwachstellen in Ihrer Anwendung

Mit der DockRay-Integration und aktivierter Softwareinventarisierung prüft DockRay gemeldete Komponentenversionen auf bekannte Schwachstellen und benachrichtigt Sie über bestätigte Treffer. Die Abdeckung hängt von der unterstützten Technologie und den verfügbaren Meldungen ab.

Anwendung verbinden
DockRay Newsletter

Anwendungssicherheit in Ihrem Postfach

Wichtige Schwachstellen, konkrete Empfehlungen und praktische Tipps für Ihre Anwendungen. Wählen Sie Ihre Technologien und verfolgen Sie, was für Ihr Projekt relevant ist.

  • Eine tägliche Zusammenfassung neuer Schwachstellen, auch kritischer.
  • Benachrichtigungen über wichtige Updates.
  • Praktische Tipps zur Sicherheit und Überwachung von Anwendungen.

Leer lassen, um Meldungen zu allen Technologien zu erhalten.

Kostenlos anmelden. In jeder E-Mail mit einem Klick abmelden.