/

CVE-2026-29792

Severity:

CRITICAL RISK

(9.8)

Authentication Bypass in FeathersJS OAuth Service

CVE-2026-29792

Analyzed

Vulnerability type

Category:

Authentication Bypass

CWE:

CWE-287

Impact:

Credential-less Account Takeover / Authentication Bypass

Severity:

CRITICAL RISK

(9.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

FeathersJS versions 5.0.0 through 5.0.41 contain an authentication bypass in the OAuth callback handling, where a forged user profile in the query string can be treated as a valid OAuth result.

An unauthenticated attacker can send a crafted GET request directly to /oauth/:provider/callback, causing the service to mint a legitimate JWT for an existing user without ever interacting with the real OAuth provider.

Affected context

This issue affects FeathersJS applications that:

  • Use the built-in OAuth integration with routes like /oauth/:provider and /oauth/:provider/callback
  • Rely on OAuth providers (e.g., GitHub, Google) for user authentication
  • Have the OAuth callback configured in a way that the authentication logic can fall back to params.query when Grant's session/state payload is empty

The vulnerability manifests when the callback endpoint is reachable without prior stateful OAuth negotiation, allowing the query string to influence the authentication payload.

Exploit preconditions

  • Attack surface: Public-facing OAuth callback endpoint at /oauth/:provider/callback
  • Required access: No prior authentication; any remote attacker who can reach the endpoint
  • Trigger point: Direct GET request to the callback URL with a crafted profile (and related fields) in the query string
  • Why exploitation is possible: When the OAuth library (Grant) has no established session or state (because no authorization request was initiated), its response is empty. The FeathersJS OAuth service has a fallback chain that ultimately reads from params.query, treating untrusted query parameters as an authentication profile and using them to drive user lookup and JWT creation.

Why this happens

The vulnerability stems from treating unvalidated, unauthenticated query parameters as trusted identity data in the authentication process.

The OAuth service is designed with a fallback chain that, under error or empty-state conditions, pulls identity information from params.query. This means that when no valid OAuth session or provider response exists, the system still tries to continue the flow by consuming raw request data as an authentication payload. That design violates the core assumption of OAuth: that user identity and profile data must originate from a verified provider response tied to a prior authorization step.

This maps to CWE-287: Improper Authentication, because the system grants authenticated status and issues JWTs without reliably verifying that the caller completed a legitimate OAuth flow or that the profile was issued by the OAuth provider.

Potential impact

  • An attacker may obtain a valid JWT for an existing user account without knowing any credentials.
  • An attacker could impersonate privileged users if they can guess or influence identifiers used in the entity lookup (e.g., email, provider ID).
  • Attackers can access APIs and protected resources as the compromised user, including reading or modifying data within that user's authorization scope.
  • If administrative or high-privilege accounts are targeted, the attacker could gain effective full control over the application's data and configuration.
  • Stolen or forged JWTs could be reused to maintain long-term unauthorized access until tokens expire or are revoked.

General mitigation guidance

Effective mitigation focuses on ensuring that authentication decisions are based solely on trusted OAuth provider responses and verified state, never on untrusted request parameters:

  • Require a valid, non-empty response from the OAuth provider (or from Grant) before constructing any authentication payload; if the provider response is missing, fail closed instead of falling back to request data.
  • Remove or strictly constrain fallback chains that read from params.query, req.query, or similar untrusted sources during authentication processing.
  • Enforce strong state and session binding: callbacks must verify that they are tied to a prior authorization request (e.g., via state parameter and session identifiers).
  • Validate and normalize identity attributes (such as provider ID, email, username) exclusively from provider-signed data, never from raw client input.
  • Apply least-privilege account mapping: when in doubt, deny authentication or map to a minimal-privilege account rather than granting access based on ambiguous or incomplete profile information.
  • Use configuration patterns that isolate OAuth callback logic from general-purpose request handlers to reduce the chance of mixing untrusted query data with authenticated identity.

How teams detect issues like this

Detection efforts can focus on both code-level analysis and runtime behavior:

  • Static analysis and code review:
  • Look for authentication flows that read from params.query, req.query, or similar request data when assembling user profiles or authentication payloads.
  • Flag any logic paths where JWTs or session tokens are minted if the OAuth provider response is missing, empty, or not explicitly verified.
  • Review fallback chains around OAuth and identity handling for patterns like "if provider response is missing, use query/body parameters instead."
  • Policy-based checks and tooling:
  • Configure linters or custom static analysis rules to detect direct use of request query parameters in authentication or identity mapping code.
  • Use automated security review tools to scan for improper authentication patterns related to OAuth callback handlers.
  • Runtime monitoring:
  • Log all calls to OAuth callback endpoints, including whether a valid prior session/state was present and whether provider responses were consumed.
  • Alert on suspicious patterns, such as callbacks with no associated authorization request, or excessive callback hits with unusual query parameters.

Sources

SourceLink
github.comgithub.com/feathersjs/feathers/security/advisories/GHSA-wg9x-qfgw-pxhj

Frequently asked

questions

The issue is broadly exploitable wherever the affected FeathersJS OAuth callback endpoint is exposed to the internet and configured in the vulnerable manner. Any remote attacker who can reach /oauth/:provider/callback can attempt to forge a query string profile and obtain a valid JWT, without needing a valid user session or contact with the real OAuth provider.

The attacker does not need credentials, but successful exploitation typically requires them to forge a profile that matches an existing user in the application (for example, by guessing an email or provider-specific user ID). Once a matching entity is found, the system may issue a JWT for that account.

The most robust fix is to ensure that authentication is never completed unless there is a verified OAuth provider response that is strongly bound to a prior authorization request (via state/session). Any absence of provider data, invalid state, or missing session should immediately terminate the flow with an error. Additionally, all fallbacks that read user identity from params.query or other untrusted inputs during authentication should be removed or tightly constrained.

Design authentication flows with a strict trust boundary: treat only provider-signed, session-bound responses as legitimate identity data. Enforce "fail closed" behavior when expected authentication artifacts (session, state, provider response) are missing. Incorporate security reviews for OAuth and identity logic, use static analysis or linting to detect use of untrusted request data in authentication, and document clear patterns for handling error and edge cases without relaxing authentication guarantees.

Find out what's already
exploitable in your codebase.