Support ChatGPT OAuth device-code login flow through proxy - #24
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
exchanges to auth.openai.com, persists the resulting tokens, and returns synthetic tokens to the agent.
permissions.