Repository navigation
fix(security): the guard refuses the ssh keys and SHELL - #2678
Merged
Merged
Conversation
Plan the change for #2633 as an OpenSpec change. Add the failing tests. - A caller override of an `SSH_` key or of `SHELL` must raise `SecurityError`. - An isolated child must get none of these keys from the environment. - `DISPLAY`, `HOME`, `TMPDIR` and similar keys must still reach the child.
The guard refused no key of OpenSSH. A caller override of `SSH_ASKPASS` made `ssh`, `ssh-add`, `ssh-keygen` and git run a program of the caller. The keys `SSH_SK_PROVIDER`, `SSH_SK_HELPER` and `SSH_PKCS11_HELPER` did the same with a library or a helper. `SHELL` names the program that `ssh` starts to run a `ProxyCommand`. - Add the pattern `SSH_*` and the key `SHELL` to `CONST_CODE_LOADING_ENV_PATTERNS`, in a block of their own. Two helper keys are in no manual page, so the guard refuses each `SSH_` key until a person reviews it. - Remove `SHELL` from `DEFAULT_ALLOWED_ENV_VARS`. No refused key then reaches an isolated child from the environment.
`ARCHITECTURE.md` gets a bullet for the ssh child environment. The purpose of the `subprocess-environment` spec names ssh with the other programs.
The docstring had one sentence of 42 words. The limit is 25.
- Keep each sentence and each paragraph of the ssh text inside the STE limits. - Record that an isolated child has no `SHELL`. `claude install` exits 0 without it. - State the open `HOME` case: git reads `$HOME/.gitconfig` (#2483). - Name #2674 for the keys that write a file, and the open `LD_` keys.
…t guard Archive 2633-refuse-ssh-code-env-keys and merge its requirements into the `subprocess-environment` spec.
Owner
Author
|
Test results for the head of this branch.
Fail-to-pass, with |
dan-petty
marked this pull request as ready for review
October 29, 2026 15:59
dan-petty-release Bot
added a commit
that referenced
this pull request
Oct 29, 2026
🤖 I have created a release *beep* *boop* --- ## [0.16.7](v0.16.6...v0.16.7) (2026-10-29) ### Bug Fixes * **security:** the guard refuses the ssh keys and SHELL ([#2678](#2678)) ([7f85930](7f85930)), closes [#2633](#2633) --- 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.
The environment guard refuses each
SSH_key andSHELLas a caller override of a child environment.Why:
build_subprocess_envaccepted keys that make an ssh child run a program that its caller chose.SSH_ASKPASSmadessh,ssh-add,ssh-keygenand git start the program of the caller.SSH_SK_PROVIDER,SSH_SK_HELPERandSSH_PKCS11_HELPERload a library or start a helper.SHELLnames the program thatsshstarts for aProxyCommand.What changes:
CONST_CODE_LOADING_ENV_PATTERNSholdsSSH_*andSHELL, in a block of their own. Two helper keys are in no manual page, so the guard refuses eachSSH_key until a person reviews it.DEFAULT_ALLOWED_ENV_VARSno longer holdsSHELL. Thus no refused key reaches an isolated child from the environment.SSH_AUTH_SOCKis refused, because a caller socket gets the private key fromssh-add. No caller sets anSSH_key, so the guard keeps no exception.DISPLAY,HOME,XAUTHORITY,TMPDIRandLANGstay accepted. The design records each accepted key with its reason.ARCHITECTURE.mdand thesubprocess-environmentspec describe the refusal.Follow-up issues: #2503 (library keys), #2672 (keys of
ghandkubectl) and #2674 (keys that write a file, and the openLD_keys).Change: openspec/changes/archive/2026-10-29-2633-refuse-ssh-code-env-keys/
Closes #2633