Repository navigation
fix(security): refuse the gh and kubectl keys that run a program - #2732
Merged
Merged
Conversation
Owner
Author
|
Targeted tests on the rebased branch (test_subprocess_env_gh_kubectl.py, test_subprocess_env_boundary.py, test_openspec_gate.py): 583 passed. Fail-to-pass, |
dan-petty
marked this pull request as ready for review
October 30, 2026 01:31
dan-petty
pushed a commit
that referenced
this pull request
Oct 30, 2026
🤖 I have created a release *beep* *boop* --- ## [0.21.4](v0.21.3...v0.21.4) (2026-10-30) ### Bug Fixes * **ai:** name each prewarm server by host and port ([#2737](#2737)) ([2e2e4fa](2e2e4fa)), closes [#2676](#2676) * **ai:** the mcp benchmark tool takes no file path ([#2738](#2738)) ([5d5da15](5d5da15)), closes [#2704](#2704) * **config:** redact a removed credential in the config copies ([#2734](#2734)) ([f663344](f663344)), closes [#2645](#2645) * **rag:** name the Qdrant server by host and port ([#2733](#2733)) ([39aca9d](39aca9d)), closes [#2709](#2709) * **roadmap:** tick turn and kept diff for implement steps ([#2744](#2744)) ([890d2a6](890d2a6)), closes [#2721](#2721) * **security:** refuse the gh and kubectl keys that run a program ([#2732](#2732)) ([ad0bdf1](ad0bdf1)), closes [#2672](#2672) * **security:** refuse the keys that make a child write a file ([#2746](#2746)) ([1cd187e](1cd187e)), closes [#2674](#2674) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
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.
build_subprocess_envnow refuses a caller override of the keys that makeghorkubectlrun a program that the caller names:GH_BROWSER,BROWSER,GH_EDITOR,GH_PAGER,GH_PATH,KUBE_EDITORandKUBECTL_EXTERNAL_DIFF. Each raises the usualSecurityError, with isolation on and off. An isolated child gets none of them from the environment.Why: probes with gh 2.103.3 and kubectl v1.37.1 (temporary HOME, marker program, loopback only) ran the marker for each key.
GH_PATHworks in two steps:gh auth setup-gitwrites it as the git credential helper, and git then starts it. #2633 left these keys open because no probe of them had run.GH_CONFIG_DIR,KUBECONFIGandXDG_DATA_HOMEstay accepted. Callers set them on purpose and name a file that they control, as forHOMEandXDG_CONFIG_HOMEin #2483. The design andARCHITECTURE.mdrecord the risk: a gh alias or an exec credential plug-in in such a file starts a program.The seven names sit in a block of their own in
CONST_CODE_LOADING_ENV_PATTERNS. The Purpose of thesubprocess-environmentspec names gh and kubectl.Change: openspec/changes/archive/2026-10-30-2672-refuse-gh-kubectl-code-env-keys/
Closes #2672