CVE-2025-66035: Angular @angular/common Vulnerable to XSRF Token Leakage via Protocol-Relative URLs

@angular/common Updated 14 Dec 2025

Summary

26/11/2025
Yes i
High
7.7

CVE-2025-66035: Angular is Vulnerable to XSRF Token Leakage via Protocol-Relative URLs in Angular HTTP Client. Affects @angular/common across 3 version ranges.

< 19.2.16 >= 20.0.0-next.0, < 20.3.14 >= 21.0.0-next.0, < 21.0.1

Fixed in 19.2.16, 20.3.14 or 21.0.1, depending on the release line you run. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

Angular is a popular web application framework that allows developers to build dynamic single-page applications. The @angular/common package provides essential functionalities such as common directives, pipes, and services that are widely used in Angular applications. This package includes built-in security features, including Cross-Site Request Forgery (CSRF) protection, which is crucial for safeguarding user sessions against unauthorized actions. However, a recent vulnerability has been identified that compromises this protection under specific conditions.

Vulnerability Detail

The vulnerability arises from a flaw in Angular's HttpClient, which incorrectly handles protocol-relative URLs (URLs starting with '//'). When a request is made to such a URL, Angular treats it as a same-origin request and automatically includes the XSRF token in the 'X-XSRF-TOKEN' header. This behavior allows an attacker to capture the XSRF token by tricking the application into sending a state-changing HTTP request to a malicious domain. The unauthorized disclosure of the XSRF token can lead to arbitrary CSRF attacks against the victim user's session, effectively bypassing Angular's built-in CSRF protection.

How To Fix

Latest published version: 22.2.3 as of 23 Oct 2026

npm install @angular/common@22.2.3

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • < 19.2.16 19.2.16
    npm install @angular/common@19.2.16
  • >= 20.0.0-next.0, < 20.3.14 20.3.14
    npm install @angular/common@20.3.14
  • >= 21.0.0-next.0, < 21.0.1 21.0.1
    npm install @angular/common@21.0.1

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

As a temporary workaround, developers should avoid using protocol-relative URLs in HttpClient requests. Instead, all backend communication URLs should be hardcoded as relative paths (starting with a single '/') or fully qualified, trusted absolute URLs. For example, instead of using:

const url = '//attacker.com/api/data';

use:

const url = 'https://attacker.com/api/data';

Conclusion

The CVE-2025-66035 vulnerability in Angular's @angular/common package highlights the importance of proper URL handling in web applications. By understanding the implications of protocol-relative URLs and taking immediate action to update the package and implement workarounds, developers can protect their applications from potential CSRF attacks.

See every vulnerability recorded for @angular/common →

Share this vulnerability

FAQ

A protocol-relative URL is a URL that omits the protocol (http or https) and starts with '//' (e.g., '//example.com').

If your application uses protocol-relative URLs and has XSRF protection enabled, it may inadvertently expose the XSRF token to attackers, allowing them to perform CSRF attacks.

You should immediately update the @angular/common package to a patched version (19.2.16, 20.3.14, or 21.0.1) and avoid using protocol-relative URLs in your application.

Yes, you can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without requiring any signup.

Vulert is a tool that monitors and alerts in real-time for open-source vulnerabilities in your software by analyzing the package-lock.json file.

Related vulnerabilities

Recent vulnerabilities recorded for @angular/common.

How To Fix

Latest published version: 22.2.3 as of 23 Oct 2026

npm install @angular/common@22.2.3

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • < 19.2.16 19.2.16
    npm install @angular/common@19.2.16
  • >= 20.0.0-next.0, < 20.3.14 20.3.14
    npm install @angular/common@20.3.14
  • >= 21.0.0-next.0, < 21.0.1 21.0.1
    npm install @angular/common@21.0.1

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback