Skip to content

Update dependency @angular/compiler to v21.2.15 [SECURITY] - #19

Open
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/npm-angular-compiler-vulnerability
Open

Update dependency @angular/compiler to v21.2.15 [SECURITY]#19
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/npm-angular-compiler-vulnerability

Conversation

@renovate

@renovate renovate Bot commented May 14, 2026

Copy link
Copy Markdown

ℹ️ Note

This PR body was truncated due to platform limits.

This PR contains the following updates:

Package Change Age Confidence
@angular/compiler (source) 21.1.321.2.15 age confidence

Angular vulnerable to XSS in i18n attribute bindings

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

More information

Details

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:

<a href="" i18n-href>Click me</a>

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 Exfiltration: Capturing and transmitting sensitive user data.
  • Unauthorized Actions: Performing actions on behalf of the user.
Attack Preconditions
  1. The application must use a vulnerable version of Angular.
  2. The application must bind unsanitized user input to one of the attributes mentioned above.
  3. The bound value must be marked for internationalization via the presence of a i18n-<name> attribute on the same element.
Patches
  • 22.0.0-next.3
  • 21.2.4
  • 20.3.18
  • 19.2.20
Workarounds

The primary workaround is to ensure that any data bound to the vulnerable attributes is never sourced from untrusted user input (e.g., database, API response, URL parameters) until the patch is applied, or when it is, it shouldn't be marked for internationalization.

Alternatively, users can explicitly sanitize their attributes by passing them through Angular's DomSanitizer:

import {Component, inject, SecurityContext} from '@&#8203;angular/core';
import {DomSanitizer} from '@&#8203;angular/platform-browser';

@&#8203;Component({
  template: `
    <form action="" i18n-action>
      <button>Submit</button>
    </form>
  `,
})
export class App {
  url: string;

  constructor() {
    const dangerousUrl = 'javascript:alert(1)';
    const sanitizer = inject(DomSanitizer);
    this.url = sanitizer.sanitize(SecurityContext.URL, dangerousUrl) || '';
  }
}
References

Severity

  • CVSS Score: 8.6 / 10 (High)
  • Vector String: CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

References

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:

  1. User-Controlled Template Input: The application must accept user-controlled inputs that are directly processed by the Angular template compiler at runtime.
  2. Namespace Parsing Support: The input structure must employ custom namespace prefixes (such as <svg:script>) to evade standard tag-name blocklists/checks.
  3. 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

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Release Notes

angular/angular (@​angular/compiler)

v21.2.15

Compare Source

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 <style> 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

Compare Source

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

Compare Source

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

v21.2.12

Compare Source

core
Commit Type Description
fe13bb669d fix allow explicit read generic with signal input transforms
3430251fef fix i18n flags leaking on errors
1aeebbe304 fix respect ngSkipHydration on components with projectable nodes in LContainers
9e38ed7d57 fix sanitizer typings
7a05a9a71a fix validate security-sensitive attributes in i18n bindings
c37f6ca42f fix visit ng-let expression value in signal migration schematics
forms
Commit Type Description
03ad53863b fix prohibit concurrent submits in signal forms

v21.2.11

Compare Source

common
Commit Type Description
10ad3c0692 fix prevent focus from scrollToAnchor
compiler
Commit Type Description
4f5d8a2c0b fix let declaration span not including end character
core
Commit Type Description
a40e2cebc8 fix fix ordering of view queries metadata in JIT mode
885a1a1d97 fix guard against non-object events and avoid listener wrapper identity mismatch
7a64aff9b5 fix prevent event replay double-invocation when element hydrates before app stability
platform-server
Commit Type Description
be1f80a253 fix ensure origin has a trailing slash when parsing url

v21.2.10

Compare Source

docs
Commit Type Description
0d5ee9ae1b fix link formatting in "Animating your Application with CSS"
migrations
Commit Type Description
5533ab4f56 fix fix NgClass leaving trailing comma after removal
router
Commit Type Description
580212c995 fix restore internal URL on popstate when browserUrl is used

v21.2.9

Compare Source

