Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fusil-numpy-plugin

A numpy fuzzing plugin for fusil's Python fuzzer.

It injects a large catalog of pre-built "tricky" numpy arrays and scalars (odd dtypes, huge/empty shapes, NaN/inf, object arrays, non-contiguous views, ...) as hostile arguments into fuzzed calls, and embeds their setup code into every generated script.

Unlike the h5py and cereggii plugins — which only activate when their library is the fuzz target — numpy arrays are useful hostile inputs for any C extension, so this plugin is active for every run whenever numpy is importable. This reproduces the behaviour of the in-core numpy support it replaces.

This machinery used to live in-tree (fusil/python/samples/tricky_numpy.py plus the numpy branches of argument_generator / write_python_code / tricky_weird). It was extracted so the core generator carries no numpy-specific code.

Install

pip install -e .          # from a checkout, into the same venv as fusil

Requires fusil and numpy.

Use

Just install it — it activates automatically for every run:

PYTHONPATH=$PWD python fuzzers/fusil-python-threaded --force-unsafe --modules json
  • --no-numpy turns it off for a run.
  • --no-external-references suppresses the injected references (the setup is still emitted).
  • Uninstall the plugin to remove numpy support entirely.

What it registers

Hook Provided by
--no-numpy CLI option opt-out, preserved from the core
add_argument_generator (simple + complex, weight 50) reference to a random pre-built numpy_* object
add_definitions_provider import numpy + the tricky-object setup source
declare_dependency("numpy") advertises the numpy requirement

Layout

  • fusil_numpy_plugin/__init__.pyregister() and the thin adapters.
  • fusil_numpy_plugin/tricky_numpy.py — the pre-built tricky-object catalog (embedded verbatim).

About

Fusil plugin: inject tricky numpy arrays as fuzzing arguments

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages