Skip to main content

Python harness for the crossfuzz differential fuzzer

Project description

crossfuzz

Python harness for crossfuzz, a coverage-guided differential fuzzer across C, C++, Go, Java, JavaScript/TypeScript, Python, and Rust. The coordinator sends the same generated input to multiple implementations of the same function, collects coverage from every target, and flags any divergence in outputs.

This package is the Python side: it handles the shared-memory IPC, pipe protocol, and branch-arc coverage collection so you only have to write the target function.

Install

pip install crossfuzz

You also need the crossfuzz coordinator binary — see the main repo for build/install instructions.

Quick start

Write a target script that calls crossfuzz.fuzz(your_function):

import crossfuzz

def my_target(data: bytes) -> bytes:
    # Your code under test. Raise an exception to signal an error.
    return data

crossfuzz.fuzz(my_target)

Point the coordinator at it from a crossfuzz.toml config:

[[target]]
name = "python_impl"
language = "python"
binary = "python3"
args = ["my_target.py"]

Then run the campaign with crossfuzz run crossfuzz.toml.

API

  • crossfuzz.fuzz(target, settings=None) — persistent fuzz loop. target(data: bytes) -> bytes.
  • crossfuzz.filter(target, settings=None) — persistent filter loop. target(data: bytes) -> tuple[bytes, bool].
  • crossfuzz.compare(target, settings=None) — custom comparator loop. target(input: bytes, names: list[str], outputs: list[bytes]) -> str.
  • crossfuzz.Settings(instrument=True, warmup=0, transform=False) — configuration. Set instrument=False for thin HTTP-trigger harnesses where coverage comes from an instrumented server process.

Platform

POSIX only — the harness uses mmap and inherited file descriptors 3/4 to talk to the coordinator. Windows is not supported.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

crossfuzz-0.0.3.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

crossfuzz-0.0.3-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file crossfuzz-0.0.3.tar.gz.

File metadata

  • Download URL: crossfuzz-0.0.3.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for crossfuzz-0.0.3.tar.gz
Algorithm Hash digest
SHA256 04432dc10c7812c8c46b8b413146a6c9e13027b3bec5ee65fef6ae0c2b887d5f
MD5 7437299f8b3d996ec11ba055f2fb7a53
BLAKE2b-256 4bd71133d9c97bcd771d232a08a04b18d241c992bb9375ac504a3a559b1bbe91

See more details on using hashes here.

Provenance

The following attestation bundles were made for crossfuzz-0.0.3.tar.gz:

Publisher: python-publish.yml on KilledKenny/crossfuzz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file crossfuzz-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: crossfuzz-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for crossfuzz-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 67cfdc50951ea622d3577c665ce30358bbb9f17448cc06308da8258fdf4fccd7
MD5 8084c7dd91b5a33db5683e20c44efa22
BLAKE2b-256 527cd5fad0173e4bf1fdf9bf92d7724b0b1eaf7cdb94a315b3d8f9c85670e975

See more details on using hashes here.

Provenance

The following attestation bundles were made for crossfuzz-0.0.3-py3-none-any.whl:

Publisher: python-publish.yml on KilledKenny/crossfuzz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page