Repository navigation
Commit 787d1c9
authored
🔧 chore(test): add opt-in Atheris fuzz harness (#3246)
OpenSSF Scorecard's Fuzzing check scores 0 for this repo. Its detection
only checks for `import atheris` (or a ClusterFuzzLite/OSS-Fuzz setup)
anywhere in the tree, so this adds a real target rather than a token
import that would move the number without doing anything.
`NushellActivator.quote` and `PowerShellActivator.quote` are hand-rolled
escaping schemes over arbitrary strings pulled from paths and prompts:
Nushell counts the longest run of `#` and wraps in one more than that,
PowerShell doubles single quotes. Both take untrusted-shaped input, and
a broken escape is a correctness bug worth catching, not just a lint
target. Each harness in `tasks/fuzz_*.py` recomputes the expected output
from the escaping rule on its own and asserts equality against the real
function, so it fails on any scheme violation, not only on a crash. I
ran both assertions against 200k+ randomized adversarial strings
(embedded quotes, `#` runs, control characters, Unicode) against the
real functions before wiring them into Atheris.
Atheris only ships prebuilt wheels for Linux + CPython 3.12-3.14 - it
doesn't build on this machine at all, since Apple Clang doesn't ship
libFuzzer. It lives in its own `fuzz` dependency group with a marker
matching that exact combination, so nothing else ever tries to install
it or falls into a doomed source build. `tox -e fuzz` is opt-in and
outside `env_list`, so no existing environment or CI job changes.1 parent a30f995 commit 787d1c9
5 files changed
Lines changed: 80 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 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 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 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 | + | |
| 26 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
156 | | - | |
| 156 | + | |
157 | 157 | | |
158 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
159 | 163 | | |
160 | 164 | | |
161 | 165 | | |
| |||
0 commit comments