atheris

Fuzz pure Python code and Python C extensions with coverage-guided libFuzzer instrumentation.

Updated Mar 22, 2026
One-click install
npx skills add https://github.com/TECH-HY/SKILLS --skill atheris-tech-hy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: atheris
Source: https://github.com/TECH-HY/SKILLS/tree/main/skills/atheris
Command: npx skills add https://github.com/TECH-HY/SKILLS --skill atheris-tech-hy

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires atheris.

What problem does it solve? Finding crashes, memory corruption, and unexpected exceptions in Python code and Python C extensions requires systematic input generation that manual testing cannot provide. This Skill guides the setup and execution of coverage-guided fuzzing with Atheris, including sanitizer integration for detecting memory errors in native extensions. ## Core Features & Use Cases - Pure Python Fuzzing: Instrument Python functions and imports with atheris.instrument_func and atheris.instrument_imports() to generate coverage-guided random inputs. - C Extension Fuzzing: Compile native extensions with clang and AddressSanitizer flags, configure LD_PRELOAD, and detect memory corruption in libraries like cbor2. - Corpus and Campaign Management: Create seed corpora, minimize them with libFuzzer merge mode, and run parallel fuzzing campaigns with workers and time limits. - Use Case: You maintain a Python library that parses untrusted input. Write a harness that feeds random bytes to your parser, run it in the provided Docker environment with ASan enabled, and catch buffer overflows and unexpected exceptions before release. ## Quick Start Write a fuzzing harness for my Python parser function using Atheris and show me how to run it with a seed corpus.

Frequently Asked Questions about atheris

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fuzz Python code with Atheris?

Write a harness defining a test_one_input(data) function that calls your target code, decorate it with @atheris.instrument_func, then call atheris.Setup(sys.argv, test_one_input) and atheris.Fuzz(). Run the script with python fuzz.py, optionally passing a corpus directory.

Atheris vs Hypothesis for Python testing?

Atheris is a coverage-guided fuzzer that mutates byte inputs to explore code paths and find crashes, including memory corruption in C extensions. Hypothesis is a property-based testing library that generates type-aware inputs to verify code invariants. Choose Atheris for crash discovery and Hypothesis for verifying logical properties.

Can Atheris fuzz Python C extensions?

Yes, Atheris supports fuzzing C extensions compiled with clang using -fsanitize=address,fuzzer-no-link flags. You must set LD_PRELOAD to the asan_with_fuzzer.so library and install the extension from source with --no-binary so it compiles with instrumentation.

Why does Atheris segfault without AddressSanitizer output?

This happens when LD_PRELOAD is not set to the asan_with_fuzzer.so shared library. Export LD_PRELOAD pointing to that file inside the atheris package directory, or use the provided Docker environment where it is preconfigured.

What platforms does Atheris support?

Atheris supports 32-bit and 64-bit Linux and macOS, with Linux recommended for simpler dependency management and faster execution. It requires Python 3.7 or later and a recent clang version, and a Docker setup is provided for a preconfigured environment.