Skip to content

Social OAuth authorization code (rtCode) transmitted as URL query parameter #375

Open

Description

@anshul23102

Summary

The social authentication flow passes the OAuth authorization code as a query string parameter (?rtCode=...) rather than in the POST body. Query parameters appear in:

  • Server access logs
  • Browser history
  • Referrer headers sent to third-party scripts on the destination page
  • Proxies and CDN logs

This can expose short-lived but sensitive OAuth codes before they are exchanged for tokens.

Location

apps/public-api/src/routes/userAuth.js and the corresponding controller in userAuth.controller.js.

Impact

  • An attacker who obtains the rtCode before it is consumed can exchange it for an access token and hijack the account.
  • OAuth 2.0 best-practice (RFC 6749 Section 10.5) explicitly warns against transmitting authorization codes in URLs.

Suggested Fix

Accept rtCode exclusively via a POST request body:

// Instead of GET /auth/social?rtCode=...
// Use POST /auth/social with body { rtCode: '...' }
router.post('/social', asyncHandler(socialAuthController));

Activity

  1. anshul23102 commented on Jul 31, 2026

    @anshul23102
    ContributorAuthor

    @geturbackend Could you please assign this issue to me? I'd like to work on it under GSSoC '26.
    /assign
    /claim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions