Skip to content

Strip OIDC token request env vars from Claude session#1011

Open
chyipin wants to merge 1 commit intoanthropics:mainfrom
chyipin:strip-oidc-env-vars-from-claude-session
Open

Strip OIDC token request env vars from Claude session#1011
chyipin wants to merge 1 commit intoanthropics:mainfrom
chyipin:strip-oidc-env-vars-from-claude-session

Conversation

@chyipin
Copy link

@chyipin chyipin commented Mar 4, 2026

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 PR 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.

Changes

  • Strip ACTIONS_ID_TOKEN_REQUEST_URL and ACTIONS_ID_TOKEN_REQUEST_TOKEN in base-action/src/parse-sdk-options.ts
  • Add test coverage in base-action/test/parse-sdk-options.test.ts

Fixes #1010

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
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.

Claude session has access to OIDC token request environment variables, allowing it to mint new tokens

1 participant