Repository navigation
Workflow python fuzz
What it does. Runs every Atheris fuzz target a repository keeps under fuzz/ for a
fixed time per target, fails the job on a crash and uploads the crashing input. Holds no token.
Why it exists. OpenSSF Scorecard's Fuzzing check credits a Python repository for exactly one thing: an import atheris in a
*.py file in the tree (or OSS-Fuzz, ClusterFuzzLite, OneFuzz). Hypothesis does not count. This workflow makes that credit
honest: the targets actually run, and a crash is a red job. The first rollout (v1.10.0, 2026-10-04) across five repositories
found real defects (parsers that mishandled a bare carriage return, a null YAML key, wrong-shape JSON, an epoch
that hung a C routine), each fixed with a failing test first.
A file under fuzz-dir matching target-glob (default fuzz_*.py, searched recursively), run as
python <target> -max_total_time=<seconds> -max_len=<max-len> -artifact_prefix=<dir>/ -print_final_stats=1. It must:
-
import atherisand wrap the imports of the code under test inatheris.instrument_imports(), or it fuzzes blind; - define
def TestOneInput(data: bytes) -> None, drawing typed values fromatheris.FuzzedDataProvider(data); - call
atheris.Setup(sys.argv, TestOneInput)thenatheris.Fuzz()underif __name__ == "__main__":; - raise only on a real bug. An error the code documents (a parser rejecting bad input) is caught inside the target.
import sys
import atheris
with atheris.instrument_imports():
from my_pkg.parser import ParseError, parse
def TestOneInput(data: bytes) -> None:
text = atheris.FuzzedDataProvider(data).ConsumeUnicodeNoSurrogates(1024)
try:
parse(text)
except ParseError:
pass # documented rejection, not a bug
if __name__ == "__main__":
atheris.Setup(sys.argv, TestOneInput)
atheris.Fuzz()-
A missing
fuzz/directory, or one with no match, is a failure, not a skip. A caller that opts in without targets is wrong, and a silent pass would be the thing Scorecard was trying not to credit. - Every target runs even when an earlier one failed; the job fails if any did. A crash leaves
crash-*(alsoleak-*,timeout-*,oom-*) files, uploaded asfuzz-findingsfor 30 days. Reproduce withpython fuzz/fuzz_x.py crash-<sha>. -
A hang fails the step too, and leaves its input. libFuzzer is run with
-timeout, set bytimeout-per-input(25 seconds by default), so an input that never returns is reported as a timeout, fails the target and is saved as atimeout-*file infuzz-findings. The first hang found (a TLE whose epoch made an SGP4 C routine never return) had surfaced only as the outer per-target backstop killing the process, with no artifact (issue #82). The failure message tells you to look fortimeout-*first for a hang andcrash-*for a crash. The backstop still exists, for a target that hangs libFuzzer itself. - Atheris is installed from one pinned version under
--require-hasheswith--only-binary, so nothing is built on the runner. It publishes x86_64 manylinux wheels for CPython 3.12 to 3.14 only, so the default Python is3.14andrunnermust be x86_64 Linux. A test fails when the workflow's pin andrequirements-dev.indisagree. - Add the job to the caller's
CI greenneeds:(or run it on a schedule) so a crash cannot merge unseen. The Hammunition suite's callers run it for 30 seconds on a pull request and 600 seconds weekly.
jobs:
fuzz:
uses: ChiefGyk3D/git-your-ship-together/.github/workflows/python-fuzz.yml@<sha> # vX.Y.Z
permissions:
contents: read
with:
seconds-per-target: 60
install-command: pip install -e ".[parse]" # only when the default is not enoughInputs (13), read from python-fuzz.yml:
| Input | Type | Default | Meaning |
|---|---|---|---|
python-version |
string | 3.14 |
Python for the job. Atheris 3.1.0 has wheels for CPython 3.12, 3.13 and 3.14 (x86_64 only); 3.14 is the newest. |
fuzz-dir |
string | fuzz |
Directory searched, recursively, for fuzz targets. A missing directory fails the job. |
target-glob |
string | fuzz_*.py |
Filename pattern (find -name) of a fuzz target under fuzz-dir. No match fails the job. |
seconds-per-target |
number | 60 |
Wall-clock seconds each target runs (libFuzzer's -max_total_time; a fraction is truncated). |
timeout-per-input |
number | 25 |
Seconds libFuzzer allows one input before reporting a timeout (a fraction is truncated). |
max-len |
number | 4096 |
Longest input libFuzzer generates, in bytes (-max_len). |
install-command |
string | pip install -e . |
Shell that installs the project under test, run before Atheris is installed. Callers that need extras override it, e.g. pip install -e ".[parse]". |
runner |
string | ubuntu-24.04 |
Runner label. Must be x86_64 Linux; Atheris publishes no aarch64 wheel and no sdist. |
egress-policy |
string | audit |
harden-runner egress policy - audit logs outbound connections, block allows only allowed-endpoints and extra-allowed-endpoints. Jobs that hold no secret follow egress-policy-secretless instead (EX-0001). |
egress-policy-secretless |
string | block |
harden-runner egress policy for the jobs that hold no stored secret, no OIDC token and no write-scoped or publish-capable token (read-only contents, a SARIF upload at most), and whose output no privileged job consumes - exactly audit or block. Defaults to block since security exception EX-0001 (GitHub-hosted runners in westus2 broke harden-runner block) was closed on 2026-11-02 after harden-runner v2.22.3 passed on westus2; see docs/security/exceptions/. Every job still has the default read-only job token. Set audit to opt out if the defect recurs. Any other job follows egress-policy. Any other value fails the job. |
allowed-endpoints |
string | api.github.com:443 files.pythonhosted.org:443 github.com:443 objects.githubusercontent.com:443 pypi.org:443 release-assets.githubusercontent.com:443 |
harden-runner allow-list for block, space-separated host:port entries. The default is every endpoint this workflow reaches; the runner's own infrastructure needs no entry. Wildcards are not supported and a newline-separated list matches nothing. |
extra-allowed-endpoints |
string | empty | Appended to allowed-endpoints, for hosts only this repository reaches, such as a private index its install command uses. Same format. |
timeout-minutes |
number | 30 |
Job timeout. Raise it with seconds-per-target when a repository has many targets, since they run one after another. |
It never holds a token, never treats a missing target as a pass, and never builds Atheris from source on the runner.
Generated from docs/wiki/ at commit f3af2fa0bae3. Do not edit this wiki: the next push to main replaces every page. Corrections go to docs/wiki/ by pull request.
GYST
- Home
- Why GYST exists
- Getting started
- Design rules
- Secrets: Doppler and OIDC
- Security scanning explained
- The baseline and the weekly audit
- Releases and supply chain
- Keeping a project board current
- Adopting GYST in your own project
- Glossary
- Roadmap
Learn and contribute
- Learning path
- Which workflow do I need?
- Repository map
- Egress control
- Troubleshooting
- Lessons learned
- Testing and the contract
- Contributing and developing
- Maintaining this wiki
- Verify main
- FAQ
CI
Security
Release
- container-release
- python-docker-release
- python-package-release
- artifact-release
- verify-published
- base-image-digest
Docs and project
- docs-pages
- wiki-publish
- project-sync
- threat-model
- lory-audit
- agent-scan
- token-drift
- node-typecheck
- pr-title-lint
- vendored-drift
- upstream-sync
- repin
- pin-comments
Tools