Skip to content

Private/waabusea/switchgh token#8602

Open
WaelAbuSeada wants to merge 3 commits into
mainfrom
private/waabusea/switchghToken
Open

Private/waabusea/switchgh token#8602
WaelAbuSeada wants to merge 3 commits into
mainfrom
private/waabusea/switchghToken

Conversation

@WaelAbuSeada

@WaelAbuSeada WaelAbuSeada commented Jun 12, 2026

Copy link
Copy Markdown
Member

Switch gh copilot CLI to built-in auth

Fixes AB#638509

@WaelAbuSeada WaelAbuSeada requested review from a team as code owners June 12, 2026 21:59
@github-actions github-actions Bot added the Build: Automation Workflows and other setup in .github folder label Jun 12, 2026
@github-actions github-actions Bot modified the milestone: Version 29.0 Jun 12, 2026
$val = [System.Environment]::GetEnvironmentVariable($key)
if ($val) { $cleanEnv[$key] = $val }
}
$cleanEnv['GH_TOKEN'] = $CopilotToken

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$\textbf{🟡\ Medium\ Severity\ —\ Security} \quad \color{gray}{\texttt{\small Iteration\ 1}}$

Subprocess receives over-privileged token

The GITHUB_TOKEN passed as GH_TOKEN to the Copilot CLI subprocess carries pull-requests: write and issues: write permissions that the CLI needs only copilot-requests: write for. If the CLI process were compromised or behaved unexpectedly, it could modify PR/issue data using those extra scopes.

Recommendation:

  • This is an inherent limitation of the GitHub Actions token model (sub-tokens with reduced scopes cannot be minted), but the risk should be acknowledged in the code comment. Ensure the Copilot CLI version is pinned to a verified release to reduce the blast radius of a supply-chain compromise.
Suggested change
$cleanEnv['GH_TOKEN'] = $CopilotToken
# Pass only a safe allowlist of env vars to the subprocess.
# NOTE: GH_TOKEN carries full workflow permissions (pull-requests: write,
# issues: write, copilot-requests: write). GitHub Actions cannot mint a
# narrower sub-token, so pin the Copilot CLI version to a verified release.
$cleanEnv['GH_TOKEN'] = $GithubToken

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Build: Automation Workflows and other setup in .github folder

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant