Engineering
atheris avatar

atheris

Atheris is a coverage-guided Python fuzzer based on libFuzzer for testing pure Python code and Python C extensions.

Introduction

Atheris is a powerful, coverage-guided fuzzer designed specifically for the Python ecosystem. By leveraging the industry-standard libFuzzer, it enables developers and security researchers to perform deep automated testing on pure Python code, as well as complex Python C extensions. It is particularly effective at uncovering memory corruption issues in native extensions, thanks to its integrated AddressSanitizer (ASAN) support. This skill is intended for security engineers, software testers, and developers who need to identify bugs that are often missed by traditional unit tests, such as edge-case crashes, assertion failures, and memory leaks.

  • Performs coverage-guided fuzzing to explore code paths efficiently.

  • Supports fuzzing of pure Python functions using instrumentation decorators.

  • Provides deep support for testing Python C extensions with AddressSanitizer.

  • Integrates seamlessly into the libFuzzer ecosystem.

  • Offers flexible instrumentation options including function-level, module-level, and system-wide coverage.

  • Facilitates quick setup for common development environments on Linux and macOS.

  • The fuzzer requires a harness function (test_one_input) to receive random byte sequences generated by the engine.

  • Users should apply decorators like @atheris.instrument_func or context managers like atheris.instrument_imports to enable code instrumentation.

  • It is recommended to run fuzzing operations within a Linux-based Docker environment to ensure consistent performance and dependency management, particularly when compiling C extensions with specific clang/LLVM sanitizers.

  • Expected usage involves calling atheris.Setup and atheris.Fuzz within a main execution block to initiate the discovery of crashes or unexpected runtime behaviors.

  • Constraints include needing a recent version of clang/LLVM for native extension support and a basic understanding of harness structure to avoid catching expected exceptions that the fuzzer should report as failures.

Repository Stats

Stars
4,904
Forks
428
Open Issues
21
Language
Python
Default Branch
main
Sync Status
Idle
Last Synced
Apr 30, 2026, 08:11 AM
View on GitHub