chore(deps): update dependency @angular/compiler to v21.2.20 [security] #568
main fromrefs/pull/568/head·opened View on GitHubThis PR contains the following updates:
| Package | Change | Age | Confidence |
|---|---|---|---|
| @angular/compiler (source) | 21.2.12 → 21.2.20 |
@​angular/compiler: Two-Way Property Binding Sanitization Bypass (XSS)#
CVE-2026-54265 / GHSA-58w9-8g37-x9v5
More information
Details#
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, href on <a>, src on <img>/<iframe>, etc.) is vulnerable to this security bypass.
Once exploited, this allows a malicious actor to supply an unsanitized property binding value that bypasses core sanitization constraints. This could lead to the execution of arbitrary JavaScript within the target user's browser context, potentially resulting in session hijacking, sensitive data exposure, or unauthorized actions on behalf of the user.
Attack Preconditions#
To successfully exploit this vulnerability, the following environment parameters and application states must concurrently exist:
- Two-Way Binding on Sensitive Properties: The application must bind to a sensitive native DOM property using the two-way binding syntax (e.g.,
<div [(innerHTML)]="userContent"></div>). - User-Controlled Input: The value bound to this property must be influenceable by user-controlled input.
- Absence of Additional Sanitization: The application does not perform separate manual sanitization (e.g., via
DomSanitizer) before passing the value to the bound property.
Patches#
- 22.0.1
- 21.2.17
- 20.3.25
Severity#
- CVSS Score: 5.3 / 10 (Medium)
- Vector String:
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N
References#
- https://github.com/angular/angular/security/advisories/GHSA-58w9-8g37-x9v5
- https://github.com/angular/angular/pull/69107
- https://github.com/angular/angular/commit/3c70270c96677c0dd33585f2afe8e187113e5fb4
- https://nvd.nist.gov/vuln/detail/CVE-2026-54265
- https://github.com/advisories/GHSA-58w9-8g37-x9v5
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Angular: Template and Attribute Namespace Sanitization Bypass (XSS)#
CVE-2026-50557 / GHSA-f3m7-gqxr-g87x
More information
Details#
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 sanitization of namespaced elements/attributes, is vulnerable to this security bypass.
Once exploited, this allows a malicious actor to inject a namespaced script element or dynamic attribute bindings, bypassing core sanitization constraints to execute arbitrary JavaScript within the target user's browser context. This could lead to session hijacking, sensitive data exposure, or unauthorized actions on behalf of the user.
Attack Preconditions#
To successfully exploit these vulnerabilities, the following environment parameters and application states must all concurrently exist:
- User-Controlled Template Input: The application must accept user-controlled inputs that are directly processed by the Angular template compiler at runtime.
- Namespace Parsing Support: The input structure must employ custom namespace prefixes (such as
<svg:script>) to evade standard tag-name blocklists/checks. - Absence of Additional Context Sanitization: The application does not perform separate input sanitization before feeding values to the Angular compiler.
Patches#
- 22.0.0-rc.2
- 21.2.15
- 20.3.22
- 19.2.23
Severity#
- CVSS Score: 5.3 / 10 (Medium)
- Vector String:
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N
References#
- https://github.com/angular/angular/security/advisories/GHSA-f3m7-gqxr-g87x
- https://github.com/angular/angular/pull/68689
- https://github.com/angular/angular/pull/68868
- https://nvd.nist.gov/vuln/detail/CVE-2026-50557
- https://github.com/advisories/GHSA-f3m7-gqxr-g87x
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Angular i18n: Cross-Site Scripting (XSS) via event-handler attributes#
CVE-2026-69151 / GHSA-jj27-h5hq-8x99
More information
Details#
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:
<img src="foo.jpg" onerror="void 0" i18n-onerror />
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.
- Unauthorized Actions: Performing actions on behalf of the authenticated user.
Patched Versions#
- 22.0.1
- 21.2.19
- 20.3.27
Workarounds#
Ensure that static event-handler attributes (e.g., onerror, onclick) are never marked for internationalization (i18n-on*) in application templates, and ensure translation files are sourced from trusted origins.
Severity#
- CVSS Score: 7.6 / 10 (High)
- Vector String:
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N
References#
- https://github.com/angular/angular/security/advisories/GHSA-jj27-h5hq-8x99
- https://github.com/angular/angular/pull/68821
- https://github.com/angular/angular/pull/69306
- https://github.com/angular/angular/commit/417a4071a776464d549509ed3aec121dbd2fda5e
- https://github.com/angular/angular/commit/6c41f5ca01c0ae045fc7d929b72853a11eb55865
- https://github.com/advisories/GHSA-jj27-h5hq-8x99
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Angular: Sanitization bypass via directive host bindings on concrete host elements in @​angular/core and @​angular/compiler#
CVE-2026-88057 / GHSA-hh8m-fm6v-7cvg
More information
Details#
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:
hostDirectivescomposition,- Class inheritance of host bindings,
- Dynamic component instantiation (
createComponentwith customhostElementor 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.021.2.2020.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://).
Severity#
- CVSS Score: 5.3 / 10 (Medium)
- Vector String:
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N
References#
- https://github.com/angular/angular/security/advisories/GHSA-hh8m-fm6v-7cvg
- https://github.com/angular/angular/issues/69550
- https://github.com/angular/angular/pull/69558
- https://github.com/angular/angular/commit/2f96c8020f85ccb715a76de4b79a0c680c2c7264
- https://github.com/angular/angular/commit/6afe6fa781c2f0931f0aedd729b9884a8fe212ee
- https://github.com/angular/angular/commit/6caa298dee58319b2d674dc91364e26ffe3ecb2b
- https://github.com/angular/angular/releases/tag/v20.3.28
- https://github.com/angular/angular/releases/tag/v21.2.20
- https://github.com/angular/angular/releases/tag/v22.1.0
- https://github.com/advisories/GHSA-hh8m-fm6v-7cvg
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Release Notes#
angular/angular (@angular/compiler)
v21.2.20#
core#
| Commit | Type | Description |
|---|---|---|
| 6afe6fa781 | fix | sanitize host bindings on concrete hosts |
http#
| Commit | Type | Description |
|---|---|---|
| fec5977df4 | fix | match header values exactly when deleting |
| e33d69a71c | fix | preserve immutability of materialized clones |
| caf616670f | fix | run root interceptors in the terminal request chain |
v21.2.19#
compiler#
| Commit | Type | Description |
|---|---|---|
| e2660c3dee | fix | disallow i18n event attributes |
| 7b884f585a | fix | restrict possible event handler check to property names longer than 2 characters |
http#
| Commit | Type | Description |
|---|---|---|
| 948a8d6831 | fix | distinguish repeated transfer cache params |
| 9949dccce1 | fix | enable xsrf for root-provided HttpClient |
platform-server#
| Commit | Type | Description |
|---|---|---|
| f34a93c946 | fix | update domino to latest version |
v21.2.18#
compiler-cli#
| Commit | Type | Description |
|---|---|---|
| 8d22cc953b | fix | update babel dependencies to latest v7 |
core#
| Commit | Type | Description |
|---|---|---|
| 6bcce117fb | fix | avoid caching missing locale data |
| 5a693bafcd | fix | reject dynamic script host elements |
http#
| Commit | Type | Description |
|---|---|---|
| 91df739b80 | fix | prevent caching of responses with Set-Cookie headers |
service-worker#
| Commit | Type | Description |
|---|---|---|
| 1804f73bec | fix | preserve referrer in asset requests |
| e86c31bf26 | fix | preserve referrer policy in asset requests |
v21.2.17#
Deprecations#
platform-server#
- XHR support in
@angular/platform-serveris deprecated. Use standardfetchAPIs instead.
common#
| Commit | Type | Description |
|---|---|---|
| 86a56dc279 | fix | Limits date format string length |
| d846326b07 | fix | skip transfer cache for uncacheable HTTP traffic |
| bc55749698 | fix | use cryptographically secure SHA-256 for transfer cache key generation |
compiler#
| Commit | Type | Description |
|---|---|---|
| dc9c99636d | fix | sanitize two-way properties |
core#
| Commit | Type | Description |
|---|---|---|
| 1523061137 | fix | harden TransferState restoration against DOM clobbering |
| 88832c84f8 | fix | validate lowercase SVG animation attribute names (#​69269) |
http#
| Commit | Type | Description |
|---|---|---|
| bcb1b7ea25 | fix | preserve empty referrer option in HttpRequest |
| a810a319d1 | fix | Rejects non-HTTP(S) URLs in JSONP requests |
| e245d40c4d | fix | skip transfer cache for fetch credentialed requests |
platform-server#
| Commit | Type | Description |
|---|---|---|
| 35510746b7 | fix | harden platform location origin validation during SSR |
| 13fb0afe93 | refactor | deprecate ServerXhr (#​69255) |
service-worker#
| Commit | Type | Description |
|---|---|---|
| b9d29381bb | fix | Strips sensitive headers on cross-origin redirects |
v21.2.16#
common#
| Commit | Type | Description |
|---|---|---|
| f6d8e642b0 | fix | only strip a literal /index.html suffix from URLs |
compiler#
| Commit | Type | Description |
|---|---|---|
| ae1c8a1f7a | fix | move projection attributes into constants |
core#
| Commit | Type | Description |
|---|---|---|
| 3fd6897a67 | fix | harden inherit definition feature against polluted prototypes |
| 7e38336dc7 | fix | use Object.create(null) for LOCALE_DATA as a hardening measure |
platform-server#
| Commit | Type | Description |
|---|---|---|
| 66821c4ed5 | fix | throw on suspicious URLs and restrict protocol-relative URLs |
| d3170031b6 | fix | update domino to latest version |
v21.2.15#
common#
| Commit | Type | Description |
|---|---|---|
| 7f4ac78994 | fix | add upper bounds for digitsInfo |
| 300f61feb3 | fix | sanitize placeholder |
compiler#
| Commit | Type | Description |
|---|---|---|
| 0b07f47bd6 | fix | normalize tag names with custom namespaces in DomElementSchemaRegistry (#​68925) |
| eb1cbbf2eb | fix | prevent namespaced SVG [removed] elements from being stripped |
| cc1378d54b | fix | sanitize dynamic href and xlink:href bindings on SVG a elements (#​68925) |
| 782e01594e | fix | strip namespaced SVG script elements during template compilation (#​68925) |
core#
| Commit | Type | Description |
|---|---|---|
| ff12fe55ac | fix | normalize tag names in runtime i18n attribute security context lookup (#​68925) |
| e6fe77cc97 | fix | sanitize meta selectors |
| daaf32937f | fix | support prefix-insensitive DOM schema lookups and compile-time i18n attribute validation (#​68925) |
| dada86e43d | fix | synchronize core sanitization schema with compiler (#​68925) |
http#
| Commit | Type | Description |
|---|---|---|
| 582a417bd2 | fix | exclude withCredentials requests from transfer cache |
| 5c6d6df34b | fix | skip TransferCache for cookie-bearing requests by default |
platform-server#
| Commit | Type | Description |
|---|---|---|
| 37e8aadf87 | fix | prevent SSRF bypasses via backslash URLs in HttpClient |
| 72696e244e | fix | secure location and document initialization against SSRF and path hijack |
service-worker#
| Commit | Type | Description |
|---|---|---|
| b8bd49341d | fix | Preserves explicit 'credentials: omit' in asset requests |
| ca32fc1000 | fix | Preserves HTTP cache mode in asset group requests |
v21.2.14#
compiler#
| Commit | Type | Description |
|---|---|---|
| 68282dff9f | fix | strip namespaced SVG script elements during template compilation |
core#
| Commit | Type | Description |
|---|---|---|
| c0f52272ed | fix | do not insert todo when migrating void @​Output |
| 938a7f3edd | fix | makes resource URL sanitizer lookup case-insensitive |
| 0fb2724194 | fix | reject script element as a dynamic component host |
| 49113ac0ef | fix | visit ICU expressions in signal migration schematics |
router#
| Commit | Type | Description |
|---|---|---|
| 099bf577ee | fix | skip scroll-to-top on initial navigation when hydrating |
v21.2.13#
core#
| Commit | Type | Description |
|---|---|---|
| 1c6553e97d | fix | disallow event attribute bindings in host bindings unconditionally |
platform-server#
| Commit | Type | Description |
|---|---|---|
| 629905d537 | fix | add allowedHosts option to renderModule and renderApplication |
| 0b7192f441 | fix | forward BEFORE_APP_SERIALIZED errors to ErrorHandler |
Configuration#
📅 Schedule: (UTC)
- Branch creation
- At any time (no schedule defined)
- Automerge
- At any time (no schedule defined)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
- If you want to rebase/retry this PR, check this box
This PR was generated by Mend Renovate. View the repository job log.