Commit e766c21
committed
test: pin the array-form behaviour with a real binary at a hostile path
The existing injection test returns false post-fix via Errno::ENOENT rather
than by demonstrating that the named file is executed verbatim, so it would
also pass under a character-allowlist remediation instead of the array form.
Putting the metacharacters in the directory name of a real, executable
script asserts both halves at once: the injected command never runs, and
the legitimate binary at that hostile-looking path still verifies. This is
the same shape as the reproduction that exercises the vulnerability through
$HOME. Verified to fail before the fix on the injection assertion.1 parent ab48704 commit e766c21
1 file changed
Lines changed: 25 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
175 | 200 | | |
176 | 201 | | |
177 | 202 | | |
| |||
0 commit comments