Skip to content

Support ChatGPT OAuth device-code login flow through proxy - #24

Merged
bbrowning merged 3 commits into
mainfrom
chatgpt-auth-fixes
Jul 17, 2026
Merged

Support ChatGPT OAuth device-code login flow through proxy#24
bbrowning merged 3 commits into
mainfrom
chatgpt-auth-fixes

Conversation

@bbrowning

Copy link
Copy Markdown
Owner
  • Enable ChatGPTInjector to bootstrap from just a state file (PAUDE_PROXY_CHATGPT_AUTH_STATE_FILE), without requiring a pre-seeded auth file. The token vendor forwards device-code and authorization-code
    exchanges to auth.openai.com, persists the resulting tokens, and returns synthetic tokens to the agent.
  • Sanitize OAuth parameters before forwarding login exchanges — allowlist fields per grant type, enforce the proxy's client_id, and reject unknown grant types to prevent the agent from manipulating token
    permissions.

bbrowning and others added 3 commits July 17, 2026 00:10
Make ChatGPTInjector work with only PAUDE_PROXY_CHATGPT_AUTH_STATE_FILE
(no CHATGPT_AUTH_FILE required). The injector activates and enables the
TokenVendor even before login completes, returning 502 until tokens
arrive. On login-completing token exchanges (non-refresh grant types),
the TokenVendor forwards to the real auth endpoint, persists real tokens
via AcceptLoginTokens, and returns synthetic tokens to the agent.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…penai.com

The handleLoginExchange method previously forwarded the agent's raw POST body
verbatim to the real auth endpoint. Since the agent is the threat actor, this
allowed injection of dangerous OAuth parameters (audience, scope, resource)
that could modify resulting token permissions. Now we allowlist parameters
per grant type, enforce the canonical client_id, and reject unknown grant types.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@bbrowning
bbrowning merged commit dcfc778 into main Jul 17, 2026
6 checks passed
@bbrowning
bbrowning deleted the chatgpt-auth-fixes branch July 17, 2026 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant