Skip to content

← Public intelligence

npm package

@angular/compiler

Open actionable advisories and recorded vendor fixes. This public package view has no inventory attached and cannot establish whether your deployment is affected. A vendor fix never resolves your finding; verify your installed version and the source guidance.

Open advisories

7 actionable advisories, newest first. Withdrawn advisories and news are excluded. Coverage is partial.

  1. Medium, CVSS 5.3npmAmendedPublished

    Angular: Sanitization bypass via directive host bindings on concrete host elements in @angular/core and @angular/compiler

    CVE-2026-88057 · GHSA-hh8m-fm6v-7cvg

    Affected
    • npm @angular/compiler >= 22.0.0, < 22.1.0; >= 21.0.0, < 21.2.20; >= 20.0.0, < 20.3.28; <= 19.2.25
    Fixed in
    22.1.020.3.2821.2.20· Partial vendor fix
    Issue
    Angular automatically sanitizes untrusted values bound to security-sensitive DOM sinks (such as href, src, action, xlink:href, and data) to protect against Cross-Site Scripting (XSS). Prior to the fix, the Angular compiler determined the SecurityContext for directive host bindings (host: {'[attr.href]': 'value'} or @HostBinding('attr.href')) based solely on the declaring directive or component selector at compile time, rather than the concrete host element that the directive was applied to. When a directive with a security-sensitive host binding was applied to a different concrete host element—such as through: - hostDirectives composition, - Class inheritance of host bindings, - Dynamic component instantiation (createComponent with custom hostElement or dynamic directives), - Elements with SVG/MathML namespaces (e.g. <svg:a, <math), or - Elements using tag-neutral selectors (e.g. :not(...)), the compiler either failed to associate a sanitizer with the host binding or attached an…

    Recommended action: Upgrade to 22.1.0, 21.2.20 or 20.3.28 by release line; some affected versions have no fix yet, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:github.com (1)osv.dev (2)Source checked Evidence →
  2. High, CVSS 7.6npmPublished

    Angular i18n: Cross-Site Scripting (XSS) via event-handler attributes

    CVE-2026-69151 · GHSA-jj27-h5hq-8x99

    Affected
    • npm @angular/compiler >= 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
    Fixed in
    22.0.121.2.1920.3.27· Partial vendor fix
    Issue
    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: 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. -…

    Recommended action: Upgrade to 22.0.1, 21.2.19 or 20.3.27 by release line; some affected versions have no fix yet, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:github.comSource checked Evidence →
  3. Medium, CVSS 5.3npmAmendedPublished

    @angular/compiler: Two-Way Property Binding Sanitization Bypass (XSS)

    CVE-2026-54265 · GHSA-58w9-8g37-x9v5

    Affected
    • npm @angular/compiler >= 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
    Fixed in
    20.3.2522.0.121.2.17· Partial vendor fix
    Issue
    An issue in the @angular/compiler package allows bypassing DOM property sanitization through the use of two-way property bindings. Specifically, when a native DOM property that requires sanitization (such as innerHTML, srcdoc, src, href, data, or sandbox) is bound using the two-way binding syntax (e.g., [(innerHTML)]="value" or bindon-innerHTML="value"), the Angular template compiler failed to apply the appropriate schema-derived sanitizer resolution to the TwoWayProperty operation. As a result, native two-way DOM bindings were emitted without the required sanitizer function, whereas equivalent one-way bindings would be properly sanitized. This flaw enables an attacker who can control the value of a two-way bound sensitive property to bypass Angular's built-in sanitization logic, potentially leading to client-side Cross-Site Scripting (XSS). Impact Any Angular application that uses two-way data binding ([()] or bindon-) on security-sensitive native DOM properties (like innerHTML,…

    Recommended action: Upgrade to 22.0.1, 21.2.17 or 20.3.25 by release line; some affected versions have no fix yet, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  4. Medium, CVSS 5.3npmAmendedPublished

    Angular: Template and Attribute Namespace Sanitization Bypass (XSS)

    CVE-2026-50557 · GHSA-f3m7-gqxr-g87x

    Affected
    • npm @angular/compiler >= 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
    Fixed in
    19.2.2222.0.0-rc.220.3.2221.2.15· Partial vendor fix
    Issue
    An issue in the @angular/compiler and @angular/core packages allows bypassing element and attribute sanitization/validation through specific namespace workarounds. Specifically, namespaced script elements (e.g., <svg:script or <:svg:script) were not properly identified as script elements by the Angular template preparser, allowing them to pass through template compilation without being stripped. Furthermore, security context schema mappings for element attributes did not consistently handle attributes within namespaced elements (like SVG and MathML), opening up gaps where malicious namespaced attributes could bypass runtime and compile-time sanitizers. Combined, these flaws enable an attacker who can inject or supply a template/tag structure with custom namespaces to bypass Angular's script-stripping logic and attribute sanitizers, leading to client-side Cross-Site Scripting (XSS). Impact Any Angular application that compiles user-controlled templates at runtime, or relies on…

    Recommended action: Upgrade to 22.0.0-rc.2 (pre-release), 21.2.15, 20.3.22 or 19.2.22 by release line; some affected versions have no fix yet, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  5. High, CVSS 8.6npmAmendedPublished

    Angular vulnerable to XSS in i18n attribute bindings

    CVE-2026-32635 · GHSA-g93w-mfhg-p222

    Affected
    • npm @angular/compiler >= 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
    Fixed in
    22.0.0-next.320.3.1819.2.2021.2.4· Partial vendor fix
    Issue
    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. The following example illustrates the issue: The following attributes have been confirmed to be vulnerable: - action - background - cite - codebase - data - formaction - href - itemtype - longdesc - poster - src - xlink:href Impact When exploited, this vulnerability allows an attacker to execute arbitrary code within the context of the vulnerable application's domain. This enables: - Session Hijacking: Stealing session cookies and authentication tokens. - Data…

    Recommended action: Upgrade to 22.0.0-next.3 (pre-release), 21.2.4, 20.3.18 or 19.2.20 by release line; some affected versions have no fix yet, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  6. High, CVSS 8.5npmAmendedPublished

    Angular has XSS Vulnerability via Unsanitized SVG Script Attributes

    CVE-2026-22610 · GHSA-jrmj-c5cx-3cw6

    Affected
    • npm @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
    Fixed in
    21.1.0-rc.020.3.1621.0.719.2.18· Partial vendor fix
    Issue
    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…

    Recommended action: Upgrade to 21.1.0-rc.0 (pre-release), 21.0.7, 20.3.16 or 19.2.18 by release line; some affected versions have no fix yet, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  7. High, CVSS 8.5npmAmendedPublished

    Angular Stored XSS Vulnerability via SVG Animation, SVG URL and MathML Attributes

    CVE-2025-66412 · GHSA-v4hv-rgfq-gp49

    Affected
    • npm @angular/compiler >= 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
    Fixed in
    19.2.1721.0.220.3.15· Partial vendor fix
    Issue
    A Stored Cross-Site Scripting (XSS) vulnerability has been identified in the Angular Template Compiler. It occurs because the compiler's internal security schema is incomplete, allowing attackers to bypass Angular's built-in security sanitization. Specifically, the schema fails to classify certain URL-holding attributes (e.g., those that could contain javascript: URLs) as requiring strict URL security, enabling the injection of malicious scripts. Additionally, a related vulnerability exists involving SVG animation elements (<animate, <set, <animateMotion, <animateTransform). The attributeName attribute on these elements was not properly validated, allowing attackers to dynamically target security-sensitive attributes like href or xlink:href on other elements. By binding attributeName to "href" and providing a javascript: URL in the values or to attribute, an attacker could bypass sanitization and execute arbitrary code. Attributes confirmed to be vulnerable include: SVG-related…

    Recommended action: Upgrade to 21.0.2, 20.3.15 or 19.2.17 by release line; some affected versions have no fix yet, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →