Repository navigation
Description
This was generated by AI during triage.
Summary
Fuzz every repository that holds enough code to fuzz, from one daily job in this repository, and publish what it finds to each repository's code scanning. This issue records the decisions and tracks the work. It carries no-agent: the linked issues are the ones to work.
Decisions (agreed 2026-11-19)
- Central daily job, harnesses in the repositories. The job lives here beside the zizmor and aislop publishers. Each repository carries only its harness files, their seeds and a replay test.
- Its own upload token,
FUZZ_SARIF_PAT, as the other two publishers have. - A new failure also opens an issue in the repository, which the code monkey can work. The alert records the failure; the issue gets it fixed.
grype-scan-actionkeeps its own fuzz job until a pull-request gate exists, since it is the only fuzzing that runs on pull requests.- Not ClusterFuzzLite. It has one mutable
v1tag and no releases, five commits since November 2023, and its actions pullgcr.ioimages that the egress allow-list does not carry.
Why this shape
OpenSSF Scorecard's Fuzzing check reads source files and never workflows. Scorecard v5.6.0, run locally against four synthetic repositories:
| Repository contains | Fuzzing |
|---|---|
| Code plus a stub workflow that calls a central fuzz job | 0 |
A harness file with import atheris, and no workflow |
10 |
Only .clusterfuzzlite/Dockerfile |
10 |
| Neither | 0 |
So only the harness has to live in a repository, and a stub workflow there earns nothing. The central job finds harnesses by Scorecard's own pattern, so what Scorecard credits and what actually runs cannot drift apart.
Of 150 public repositories, 69 hold no language Scorecard has a fuzzer pattern for, and about 40 hold 500 or more lines of non-test source. Each of those gains about 0.5 to 0.6 on its aggregate score. Two already score 10: grype-scan-action, and supported-versions-action, for three Go fuzz functions that I found nothing in the organisation running with -fuzz.
Harness contract, version 1 (Python)
-
Discovery. A harness is a tracked
.pyfile with a line containingimport atheris. OpenSSF Scorecard and the central job both find harnesses by that text, so it appears in harness files and in no other.pyfile, comments and strings included. -
Invocation. The central job runs a harness from the repository root, on Linux x86_64 with CPython 3.13:
python <harness> [libFuzzer options] [directory ...]fuzzes. libFuzzer writes the inputs it keeps to the first directory.python <harness> [libFuzzer options] <file> [<file> ...]runs each named input once and exits.
The harness puts whatever it imports on
sys.pathitself. -
Seeds. Unless an argument names an existing file, the harness appends a directory holding its seed inputs after any directories it was given. Run with no arguments, it fuzzes from its seeds.
-
Verdict. An input that breaks the contract under test raises out of the fuzzed function, and the process exits non-zero. A run in which every input held exits 0. The verdict depends on the input alone: no clock, randomness, network, credential or environment variable, and no file outside a temporary directory.
-
Limits. Each input finishes within 10 seconds and 2 GiB of memory. libFuzzer sizes the inputs it generates from the largest seed, so a target that needs long inputs carries a seed that long.
-
Imports. The standard library, the repository's own code, the packages
uv sync --frozeninstalls from the repository'suv.lock, andatheris. A repository withoutuv.lockgets the first two andatheris. -
Without Atheris.
import atherissits inside the function that starts fuzzing, so the module imports on any platform. The check being fuzzed is a plain function, and the repository's unit suite runs every seed through it. -
Nothing else. The repository carries no fuzz workflow, no Atheris pin and no Dependabot entry for one. The central job brings its own pinned Atheris.
Go repositories use the language's own form, func FuzzXxx(f *testing.F) in a _test.go file. The central job does not run those yet; see the follow-ups.
What the local tests showed
- The existing pipeline carries fuzz results unchanged. Real failures from
grype-scan-actionas it stood before its PR 70, converted to SARIF by a throwaway script, passed the SARIF 2.1.0 schema,sarif_fingerprint.pyand both upload guards in the publishers. - Fingerprints are stable. Two different inputs that hit one defect got one fingerprint, provided the result's message carries nothing derived from the input.
findings-ratchetworks on it. It failed a simulated pull request that adds the failures and passed the one that removes them.- Known failures must be replayed. On the unfixed code, 60 seconds of fuzzing without the saved inputs ran 1,147,617 and 731,245 inputs and found neither known defect. An upload from such a run would close both alerts with the defects still there.
- The contract works as written. On a toy repository under Atheris 3.1.0: a saved corpus directory given first accumulates inputs across runs while the seeds still load; a named input file runs alone, exiting 0 when it passes, 77 on an uncaught exception and 70 on a timeout; a harness that cannot start exits 1 with an ordinary traceback.
- A generic install is enough. Every Python repository of 500 or more lines admits Python 3.13, and 34 of 38 need only
uv sync --frozenor nothing. Againstgithub2gerrit-action, a lock-file install plus Atheris instrumented 518 modules and ran 605,944 inputs in a minute with no repository-specific setup.
Work
Dispatched to the code monkey
- Feat(fuzz): Add the organisation fuzz publisher #373: the publisher, merged in Feat(fuzz): Add the organisation fuzz publisher #374
- Fix(fuzz): Convert fuzz_seconds to a number #377: manual dispatches fail on the
fuzz_secondsinput; found by the first dry run, merged in Fix(fuzz): Convert fuzz_seconds to a number #378 - Feat(report): Add a fuzzing category github-security-report-action#302: the report category, merged in Feat(report): Add a fuzzing category github-security-report-action#303
- Test: Align fuzz harnesses to the contract grype-scan-action#76: the pilot repository's harnesses, merged in Test(fuzz): Align harness seeding to the contract grype-scan-action#77
- Test: Fuzz the commit and comment parsers github2gerrit-action#560, merged in Test: Fuzz commit, comment and config parsers github2gerrit-action#561
- Test: Fuzz the URL, policy and netrc parsers dependamerge#639, merged in Test: Fuzz URL, content and redaction parsers dependamerge#640
- Test: Fuzz the workflow and shell readers gha-workflow-linter#484, merged in Test(fuzz): Add Atheris harnesses for the readers gha-workflow-linter#485
- Test: Fuzz URL safety and path handling source-clone-action#411, merged in Test: Fuzz URL safety and path handling source-clone-action#412
- Test: Fuzz the proposal and review readers github-code-monkey-bot#205, merged in Test: Fuzz untrusted input, fix surrogate crashes github-code-monkey-bot#206
- Test: Fuzz the verdict and comment handling github-code-review-bot#111, merged in Test: Add Atheris fuzz harnesses github-code-review-bot#112
- Test: Fuzz the triage proposal checks github-issues-triage-bot#53, merged in Test(fuzz): Fuzz the triage proposal checks github-issues-triage-bot#54
- Fix(trailers): Keep one trailer block when adding github2gerrit-action#559: a trailer defect found while scoping, merged in Fix(trailers): Keep one trailer block when adding github2gerrit-action#562
Not for the bot
- Test: Fuzz the shared bot modules bots-template#63: the five modules every bot shares. It is a template repository, which the bot's selection refuses whoever names it.
Found on 2026-11-19, since raised and fixed
- Test: Add Atheris fuzz harnesses github-code-review-bot#112 merged seven minutes before Copilot's review of its last push arrived. That review had six findings: five in the fuzz oracles, and one in
scripts/review_policy.py, where the newftp://match put a zero-width space into the query of an allowed organisation URL. Raised as Fix: Keep allowed URLs and tighten fuzz oracles github-code-review-bot#123, merged in Fix: Keep kept-link schemes and tighten oracles github-code-review-bot#125. - The review bot could not hand a
.githubpull request back for revision:scripts/handback.pydropped any repository whose name does not start with a letter or digit, so its hand-back job was skipped while the review still said a revision was requested. Raised as Fix(handback): Hand back .github pull requests github-code-review-bot#122, merged in Fix(handback): Hand back .github pull requests github-code-review-bot#124.
For every future issue in this rollout
The code monkey's author session has no GitHub credential, and its prompt forbids fetching URLs, so it cannot open an earlier pull request to read the review. Whatever it is to learn from earlier rounds has to be in the text of its own issue. Every new harness issue therefore carries both of these in its body:
- The list under "What review caught", brought up to date first by reading the review threads of any pull request merged since.
- The reference pull requests, for a maintainer, or an agent that can read GitHub, to see the findings and the final state.
Reference pull requests
| Pull request | Copilot reviews | What the rounds were about |
|---|---|---|
| lfreleng-actions/grype-scan-action#70 | 5 | The first harnesses: oracles that trusted the classifier they checked; output captured in a buffer that hid an encoding error |
| lfreleng-actions/grype-scan-action#77 | 2 | Contract alignment; a README example that did not run from a fresh checkout |
| lfreleng-actions/gha-workflow-linter#485 | 2 | An exception treated as success instead of fuzzing the caller that contains it; an off-by-one in an oracle |
| lfreleng-actions/source-clone-action#412 | 4 | A replay test that failed on Windows paths; seeds that never exercised percent-decoding; a RecursionError the harness could reach and had not reported |
| lfreleng-actions/github2gerrit-action#561 | 4 | Harness files without the literal import atheris; an oracle that used the matcher under test as its answer |
| lfreleng-actions/dependamerge#640 | 5 | Substring and no-op oracles; oracle functions with no negative control; seeds too short for a length limit; two fixes that introduced a new defect |
| lfreleng-actions/github-issues-triage-bot#54 | 8 | Size caps the expected verdict ignored; boundaries the input layout could not reach; expected values taken from the extractor under test |
| lfreleng-actions/github-code-monkey-bot#206 | 9 | Review-classifier oracles that accepted fabricated verdicts |
| lfreleng-actions/github-code-review-bot#112 | 7 | Markdown and link containment oracles. Six findings arrived after the merge; fixed in lfreleng-actions/github-code-review-bot#125 |
| #374 | 11 | The publisher: what a lost or tampered saved state could close |
| lfreleng-actions/github-security-report-action#303 | 5 | Incomplete reads classified as clean or not applicable |
What review caught
Most findings, across every harness pull request, were about an oracle that would pass a wrong answer.
Oracles that pass wrong answers
- Never take the expected answer from the code under test, or from a helper it shares. Build the input so the answer is known by construction (plant the values, then require exactly those back), or derive it again from the raw bytes with independent code.
- Compare whole values, in order, with multiplicity. Substrings, prefixes, sets and key lists let a dropped, duplicated or reordered item pass.
- Do not normalise away the difference under test. Stripping whitespace, case-folding and Unicode lowercasing all let a changed result compare equal, and so does Python's
True == 1. Match the production matcher's own semantics:re.IGNORECASEis notcasefold(). - An early return or a size bound in the oracle must not skip the check for an input that fits. Prefer a check that holds for every input to a bound that exempts some.
- Check the refusals too. An input the code must refuse has to be refused, not merely survive; a flag of
"yes"is notTrue. - Hand the code under test its own copy of any mutable input, and make sure the copy cannot fail on an input the parser accepts.
Oracles that fail correct code
- Decode the input the way production does before comparing: JSON escapes, percent-encoding, escaped Markdown. Compare decoded values, not their spelling.
- The replay test runs wherever the repository's tests run: no POSIX-only path assumptions.
- Model the documented limits, such as size caps and truncation, in the expected verdict.
Proving the oracle works
- Every oracle function has a negative control: a deliberately wrong result it must reject. Reviewers checked this function by function.
Reaching the code
- Make each documented boundary reachable: a seed as long as the largest limit under test, an input layout that does not cap a field at 255 bytes, and inputs at the integer and nesting limits.
- Feed lone surrogates and other text that cannot be encoded, and capture output on a strict UTF-8 stream. Three repositories had an encoding crash found this way.
- Keep oracles linear in the input. A quadratic scan in the harness trips the ten-second limit by itself.
- Where a caller contains an exception by design, fuzz the caller; do not treat the exception as success.
Contract and housekeeping
- The literal text
import atherisis in each harness file. An import through a shared runner is not found. A test that checks the rule looks at tracked files alone. - A documentation example runs from a fresh checkout.
Fixes made along the way
- A production fix prompted by a harness needs the same adversarial attention as the harness. In two pull requests such a fix introduced a new defect that review then caught. Keep the fix minimal, and test it against the inputs nearest the one that failed.
For workflow and publisher work
- Say in the issue where the threat model stops: what a compromised job may achieve at worst, and what is not defended. Seventeen of the publisher's 23 findings were about a lost or tampered saved state, or an alert closing without a passing replay, which its issue left open-ended.
- Name each secret, where it is stored and which job reads it. A reusable workflow cannot read an environment secret passed at the caller level, and a dispatch input is visible to every job of the run.
- A test or helper in the repository must not match the harness discovery rule by accident.
To raise once the publisher has merged
The publisher merged on 2026-11-20 and has run on schedule since. As of 2026-11-26 none of the items below has an issue.
- Open an issue for each new failure. One per distinct failure, deduplicated by fingerprint, capped per repository per run. The body is a fixed template filled only with validated fields (harness path, exception type, function, file and line, fingerprint, and the failing input as base64): no free text from the fuzz run, since the code monkey reads these issues. Issues opened with the publisher's token count as their owner's, so the scheduled scan works them unless they carry
no-agent. The token then also needs Issues: write. - Go engine. Run
FuzzXxxfunctions withgo test -fuzz, forbuild-metadata-action,supported-versions-actionandversion-extract-action. - Pull-request gate. A ruleset-required workflow that fuzzes briefly and uses
findings-ratchet, so a pull request fails only for failures it introduces. - Remove
grype-scan-action's own fuzz job, its Atheris lock file and its Dependabot entry, once the gate exists. - Next harnesses, in this order:
build-metadata-action(Go),tag-validate-action,project-reporting-tool(itsuv.locklanded in Build: Commit uv.lock and let Dependabot keep it project-reporting-tool#413),sigul-sign-action,markdown-table-fixer,pull-request-fixer,semantic-tag-increment,repository-metadata-action,log-publish-action,list-splitter-action,harden-runner-block-action; thenlftools-uvandgithub-security-report-action; lastgerrit-docker-k8sandsigul-docker-k8s. python-nss-ng. 32,000 lines of C behind a Python API. It needs a sanitizer build of the extension against NSS, which the generic job cannot do, so it gets its own design.
Maintainer actions
Checked 2026-11-26: both secrets exist on this repository, and the schedule has run green daily since 2026-11-22. A manual dispatch on 2026-11-20 failed and led to #377; one on 2026-11-23 succeeded. Whether that one was the dry_run on grype-scan-action, and whether its SARIF was read, is not visible from the run list, so the third box stays open for a maintainer to tick.
- Create
FUZZ_SARIF_PATas a repository secret here, not aproductionenvironment secret: the publisher passes it to a reusable workflow, which cannot read an environment secret. A fine-grained token for the organisation needs Code scanning alerts: read and write, Contents: read and Metadata: read. - Create
FUZZ_EVIDENCE_KEYas a repository secret too: at least 32 random characters, for example fromopenssl rand -hex 32. The publisher as built in Feat(fuzz): Add the organisation fuzz publisher #374 signs with it which input reproduced each published result. - After the publisher merges, dispatch it once with
dry_runongrype-scan-action, read the SARIF it attaches, then let the schedule run.
Activity