tessl install tessl/pypi-atheris@2.3.0A coverage-guided fuzzer for Python and Python extensions based on libFuzzer
Agent Success
Agent success rate when using this tile
91%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.28x
Baseline
Agent success rate without this tile
71%
Create a fuzzing harness that tests Python code loaded through a custom import mechanism. Your implementation should handle modules that are loaded from non-standard sources (such as in-memory modules or custom loaders) and ensure they are properly instrumented for fuzzing.
Your solution should:
The test module (loaded by your custom loader) should contain a simple function that processes string input and has a deliberate vulnerability that the fuzzer can discover (e.g., crashes on specific input patterns).
@generates
def TestOneInput(data: bytes) -> int:
"""
Fuzzing entry point that receives random byte input.
Args:
data: Random bytes from the fuzzer
Returns:
0 to continue fuzzing, -1 to stop
"""
pass
class InMemoryLoader:
"""
Custom loader that loads Python modules from in-memory source code.
"""
def __init__(self, module_name: str, source_code: str):
"""
Initialize the loader with module name and source code.
Args:
module_name: Name of the module to create
source_code: Python source code as a string
"""
pass
def load_module(self):
"""
Load the module and make it available for import.
Returns:
The loaded module object
"""
pass
def setup_fuzzer():
"""
Initialize the fuzzing environment with custom loader support.
"""
passProvides Python fuzzing capabilities with support for custom import mechanisms.
@satisfied-by