Strip OIDC token request env vars from Claude session#1011
Open
chyipin wants to merge 1 commit intoanthropics:mainfrom
Open
Strip OIDC token request env vars from Claude session#1011chyipin wants to merge 1 commit intoanthropics:mainfrom
chyipin wants to merge 1 commit intoanthropics:mainfrom
Conversation
When id-token: write permission is enabled, ACTIONS_ID_TOKEN_REQUEST_URL and ACTIONS_ID_TOKEN_REQUEST_TOKEN are passed to the Claude session via the process.env spread in parseSdkOptions(). This allows Claude to mint new OIDC tokens, which is an unintended capability. This commit deletes these two variables from the env object before passing it to the Claude SDK. The OIDC flow in token.ts reads directly from process.env and runs before parseSdkOptions(), so it is unaffected. Fixes anthropics#1010
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.
When
id-token: writepermission is enabled,ACTIONS_ID_TOKEN_REQUEST_URLandACTIONS_ID_TOKEN_REQUEST_TOKENare passed to the Claude session via theprocess.envspread inparseSdkOptions(). This allows Claude to mint new OIDC tokens, which is an unintended capability.This PR deletes these two variables from the env object before passing it to the Claude SDK. The OIDC flow in
token.tsreads directly fromprocess.envand runs beforeparseSdkOptions(), so it is unaffected.Changes
ACTIONS_ID_TOKEN_REQUEST_URLandACTIONS_ID_TOKEN_REQUEST_TOKENinbase-action/src/parse-sdk-options.tsbase-action/test/parse-sdk-options.test.tsFixes #1010