You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Close Env, Launcher, and Xargs Cluster Gaps in the Write Guard #3347
The write guard has three environment and launcher gaps that let a mutation or foreign-repository write pass. Copilot raised them on the round-34 promotion pull request. Each is a gap in how the guard reads a command, none is a regression, since the same commands pass the guard on main.
set -a, then GIT_DIR=<primary>/.git, then a hard reset: _exported_states knows export, declare -x, and typeset -x, not the shell-wide set -a, nor local -x scopes. The primary-checkout rule can allow the reset.
uv run env GH_REPO=<other-owner>/<repo> gh pr comment 5 --body x: after an unknown launcher the _launcher_prefix call passes env_args=False, so the assignment env passes is dropped and the shell's own GH_REPO is used. Run with GH_REPO set to a same-owner repository, the guard exits 0 with no deny, where the same command without uv run is denied.
printf 'git config remote.origin.mirror true' | xargs -0I{} bash -c '{}': _xargs_replace_string does not parse the -0I{} option cluster, so {} is read as a fixed body and the config change is missed.
Fix by modelling set -a, reading env assignments after an unknown launcher as real assignments, and parsing option clusters for the replacement string. Each needs a test that fails with the fix reverted.
Activity
Close Export, Xargs, Env, and Launcher Allow Gaps in the Write Guard (#…