-
Notifications
You must be signed in to change notification settings - Fork 17
fix(security): use temp file for GitHub token to avoid process listing exposure #3301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
b7e6c3a
fix(security): use temp file for GitHub token to avoid process listin…
louisgv 76811d7
fix(security): pass GitHub token via heredoc instead of local temp file
louisgv 8465ad4
fix(security): upload token to remote via SCP instead of heredoc
louisgv ad57896
Merge branch 'main' into fix/issue-3300
louisgv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔴 Token upload failure throws unhandled exception, crashing the provisioning flow
In the old code, the GitHub token was embedded directly in
ghCmd, so any failure was caught by theasyncTryCatchIfat line 290 and logged as a non-fatal warning. In the new code, a failed SCP upload at line 281 causesthrow uploadResult.errorat line 284, which propagates out ofofferGithubAuthbefore reaching the graceful error handling at line 291. The caller atpackages/cli/src/shared/orchestrate.ts:601doesawait offerGithubAuth(cloud.runner, ...)with no try/catch, so a transient SCP failure during token upload will crash the entire VM provisioning flow — turning what was explicitly a non-fatal step ("GitHub CLI setup failed (non-fatal, continuing)") into a fatal one.Prompt for agents
Was this helpful? React with 👍 or 👎 to provide feedback.