Commit c2a92c3
authored
fix(builtins): filter internal markers from Python os.environ (#1021)
## Summary
- Filter internal variable markers (`_READONLY_*`, `_NAMEREF_*`,
`_INTEGER_*`, etc.) and `SHOPT_*` from the environment passed to Python
builtin
- Prevents information disclosure of internal shell state via
`os.environ`
Closes #999
## Test plan
- [x] New spec tests: `env_leak.test.sh` with 3 cases (readonly marker
hidden, user vars visible, SHOPT filtered)
- [x] `cargo test --all-features` passes
- [x] `cargo clippy -- -D warnings` clean1 parent ae4e0e4 commit c2a92c3
File tree
2 files changed
+35
-1
lines changed- crates/bashkit
- src/builtins
- tests/spec_cases/python
2 files changed
+35
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
316 | 316 | | |
317 | 317 | | |
318 | 318 | | |
| 319 | + | |
| 320 | + | |
319 | 321 | | |
320 | | - | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
321 | 330 | | |
322 | 331 | | |
323 | 332 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
0 commit comments