Skip to content

build(deps): update dependency @angular/compiler to v20.3.18 [security]#1312

Merged
renovate[bot] merged 1 commit intomainfrom
renovate/npm-angular-compiler-vulnerability
Mar 31, 2026
Merged

build(deps): update dependency @angular/compiler to v20.3.18 [security]#1312
renovate[bot] merged 1 commit intomainfrom
renovate/npm-angular-compiler-vulnerability

Conversation

@renovate
Copy link
Copy Markdown
Contributor

@renovate renovate Bot commented Jan 9, 2026

This PR contains the following updates:

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

GitHub Vulnerability Alerts

CVE-2026-22610

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

CVE-2026-32635

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


Release Notes

angular/angular (@​angular/compiler)

v20.3.18

Compare Source

compiler
Commit Type Description
02fbf08890 fix disallow translations of iframe src
core
Commit Type Description
72126f9a08 fix sanitize translated attribute bindings with interpolations
626bc8bc20 fix sanitize translated form attributes

v20.3.17

Compare Source

Breaking Changes

core
  • Angular now only applies known attributes from HTML in translated ICU content. Unknown attributes are dropped and not rendered.

    (cherry picked from commit 03da204)

core
Commit Type Description
7f9de3c118 fix block creation of sensitive URI attributes from ICU messages

v20.3.16

Compare Source

core
Commit Type Description
c2c2b4aaa8 fix sanitize sensitive attributes on SVG script elements

Configuration

📅 Schedule: Branch creation - "" in timezone Europe/Madrid, Automerge - Between 09:00 AM and 09:59 PM, Monday through Friday ( * 9-21 * * 1-5 ) in timezone Europe/Madrid.

🚦 Automerge: Enabled.

Rebasing: Whenever PR is behind base branch, 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 requested a review from davidlj95 as a code owner January 9, 2026 19:15
@renovate renovate Bot added dependencies Pull requests that update a dependency file javascript labels Jan 9, 2026
@renovate renovate Bot enabled auto-merge (squash) January 9, 2026 19:15
@renovate renovate Bot force-pushed the renovate/npm-angular-compiler-vulnerability branch from 777cfa3 to 71db4cb Compare January 19, 2026 15:29
@renovate renovate Bot force-pushed the renovate/npm-angular-compiler-vulnerability branch from 71db4cb to 143975a Compare February 12, 2026 15:49
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.03%. Comparing base (961536b) to head (3bd6223).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1312   +/-   ##
=======================================
  Coverage   98.03%   98.03%           
=======================================
  Files         127      127           
  Lines         765      765           
  Branches       62       62           
=======================================
  Hits          750      750           
  Misses          8        8           
  Partials        7        7           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@renovate renovate Bot force-pushed the renovate/npm-angular-compiler-vulnerability branch from 143975a to da97c4b Compare March 5, 2026 19:49
@renovate renovate Bot changed the title build(deps): update dependency @angular/compiler to v20.3.16 [security] build(deps): update dependency @angular/compiler to v20.3.18 [security] Mar 14, 2026
@renovate renovate Bot force-pushed the renovate/npm-angular-compiler-vulnerability branch from da97c4b to 4425150 Compare March 14, 2026 21:18
@renovate renovate Bot changed the title build(deps): update dependency @angular/compiler to v20.3.18 [security] build(deps): update dependency @angular/compiler to v20.3.18 [security] - autoclosed Mar 27, 2026
@renovate renovate Bot closed this Mar 27, 2026
auto-merge was automatically disabled March 27, 2026 01:02

Pull request was closed

@renovate renovate Bot deleted the renovate/npm-angular-compiler-vulnerability branch March 27, 2026 01:02
@renovate renovate Bot changed the title build(deps): update dependency @angular/compiler to v20.3.18 [security] - autoclosed build(deps): update dependency @angular/compiler to v20.3.18 [security] Mar 30, 2026
@renovate renovate Bot reopened this Mar 30, 2026
@renovate renovate Bot force-pushed the renovate/npm-angular-compiler-vulnerability branch 2 times, most recently from 4425150 to 3bd6223 Compare March 30, 2026 21:06
@renovate renovate Bot merged commit 5a4e895 into main Mar 31, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file javascript

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants