Repository navigation
Commit 63f4acb
fix(exec): leave safe builtins unrewritten in enforced mode (#119351)
Enforced-mode command rendering resolved every executable to an absolute
path, including POSIX shell builtins (cd, :, true, false, pwd, test).
Builtins are executed by the shell itself, not via a filesystem binary,
so rewriting cd -> /usr/bin/cd is semantically wrong and adds no
PATH-shadowing protection (the whole point of enforced-mode resolution
for real external executables). shouldRewriteCandidate now returns
satisfiedBy !== "safeBuiltins" in enforced mode, leaving real external
executables pinned to their resolved absolute path.
Adds a regression test locking that enforced mode renders cd . as-is.
Co-authored-by: Peter Steinberger <[email protected]>1 parent 9bfe292 commit 63f4acb
2 files changed
Lines changed: 23 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
160 | 179 | | |
161 | 180 | | |
162 | 181 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
134 | 137 | | |
135 | 138 | | |
136 | 139 | | |
| |||
0 commit comments