{"id":"CVE-2026-111753","kind":"vulnerability","aliases":["CVE-2026-111753","GHSA-jfgx-762w-99vr"],"related":[],"title":"@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](https://github.com/angular/angular/security/advisories/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.\n\n### Technical Description\n\nTo 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.\n\nHowever, 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:\n* 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`.\n* Leading and trailing C0 control characters and spaces (`<= 0x20`) are stripped — e.g., `' //evil.example/x'`, `'\\0//evil.example/x'`, `'\\x1f//evil.example/x'`.\n* 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'`.\n\nBecause 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`).\n\nNote: Angular `21.0.3+` and `22.x` replaced the regular expression with a WHATWG `new URL(req.url, locationOrigin)` origin comparison in [#65683](https://github.com/angular/angular/pull/65683) and were already unaffected. However, the `20.3.x` LTS branch retained the regular expression until `20.3.34`.\n\n### Impact\n\nThe 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.\n\n### Attack Preconditions\n\n1. The victim's Angular application must have **XSRF protection enabled** (enabled by default in `HttpClient`).\n2. 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/api` or ` //attacker.example/api`).\n\n### Patches\n\nThe 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)`).\n\n* `21.0.3` (and all `22.x` releases)\n* `20.3.34`\n\n### Workarounds\n\nIf you cannot immediately upgrade to a patched version:\n* Validate and normalize outgoing request URLs using `new URL(url, window.location.origin)` and verify that `parsedUrl.origin === window.location.origin` before passing dynamic URLs to mutating `HttpClient` requests.\n* Avoid passing untrusted or user-controlled URLs to `HttpClient` mutating methods.","summary":"Angular's HttpClient XSRF interceptor uses a regex to skip absolute URLs, but browsers parse URLs with backslashes, tabs, newlines or leading control characters differently, so the X-XSRF-TOKEN header is sent to attacker-chosen cross-origin hosts. An attacker who can make the app send a POST, PUT, DELETE or PATCH to a crafted URL can capture the user's XSRF token and use it for CSRF against their session.","severity":"medium","cvss":null,"epss":null,"exploited":false,"exploited_at":null,"products":[{"name":"@angular/common","fixed":["21.0.3"],"affected":">= 21.0.0, < 21.0.3","ecosystem":"npm"},{"name":"@angular/common","fixed":["20.3.34"],"affected":">= 20.0.0, < 20.3.34","ecosystem":"npm"},{"name":"@angular/common","fixed":[],"affected":"<= 19.2.25","ecosystem":"npm"}],"ecosystems":["npm"],"tags":["angular","browser-apps","cwe-201","cwe-359","npm","package","spa"],"not_affected_if":["default-config-no-xsrf-needed","not-on-affected-versions","server-side-only","static-export"],"how_to_check":"Run `npm ls @angular/common` and check whether the resolved version is in the affected ranges: 21.0.0 to before 21.0.3, 20.0.0 to before 20.3.34, or 19.2.25 and below.\nSearch app code for HttpClient mutating calls whose URL comes from user input or config.","fix":"Upgrade @angular/common to 21.0.3 or later (21.x line, or 22.x), or 20.3.34 on the 20.x LTS line.\nUntil upgraded, validate dynamic URLs with new URL(url, window.location.origin) and require parsedUrl.origin to equal window.location.origin before mutating requests.","status":"open","published_at":"2026-10-20T20:37:57+00:00","first_seen_at":"2026-10-23T19:11:32+00:00","triaged_at":"2026-10-23T20:13:26+00:00","updated_at":"2026-10-23T20:13:26+00:00","category":"package","confidence":0.8,"triage":{"at":"2026-10-23T20:13:26Z","model":"claude-haiku-5-5","output":{"fix":"Upgrade @angular/common to 21.0.3 or later (21.x line, or 22.x), or 20.3.34 on the 20.x LTS line.\nUntil upgraded, validate dynamic URLs with new URL(url, window.location.origin) and require parsedUrl.origin to equal window.location.origin before mutating requests.","summary":"Angular's HttpClient XSRF interceptor uses a regex to skip absolute URLs, but browsers parse URLs with backslashes, tabs, newlines or leading control characters differently, so the X-XSRF-TOKEN header is sent to attacker-chosen cross-origin hosts. An attacker who can make the app send a POST, PUT, DELETE or PATCH to a crafted URL can capture the user's XSRF token and use it for CSRF against their session.","category":"package","who_cares":["angular","npm","browser-apps","spa"],"confidence":0.8,"analyst_note":"The advisory gives no patch for 19.x (fixed listed as ?); confirm whether 19.2.x receives a backport at https://github.com/advisories/GHSA-jfgx-762w-99vr.","how_to_check":"Run `npm ls @angular/common` and check whether the resolved version is in the affected ranges: 21.0.0 to before 21.0.3, 20.0.0 to before 20.3.34, or 19.2.25 and below.\nSearch app code for HttpClient mutating calls whose URL comes from user input or config.\nunknown for any other check.","needs_analyst":true,"not_affected_if":["default-config-no-xsrf-needed","static-export","server-side-only","not-on-affected-versions"],"severity_if_unknown":"unknown"},"cost_usd":0.000635,"input_tokens":3438,"output_tokens":583,"severity_before":"medium"},"analyst_status":null,"analyst_note":null,"search":"'-111753':21A,29A '-201':38B '-2025':17A,132C,182C '-2026':20A,28A '-359':40B '-66035':18A,133C,183C '/angular/angular/pull/65683)':370C '/angular/angular/security/advisories/ghsa-58c5-g7wp-6w37)':130C '/api':495C '/attacker.example/api':497C '/evil.example/x':258C,279C,281C,283C '/i':194C,314C '/x':254C,257C,262C,266C '/x''':306C '0':280C '0x20':275C '1':448C '2':464C '20.3':377C '20.3.34':386C,533C '21.0.3':349C,527C '22':351C,530C '58c5':125C '65683':367C '6w37':127C '762w':25A '99vr':26A 'abl':469C 'absolut':54B,190C,199C 'address':180C 'affect':400C 'allow':140C,402C 'alreadi':373C 'angular':10A,33B,44B,348C,392C,452C 'angular/common':1A,30A,31A,32A,135C 'anywher':296C 'app':36B,92B 'applic':453C,473C,514C 'ascii':284C 'attach':206C,325C 'attack':80B,87B,153C,404C,430C,439C,446C,466C 'attacker-chosen':79B 'attacker-control':152C 'attacker.example':494C 'attacker.example/api':493C 'authority/origin':244C 'avoid':568C 'backslash':61B,245C 'branch':380C 'browser':35B,57B,172C,214C,334C 'browser-app':34B 'built':395C 'built-in':394C 'bypass':391C 'c0':270C 'cannot':537C 'captur':105B,406C 'carriag':290C 'chang':478C 'charact':67B,272C,293C 'chosen':81B 'client':12A,138C 'compar':506C 'comparison':365C 'const':189C 'constructor':522C 'control':66B,154C,271C,490C,574C 'cor':426C 'craft':102B 'cross':83B,142C,156C,343C,434C 'cross-origin':82B,155C,342C 'cross-sit':141C,433C 'csrf':115B,438C 'current':516C 'custom':423C 'cve':16A,19A,27A,131C,181C 'cwe':37B,39B 'default':461C 'delet':97B,484C 'descript':178C 'detect':196C 'differ':68B 'discrep':8A,166C 'dispatch':337C 'domain':158C 'dynam':562C 'e.g':251C,278C,300C,481C 'enabl':458C,459C 'evil.example':253C,256C,261C,265C,305C,346C 'evil.example/x':252C,255C,260C,264C 'evil.example/x''':304C 'exploit':164C 'express':169C,188C,356C,384C 'fetch':220C 'fix':14A,121C 'forgeri':145C,437C 'forward':249C 'g7wp':126C 'ghsa':23A,124C 'ghsa-58c5-g7wp-6w37':123C 'ghsa-jfgx-762w-99vr':22A 'github.com':129C,369C 'github.com/angular/angular/pull/65683)':368C 'github.com/angular/angular/security/advisories/ghsa-58c5-g7wp-6w37)':128C 'header':75B,212C,331C,415C,424C 'host':85B,345C 'howev':213C,375C 'htt':303C 'http':11A,137C,229C,479C 'httpclient':46B,139C,463C,566C,577C 'https':193C,231C,259C,263C,313C 'immedi':538C 'impact':387C 'incomplet':13A,120C 'input':299C 'interceptor':48B 'introduc':185C 'issu':500C 'jfgx':24A 'lead':65B,267C 'leak':150C 'leakag':4A,390C 'locationorigin':363C,526C 'lts':379C 'make':90B,471C 'match':312C 'method':579C 'must':454C,467C 'mutat':565C,578C 'n':288C 'n/evil.example/x':302C 'new':360C,523C,551C 'newlin':63B,287C 'normal':239C,546C 'note':347C 'npm':41B 'obtain':428C 'origin':84B,157C,322C,344C,364C,511C,517C 'outgo':547C 'packag':42B 'pars':7A,58B,165C,504C 'parsedurl.origin':558C 'parser':176C,227C 'pass':218C,561C,569C 'patch':99B,485C,498C,542C 'perform':237C,432C 'permit':419C 'post':95B,482C 'precondit':447C 'prior':240C 'protect':398C,457C 'protocol':202C 'protocol-rel':201C 'put':96B,483C 'r':292C 'regex':51B,192C 'regular':168C,187C,355C,383C 'relat':203C,319C 'releas':532C 'remov':295C 'replac':353C 'req.url':362C,525C 'request':144C,160C,216C,339C,421C,436C,480C,508C,548C,567C 'resolv':215C,242C,335C,502C 'retain':381C 'return':291C 'same-origin':320C 'scheme':232C 'send':93B,474C 'sent':77B 'server':418C 'session':118B,445C 'sever':238C 'site':143C,435C 'skip':53B,198C 'slash':250C 'spa':43B 'space':274C 'standard':236C,520C 'state':477C 'state-chang':476C 'strip':277C 't/evil.example/x':301C 'tab':62B,285C 'technic':177C 'token':3A,74B,110B,147C,211C,330C,389C,414C 'trail':269C 'treat':247C,316C 'unaffect':374C 'untrust':570C 'upgrad':539C 'url':6A,55B,59B,103B,162C,175C,191C,204C,217C,226C,235C,309C,323C,361C,488C,509C,521C,524C,549C,552C,553C,563C,575C 'use':49B,112B,161C,223C,518C,550C 'user':107B,408C,443C,573C 'user-control':572C 'valid':410C,544C 'verifi':556C 'version':401C,543C 'via':5A,425C 'victim':442C,450C 'whatwg':174C,225C,234C,359C 'window.location.origin':554C,559C 'workaround':534C 'x':72B,209C,328C,352C,378C,412C,531C 'x-xsrf-token':71B,208C,327C,411C 'x1f':282C 'xmlhttprequest.open':222C 'xsrf':2A,47B,73B,109B,146C,210C,329C,397C,413C,456C 'xsrfinterceptorfn':184C,315C","nicknames":[],"mitigations":[],"who_affected":null,"tier":"C","verified":{},"analyst_revisit_at":null,"first_public_at":"2026-10-20T20:37:57+00:00","kev":null,"cvss_vector":null,"cvss_by":null,"poc_count":0,"sources":[{"source":"ghsa","external_id":"GHSA-jfgx-762w-99vr","url":"https://github.com/advisories/GHSA-jfgx-762w-99vr","severity":"medium","published_at":"2026-10-20T20:37:57+00:00","modified_at":"2026-10-20T20:37:58+00:00","first_seen_at":"2026-10-23T19:11:32+00:00","fetched_at":"2026-10-23T19:11:32+00:00","note":null}],"documents":[],"notice":"Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai"}