The vulnerability is an open redirect within the Feathers.js OAuth authentication mechanism, enabling account takeover. The root cause is the improper construction of a redirect URL using unvalidated user input. By analyzing the patch commit ee19a0ae9bc2ebf23b1fe598a1f7361981b65401, two key functions were identified.
The primary vulnerable function is OAuthStrategy.getRedirect in packages/authentication-oauth/src/strategy.ts. This function concatenated a user-supplied redirect parameter with a base URL without proper sanitization. The patch introduced a regular expression check to reject characters (@, //, \\) that can be used to manipulate the URL's authority, thereby fixing the open redirect.
A secondary function, OAuthService.create in packages/authentication-oauth/src/service.ts, is the entry point that first receives the malicious redirect parameter from the user and stores it in the session for later processing. An exploit would involve an attacker crafting a URL with a malicious redirect value (e.g., ?redirect=@attacker.com). When a victim follows this link, OAuthService.create processes the request, and OAuthStrategy.getRedirect later constructs a URL like https://legitimate.com@attacker.com#access_token=.... The browser sends the access token to the attacker's domain, leading to account takeover.