Repository navigation
Fuzzing with Atheris; damaged archives never raise - #11
Closed
petecleary wants to merge 1 commit into
Closed
petecleary wants to merge 1 commit into
petecleary wants to merge 1 commit into
Conversation
Two targets, seeded from moca-spec's corpus: archive bytes, and one file of a valid package replaced. 60 seconds per target on pull requests, 30 minutes nightly, with the corpus kept between nightly runs. Fuzzing found read_package raising on damaged archives. A local header not where the central directory says, or an encrypted entry, is now P002; an entry needing a newer zip version than zipfile reads rejects the archive (T003). Tests for each.
Contributor
Author
|
This work continues in 0.8.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Coverage-guided fuzzing of the open-and-search path, the Python counterpart of the TypeScript Reader's Jazzer.js targets.
fuzz/open_search.pyread_packagefuzz/package_files.pystructure-procedure) replaced, read through a host sourceSeeds come from moca-spec's corpus at the same ref as
test.yml(v0.6.0). 60 seconds per target on pull requests, 30 minutes nightly, with the corpus kept between nightly runs. Atheris 3.1.0 is installed hash-checked fromfuzz/requirements.txt, apart fromuv.lock; Dependabot watches it with a 7-day cooldown.Bugs found and fixed.
read_packageraised on three kinds of damaged archive instead of reporting them:ValueError: negative seek valueRuntimeErrorNotImplementedErrorEach has a test in
tests/test_archive_robustness.pythat fails without the fix. The reference Reader gives T003 for the first and P002 for the third: both refuse the package, with different codes, because the zip libraries differ.Local results: 250 tests pass (1 skipped); ruff, mypy and actionlint clean; after the fixes, 8 minutes on the archive target and 5 on the files target found nothing more.