atheris

Fuzz test Python and C-extension code with coverage-guided Atheris.

Updated Jul 10, 2025
One-click install
npx skills add https://github.com/Superlend/superloop-core-contracts --skill atheris
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: atheris
Source: https://github.com/Superlend/superloop-core-contracts/tree/main/.cursor/skills/testing-handbook-skills/skills/atheris
Command: npx skills add https://github.com/Superlend/superloop-core-contracts --skill atheris

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Atheris provides a ready-to-use, coverage-guided fuzzing workflow for Python code and native extensions, helping teams discover crashes, memory-safety issues, and edge-case bugs early in development.

Core Features & Use Cases

  • Coverage-guided fuzzing for pure Python code and Python C extensions using libFuzzer and AddressSanitizer.
  • Harness guidance and instrumentation with atheris.instrument_func and atheris.instrument_imports for high coverage.
  • Docker-based, reproducible environments with a complete clang/toolchain setup for safe fuzzing in CI or local environments.
  • Real-world use cases include fuzzing Python libraries, validating C extensions, and testing complex input parsing to prevent crashes or security issues.

Quick Start

Build and run the fuzzing environment using the provided Docker workflow:

  1. Build: docker build -t atheris .
  2. Run: docker run -it atheris
  3. Verify: python -c "import atheris; print(atheris.version)" Then create a small harness, instrument it with atheris, and start fuzzing your target function.

Frequently Asked Questions about atheris

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

FAQPage Schema
How do I fuzz test Python C extensions for memory safety issues?

You can fuzz test Python C extensions by executing them under a coverage-guided fuzzer using libFuzzer and AddressSanitizer. This workflow automates discovery of crashes and memory errors in native extensions by instrumenting the code with Atheris.

What is coverage-guided fuzzing for Python code?

Coverage-guided fuzzing for Python code is an automated testing technique that discovers crashes and edge-case bugs by feeding mutated inputs to a target function. It tracks code execution paths to maximize coverage and efficiently find memory-safety issues.

Do I need clang and AddressSanitizer to fuzz Python libraries?

Yes, you need a suitable compiler toolchain including clang and sanitizers to fuzz Python libraries, especially when testing C extensions. The provided Dockerfile sets up this complete reproducible environment for safe fuzzing in CI or local development.

How do I set up a fuzzing harness for a Python function?

To set up a fuzzing harness, create a Python script that imports Atheris, instrument your target imports using atheris.instrument_imports, and define a test function that feeds byte buffers to your API. Then execute the script to start fuzzing.

Can I run fuzzing in my CI workflows for mixed-language Python projects?

Yes, you can run fuzzing in CI workflows for mixed-language projects. The Docker-based environment provides a reproducible setup with the complete clang toolchain, allowing you to safely fuzz pure Python code and native extensions during continuous integration.

What are the limitations of fuzzing for pure Python versus native C extensions?

Fuzzing pure Python code primarily catches logical crashes and unhandled exceptions, whereas fuzzing native C extensions can discover severe memory-safety issues like buffer overflows. Both require proper instrument_imports and instrument_func configuration to achieve high coverage.