Packages

ModerateVulnerabilityGHSA-hh8m-fm6v-7cvgCVE-2026-88057Published 10 Sep 2026

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

Affected releases · @angular/compiler

  • 22.x22.0.0 – 22.0.8Fixed in 22.1.0
  • 21.x21.0.0 – 21.2.19Fixed in 21.2.20
  • 20.x20.0.0 – 20.3.27Fixed in 20.3.28
  • 19.x19.0.0 – 19.2.25No fix on this line yet
  • 18.x and older2.0.0 – 18.2.14No fix, no longer updated

On 22.x, the newest line:

npm install @angular/compiler@22.1.0
22.x
  1. Affected

    22.0.0 – 22.0.8

    9 releases

  2. Fixed

    22.1.0 – 22.2.3

    13 releases, latest

21.x
  1. Affected

    21.0.0 – 21.2.19

    37 releases

  2. Fixed

    21.2.20 – 21.2.25

    6 releases

20.x
  1. Affected

    20.0.0 – 20.3.27

    49 releases

  2. Fixed

    20.3.28 – 20.3.34

    7 releases

19.x
  1. Affected

    19.0.0 – 19.2.25

    43 releases

18.x
  1. Affected

    18.0.0 – 18.2.14

    29 releases

17.x
  1. Affected

    17.0.0 – 17.3.12

    32 releases

16.x
  1. Affected

    16.0.0 – 16.2.12

    30 releases

15.x
  1. Affected

    15.0.0 – 15.2.10

    22 releases

14.x
  1. Affected

    14.0.0 – 14.3.0

    26 releases

13.x
  1. Affected

    13.0.0 – 13.4.0

    30 releases

12.x
  1. Affected

    12.0.0 – 12.2.17

    30 releases

11.x
  1. Affected

    11.0.0 – 11.2.14

    28 releases

10.x
  1. Affected

    10.0.0 – 10.2.5

    28 releases

9.x
  1. Affected

    9.0.0 – 9.1.13

    22 releases

8.x
  1. Affected

    8.0.0 – 8.2.14

    23 releases

7.x
  1. Affected

    7.0.0 – 7.2.16

    27 releases

6.x
  1. Affected

    6.0.0 – 6.1.10

    20 releases

5.x
  1. Affected

    5.0.0 – 5.2.11

    22 releases

4.x
  1. Affected

    4.0.0 – 4.4.7

    30 releases

2.x
  1. Affected

    2.0.0 – 2.4.10

    24 releases

587 stable releases of @angular/compiler, oldest to newest, one row per major.

Affected releases · @angular/core

  • 22.x22.0.0 – 22.0.8Fixed in 22.1.0
  • 21.x21.0.0 – 21.2.19Fixed in 21.2.20
  • 20.x20.0.0 – 20.3.27Fixed in 20.3.28
  • 19.x19.0.0 – 19.2.25No fix on this line yet
  • 18.x and older2.0.0 – 18.2.14No fix, no longer updated

On 22.x, the newest line:

npm install @angular/core@22.1.0
22.x
  1. Affected

    22.0.0 – 22.0.8

    9 releases

  2. Fixed

    22.1.0 – 22.2.3

    13 releases, latest

21.x
  1. Affected

    21.0.0 – 21.2.19

    37 releases

  2. Fixed

    21.2.20 – 21.2.25

    6 releases

20.x
  1. Affected

    20.0.0 – 20.3.27

    49 releases

  2. Fixed

    20.3.28 – 20.3.34

    7 releases

19.x
  1. Affected

    19.0.0 – 19.2.25

    43 releases

18.x
  1. Affected

    18.0.0 – 18.2.14

    29 releases

17.x
  1. Affected

    17.0.0 – 17.3.12

    32 releases

16.x
  1. Affected

    16.0.0 – 16.2.12

    30 releases

15.x
  1. Affected

    15.0.0 – 15.2.10

    22 releases

14.x
  1. Affected

    14.0.0 – 14.3.0

    26 releases

13.x
  1. Affected

    13.0.0 – 13.4.0

    30 releases

12.x
  1. Affected

    12.0.0 – 12.2.17

    30 releases

11.x
  1. Affected

    11.0.0 – 11.2.14

    28 releases

10.x
  1. Affected

    10.0.0 – 10.2.5

    28 releases

9.x
  1. Affected

    9.0.0 – 9.1.13

    22 releases

8.x
  1. Affected

    8.0.0 – 8.2.14

    23 releases

7.x
  1. Affected

    7.0.0 – 7.2.16

    27 releases

6.x
  1. Affected

    6.0.0 – 6.1.10

    20 releases

5.x
  1. Affected

    5.0.0 – 5.2.11

    22 releases

4.x
  1. Affected

    4.0.0 – 4.4.7

    30 releases

2.x
  1. Affected

    2.0.0 – 2.4.10

    24 releases

587 stable releases of @angular/core, oldest to newest, one row per major.

Is your project affected?

Paste your package.json, or type the range you declare for @angular/compiler. It is read in your browser and sent nowhere.

Is your project affected?

Paste your package.json, or type the range you declare for @angular/core. It is read in your browser and sent nowhere.

What happens

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 incorrect security context. As a result, untrusted inputs (e.g. javascript:... URLs) bound via the host binding would be written to the DOM attribute without passing through Angular's built-in sanitizer.

Impact

An attacker capable of controlling the value bound to an affected directive host binding could execute arbitrary JavaScript in the user's browser context (Cross-Site Scripting).

Patches

This issue has been resolved in versions:

  • 22.1.0

  • 21.2.20

  • 20.3.28

Workarounds

Ensure that any user-controlled values assigned to properties bound via directive host bindings are explicitly sanitized using DomSanitizer.sanitize(SecurityContext.URL, ...) before assignment, or restrict the input to validated safe URL schemes (e.g. http://, https://).