Posted by Laura Pak
Posted by Laura Pak
Fuzz testing is a process of testing APIs with generated data. Fuzzing ensures that code will not break on the negative path, generating randomized inputs that try to cover every branch of code. A popular choice is to pair fuzzers with sanitizers, which are tools that check for illegal conditions and thus flag the bugs triggered by the fuzzers’ inputs.
In this way, fuzzing can find:
The best way to fuzz to have your fuzz tests running continuously. The more a test runs, the more inputs can be generated and tested against. In this article, you’ll learn how to add a Python fuzzer to TensorFlow.
TensorFlow Python fuzzers run via , a coverage-guided Python fuzzing engine. Atheris is based on the fuzzing engine or the fast undefined behavior detector, , in the , that API is tf.constant. That fuzzer simply passes data to the chosen API to see if it breaks. No need for code that catches the breakage; OSS-Fuzz will detect and report the bug.
Sometimes an API needs more structured data than just one input. TensorFlow has a Python class called , a fuzzer that checks for uncaught exceptions in the API tf.raw_ops.SparseCountSparseOutput.
To build and run, your fuzzer needs a fuzzing target of type tf_py_fuzz_target, defined in .
tf_py_fuzz_target(
name = "fuzz_target_name",
srcs = ["your_fuzzer.py"],
tags = ["notap"], # Important: include to run in OSS.
)Make sure that your fuzzer builds in OSS-Fuzz with Docker.
First from Github. The project for a Python TF fuzzer, . Specifically, it builds all the Python fuzzers found in $SRC/tensorflow/tensorflow, including your new fuzzer!
Inside oss-fuzz, run the following commands:
python infra/helper.py shell tensorflow
export FUZZING_LANGUAGE=python
compileThe command compile will run build.sh, which will attempt to build your new fuzzer.
Once your fuzzer is up and running, you can search this dashboard for your fuzzer to see what vulnerabilities your fuzzer has uncovered.
Fuzzing is an exciting way to test software from the unhappy path. Whether you want to dabble in security or gain a deeper understanding of TensorFlow’s internals, we hope this post gives you a good place to start.
Ähnliche Beiträge
Thematisch verwandte Begriffe: Howto, Write, Python, Fuzzer · 6 Treffer
Videos werden geladen ...
Beiträge werden geladen ...
Videos werden geladen ...
Beiträge werden geladen ...
Videos werden geladen ...
Beiträge werden geladen ...
Videos werden geladen ...
Beiträge werden geladen ...
Videos werden geladen ...
Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.
Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.
SOCIAL SHARE CARD GENERATOR