GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Concurrent OAuth2 callbacks can use each other's provider · Issue #10860 · pgadmin-org/pgadmin4

Concurrent OAuth2 callbacks can use each other's provider #10860

New issue
Copy link
New issue
Copy link
Backlog
Backlog
Concurrent OAuth2 callbacks can use each other's provider#10860
Copy link

Description

@draoncc
draoncc
opened on Nov 26, 2026
Issue body actions

Please note that security bugs or issues should be reported to [email protected].

Describe the bug

oauth_authorize() sets the provider from the session onto the process-wide OAuth2 auth source (oauth2_source.oauth2_current_client = oauth2_client, web/pgadmin/authenticate/oauth2.py:179 on master). login(), get_user_profile() and their helpers then read self.oauth2_current_client without a lock (master lines 458, 471, 535, 624, 678). When two users' callbacks for different providers overlap, one callback can finish with the other's provider: its config, client, claims, userinfo endpoint and logout URL.

To Reproduce

  1. Server mode, two OAUTH2_CONFIG providers, A and B.
  2. User 1 logs in with A, user 2 with B, with both /oauth2/authorize callbacks in flight at the same time (for example, a slow userinfo endpoint on A).
  3. User 1's callback reads provider B partway through.

Expected behavior

Each callback uses only the provider stored in its own session.

Error message

Depends on where the switch happens. Usually the token exchange or userinfo call fails against the wrong provider. Otherwise the session gets the other provider's logout URL or claims.

Desktop (please complete the following information):

  • OS: any
  • pgAdmin version: master (9.19 dev, 2fa9263)
  • Mode: Server
  • Browser (if running in server mode): any
  • Package type: any

Additional context

Found reviewing #10830, which adds one more read of the attribute (session['oauth2_provider'], used by Sign in again). Fix: carry the provider as a local value from the callback through login() and its helpers instead of setting it on the shared instance. Capturing it only in get_user_profile() is not enough.

Activity

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

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.