Repository navigation
oauth-token.sh: don't tee the OAuth token to stderr - #421
Merged
Merged
Conversation
tend-agent
approved these changes
May 11, 2026
script(1) tees its typescript to both \$TMPFILE and its own stdout. The previous code redirected that stdout to stderr so the user could watch the OAuth flow — but when this wrapper runs under Claude Code's Bash tool, stderr is captured into the conversation transcript, persisting the freshly-minted long-lived sk-ant-oat01-… token in plain text. Send script(1)'s stdout to /dev/null. The typescript still lands in \$TMPFILE — that's the only copy — and the existing grep-based extraction is unchanged. Point users at the file if their browser doesn't open, and stop dumping the raw file to stderr on extraction failure (preserve it for inspection instead). Co-authored-by: Claude <[email protected]>
max-sixty
force-pushed
the
oauth-token-redact
branch
from
May 11, 2026 09:08
35823e3 to
36b1d74
Compare
tend-agent
approved these changes
May 11, 2026
Merged
max-sixty
added a commit
that referenced
this pull request
May 13, 2026
Bumps generator to 0.0.18. ## Headline Expose the `__TEND_DELETE__` sentinel so TOML overrides can reach RFC 7396 delete-key semantics — useful for dropping a generator-injected key (e.g. `on.schedule` from a scheduled workflow) while keeping the rest. Closes #439, thanks @jrdncstr for reporting. ## Other changes since 0.0.17 - fix(action): sum usage and num_turns across all result entries (#437) - diag(action): upload execution-output.json (#408) - fix(mention): run setup before PR checkout so stale PRs don't drop mentions (#391) - fix(running-in-ci): base skill worktree on default branch (#401) - install-tend: fix oauth-token.sh returning an invalid token on macOS (#398) - oauth-token.sh: don't tee the OAuth token to stderr (#421) - Skill hardening: bang-escape guidance, review-reviewers corruption scans, dedup rules, $GITHUB_RUN_ID requirement 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <[email protected]>
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.
oauth-token.shrunsclaude setup-tokenunderscript(1)so the Ink TUI renders, then>&2piped script(1)'s typescript copy to stderr so the user could watch the OAuth flow. When this wrapper is invoked from Claude Code's Bash tool, stderr is captured into the conversation transcript — leaking the freshly-minted long-livedsk-ant-oat01-…token in plain text.script(1)already tees the typescript to$TMPFILE. Send its tee'd stdout to/dev/nullinstead of stderr. The token never reaches a captured stream; the existing grep-based extraction reads from$TMPFILEunchanged; theTOKEN=$(./oauth-token.sh)calling contract is identical.Cost: the user no longer sees the live TUI on stderr. Mitigations: stderr still shows the "Running claude setup-token…" message, plus a hint pointing at
$TMPFILEif the browser doesn't open and they need the OAuth URL. The extraction-failure path also stops dumping the raw file to stderr (a potential leak vector); it preserves the file on disk for inspection instead.Test plan
bash -nsyntax check passespre-commit run --all-filespasses./oauth-token.sh 2>/tmp/stderr.log >/tmp/token; grep -c 'oat01-[A-Za-z0-9]' /tmp/stderr.logshould print0, and/tmp/tokenshould contain a working ~108-char token.