core
Commit Type Description
f603d4714f fix escape forward slashes in transfer state to prevent crawler indexing
http
Commit Type Description
540536c386 fix add CSP nonce support to JsonpClientBackend
63a857b874 fix Don't on Passthru outside of reactive context
platform-server
Commit Type Description
e0b5078cf2 fix prevent SSRF bypasses via protocol-relative and backslash URLs
router
Commit Type Description
684e9fd53d fix normalize multiple leading slashes in URL parser

v21.2.8

Compare Source

compiler
Commit Type Description
e40d378f3e fix handle nested brackets in host object bindings
compiler-cli
Commit Type Description
2c6781071f fix error for type parameter declarations
core
Commit Type Description
82192deda9 fix handle missing serialized container hydration data
057cc6d09d fix remove obsolete iOS cursor pointer hack in event delegation
language-service
Commit Type Description
7797671257 fix get quick info at local var location to align with TS semantics and support type narrowing

v21.2.7

Compare Source

compiler
Commit Type Description
fea25d1a60 fix register SVG animation attributes in URL security context (#​67797)
compiler-cli
Commit Type Description
bba5ed8e64 fix prevent recursive scope checks for invalid NgModule imports
core
Commit Type Description
d04ddd73df fix prevent binding unsafe attributes on SVG animation elements (#​67797)
8fd896e99a fix resolve component import by exact specifier in route lazy-loading schematic
b682c62873 fix treat object[data] as resource URL context (#​67797)
localize
Commit Type Description
3c41e74fdd fix validate locale in getOutputPathFn to prevent path traversal
router
Commit Type Description
0960592d3d fix pass outlet context to split to fix empty path named outlets

v21.2.6

Compare Source

common
Commit Type Description
b4ab6ba2e8 fix avoid redundant image fetch on destroy with auto sizes
compiler
Commit Type Description
880a57d4b3 fix prevent shimCssText from adding extra blank lines per CSS comment
core
Commit Type Description
ad0156e056 fix fixes a regression with animate.leave and reordering
migrations
Commit Type Description
73d6b01b47 fix inject migration not work in multi-project workspace with option path

v21.2.5

Compare Source

compiler
Commit Type Description
334ae10168 fix ensure generated code compiles
23ea431c4e fix parse named HTML entities containing digits
compiler-cli
Commit Type Description
26c43d14ba fix escape template literal in TCB
67e0ba7e03 fix generic types not filled out correctly in type check block
core
Commit Type Description
1890c3008b fix clean up dehydrated views during HMR component replacement
bf948be4c2 fix run linked signal equality check without reactive consumer
migrations
Commit Type Description
076d41c3f6 fix prevent trailing comma syntax errors after removing NgStyle
service-worker
Commit Type Description
e19150d2b5 fix preserve redirect policy on reconstructed asset requests

v21.2.4

Compare Source

compiler
Commit Type Description
ed2d324f9c fix disallow translations of iframe src
core
Commit Type Description
abbd8797bb fix reverts "feat(core): add support for nested animations"
d1dcd16c5b fix sanitize translated form attributes

v21.2.3

Compare Source

core
Commit Type Description
62a97f7e4b fix ensure definitions compile
21b1c3b2ee fix include signal debug names in their toString() representation
224e60ecb1 fix sanitize translated attribute bindings with interpolations

v21.2.2

Compare Source

compiler
Commit Type Description
1df1697c6e fix prevent mutation of children array in RecursiveVisitor
compiler-cli
Commit Type Description
c822bf8e76 fix always parenthesize object literals in TCB
05d022d5e6 fix ignore generated ngDevMode signal branch for code coverage
forms
Commit Type Description
670d1660c4 feat add 'blur' option to debounce rule

v21.2.1

Compare Source

Deprecations

platform-server
  • XHR support in @angular/platform-server is deprecated. Use standard fetch APIs 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.0

Compare Source

common
Commit Type Description
18003a33bb feat add an 'outlet' injector option for ngTemplateOutlet
8bbe6dc46c feat Add Location strategies to manage trailing slash on write
51cc914807 feat support height in ImageLoaderConfig and built-in loaders
compiler
Commit Type Description
72534e2a34 feat Add support for the instanceof binary operator
95b3f37d4a feat Exhaustive checks for switch blocks
04ba09a8d9 feat support AstVisitor.visitEmptyExpr()
ce80136e7b fix optimize away unnecessary restore/reset view calls
3242a61bae fix variable counter visiting some expressions twice
compiler-cli
Commit Type Description
473dd3e1cb fix attach source spans to object literal keys in TCB
a904d9f77b fix support nested component declaration
2ea6dfc6c9 fix update diagnostic to flag no-op arrow functions in listeners
core
Commit Type Description
8d5210c9fe feat add ChangeDetectionStrategy.Eager alias for Default
92d2498910 feat add host node to DeferBlockData (#​66546)
ea2016a6dc feat add support for nested animations
81cabc1477 feat add support for TypeScript 6
1ba9b7ac50 feat resource composition via snapshots
d9923b72a2 feat support arrow functions in expressions
a7e8abbb7e fix correctly handle SkipSelf when resolving from embedded view injector
0806ee3826 fix prevent animated element duplication with dynamic components in zoneless mode
ed78fa05c7 fix Remove note to skip arrow functions in best practices
forms
Commit Type Description
f56bb07d83 feat add field param to submit action and onInvalid
ba009b6031 feat add form directive
22afbb2f36 feat add parsing support to native inputs (#​66917)
95c386469c feat Add passing focus options to form field
95ecce8334 feat allow setting submit options at form-level
ebae211add feat introduce parse errors in signal forms
3937afc316 feat introduce SignalFormControl for Reactive Forms compatibility
30f0914754 feat support bindi

Note

PR body was truncated to here.


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.

@renovate

renovate Bot commented May 14, 2026

Copy link
Copy Markdown
Author

⚠️ Artifact update problem

Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.

♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

  • any of the package files in this branch needs updating, or
  • the branch becomes conflicted, or
  • you click the rebase/retry checkbox if found above, or
  • you rename this PR's title to start with "rebase!" to trigger it manually

The artifact failure details are included below:

File name: src/main/webapp/package-lock.json
npm warn Unknown env config "store". This will stop working in the next major version of npm.
npm error code ERESOLVE
npm error ERESOLVE could not resolve
npm error
npm error While resolving: @angular/compiler-cli@21.1.3
npm error Found: @angular/compiler@21.2.15
npm error node_modules/@angular/compiler
npm error   @angular/compiler@"21.2.15" from the root project
npm error   peer @angular/compiler@"^21.0.0" from @angular/build@21.1.3
npm error   node_modules/@angular/build
npm error     dev @angular/build@"21.1.3" from the root project
npm error
npm error Could not resolve dependency:
npm error peer @angular/compiler@"21.1.3" from @angular/compiler-cli@21.1.3
npm error node_modules/@angular/compiler-cli
npm error   dev @angular/compiler-cli@"21.1.3" from the root project
npm error   peer @angular/compiler-cli@"^21.0.0" from @angular/build@21.1.3
npm error   node_modules/@angular/build
npm error     dev @angular/build@"21.1.3" from the root project
npm error
npm error Conflicting peer dependency: @angular/compiler@21.1.3
npm error node_modules/@angular/compiler
npm error   peer @angular/compiler@"21.1.3" from @angular/compiler-cli@21.1.3
npm error   node_modules/@angular/compiler-cli
npm error     dev @angular/compiler-cli@"21.1.3" from the root project
npm error     peer @angular/compiler-cli@"^21.0.0" from @angular/build@21.1.3
npm error     node_modules/@angular/build
npm error       dev @angular/build@"21.1.3" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
npm error
npm error
npm error For a full report see:
npm error /runner/cache/others/npm/_logs/2026-08-01T13_02_19_947Z-eresolve-report.txt
npm error A complete log of this run can be found in: /runner/cache/others/npm/_logs/2026-08-01T13_02_19_947Z-debug-0.log

@renovate
renovate Bot force-pushed the renovate/npm-angular-compiler-vulnerability branch from f9a55ac to 74afed4 Compare June 20, 2026 10:55
@renovate renovate Bot changed the title Update dependency @angular/compiler to v21.2.4 [SECURITY] Update dependency @angular/compiler to v21.2.15 [SECURITY] Jun 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants