CVE-2026-111753
@angular/common: XSRF Token Leakage via URL Parsing Discrepancy in Angular HTTP Client (Incomplete fix for CVE-2025-66035)
Description
An incomplete fix for GHSA-58c5-g7wp-6w37 (CVE-2025-66035) in @angular/common's HTTP Client (HttpClient) allows Cross-Site Request Forgery (XSRF) tokens to be leaked to attacker-controlled cross-origin domains when requests use URLs that exploit parsing discrepancies between regular expressions and the browser's WHATWG URL parser.
Technical Description
To address CVE-2025-66035, xsrfInterceptorFn introduced a regular expression (const ABSOLUTE_URL_REGEX = /^(?:https?:)?\/\//i) to detect and skip absolute and protocol-relative URLs before attaching the X-XSRF-TOKEN header.
However, browsers resolve request URLs passed to fetch() and XMLHttpRequest.open() using the WHATWG URL parser. For http: and https: schemes, the WHATWG URL standard performs several normalizations prior to resolving the authority/origin:
- Backslashes (
\) are treated as forward slashes (/) — e.g.,/\evil.example/x,\\evil.example/x,\/evil.example/x,https:\\evil.example/x,https:/\evil.example/x. - Leading and trailing C0 control characters and spaces (
<= 0x20) are stripped — e.g.,' //evil.example/x','\0//evil.example/x','\x1f//evil.example/x'. - ASCII tab (
\t), newline (\n), and carriage return (\r) characters are removed anywhere in the input — e.g.,'/\t/evil.example/x','/\n/evil.example/x','htt\tps://evil.example/x'.
Because these URLs do not match /^(?:https?:)?\/\//i, xsrfInterceptorFn treats them as relative same-origin URLs and attaches the X-XSRF-TOKEN header, while the browser resolves and dispatches the request to the cross-origin host (evil.example).
Note: Angular 21.0.3+ and 22.x replaced the regular expression with a WHATWG new URL(req.url, locationOrigin) origin comparison in #65683 and were already unaffected. However, the 20.3.x LTS branch retained the regular expression until 20.3.34.
Impact
The token leakage bypasses Angular's built-in XSRF protection on affected versions, allowing an attacker to capture the user's valid X-XSRF-TOKEN header if their server permits the request and custom header via CORS. Once obtained, the attacker can perform Cross-Site Request Forgery (CSRF) attacks against the victim user's session.
Attack Preconditions
- The victim's Angular application must have XSRF protection enabled (enabled by default in
HttpClient). - The attacker must be able to make the application send a state-changing HTTP request (e.g.,
POST,PUT,DELETE,PATCH) to a URL they control (such as/\attacker.example/apior//attacker.example/api).
Patches
The issue is resolved by parsing and comparing the request URL's origin against the application's current origin using the standard URL constructor (new URL(req.url, locationOrigin)).
21.0.3(and all22.xreleases)20.3.34
Workarounds
If you cannot immediately upgrade to a patched version:
- Validate and normalize outgoing request URLs using
new URL(url, window.location.origin)and verify thatparsedUrl.origin === window.location.originbefore passing dynamic URLs to mutatingHttpClientrequests. - Avoid passing untrusted or user-controlled URLs to
HttpClientmutating methods.
Affected Maven artifacts (2)
| Artifact | Affected versions | Fixed in |
|---|---|---|
| org.mvnpm.at.angular » commonvia npm @angular/common | <= 19.2.25>= 20.0.0, < 20.3.34>= 21.0.0, < 21.0.3 | 20.3.34, 21.0.3 |
| org.webjars.npm » angular__commonvia npm @angular/common | <= 19.2.25>= 20.0.0, < 20.3.34>= 21.0.0, < 21.0.3 | 20.3.34, 21.0.3 |
Blast radius
35% of the dependent artifacts (7) still pull an affected version in their latest release.
| Depth | Dependent versions |
|---|---|
| Direct | 298 |
| 2 hops | 9 |
| 3 hops | 9 |
Most used dependents
- org.mvnpm.at.angular » platform-browser10 usages
- org.mvnpm.at.angular » forms5 usages
- org.mvnpm.at.angular » router4 usages
- org.mvnpm.at.angular » platform-browser-dynamic3 usages
- org.mvnpm.at.angular » animations2 usages
- org.fujion » fujion-angular-core2 usages
- org.fujion » fujion-angular-example1 usages
- org.fujion » fujion-testharness0 usages
- org.webjars.npm » github-com-ng-bootstrap-ng-bootstrap0 usages
- org.webjars.npm » ng2-datetime0 usages
- org.webjars.npm » ng2-datetime-picker0 usages
- org.webjars.npm » github-com-angular-material20 usages
- org.mvnpm » a2ui0 usages
- org.webjars.npm » angular2-fontawesome0 usages
- org.webjars.npm » github-com-mseemann-angular2-mdl0 usages
Computed from the dependency graph of build 20261124.0621 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.
Other ecosystems
Also affects npm (1 package) . See all on OSV
References
| Advisory | NVD CVE-2026-111753 | nvd.nist.gov |
| Package | angular/angular | github.com |
| Web | angular/angular advisory GHSA-jfgx-762w-99vr | github.com |
| Web | angular/angular issue #71294 | github.com |
| Web | angular/angular pull request #65683 | github.com |
| Web | angular/angular pull request #71295 | github.com |
| Web | angular/angular commit 0659d11 | github.com |
| Web | angular/angular commit 20474d3 | github.com |
| Web | angular/angular commit 933ce81 | github.com |
| Web | angular/angular release 21.0.3 | github.com |
| Web | angular/angular release v20.3.34 | github.com |
