Which fuzz testing program type defines new test data based on models of the input?


Table of Contents

  • What is fuzz testing?
  • Smart vs. dumb fuzzing
    • Dumb Fuzzer
    • Pros & Cons of dumb fuzzing
    • Smart Fuzzer
    • Pros & Cons of smart fuzzing
  • Fuzzer types
    • Mutation-based fuzzers
    • Generation-based fuzzers
  • Generating random data
  • Code coverage in fuzz testing
  • Why should you keep an eye on API Fuzzing?
  • Fuzz testing APIs using Testfully
  • Fuzz testing glossary

Looking for an API testing tool?

Testfully offers multi-step tests, local & deployed API testing, team collaboration, historical test results and many more features. Import from Postman supported!

What is fuzz testing?

Fuzz testing is a type of automated software testing; a method of discovering bugs in software by providing random input to the software under the test and monitoring any crashes and failed assertions. Fuzzer is a computer program that offers random inputs to the software. Fuzz testing can be applied to virtually any software program, including HTTP APIs.


Smart vs. dumb fuzzing

As mentioned earlier, a fuzzer provides random data to the software under the test. The input can be entirely random without matching the shape of the expected input or generated to match a valid input.


Dumb Fuzzer

Dumb fuzzers produce completely random input that does not necessarily match the shape of the expected input. Lack of built-in intelligence about the software it’s fuzzing makes this type of fuzzer a dumb one. Due to their simplicity, dumb fuzzers can produce results with little work. On the other hand, dumb fuzzers may be able to fuzz only certain areas of the software.

For example, the presence of the newsletter boolean field in the request payload of a Rest API endpoint for creating a new user triggers the logic for newsletter subscription. But, as you may have already guessed, a dumb fuzzer won’t be able to begin the execution of the newsletter subscription logic and identify potential bugs in that area of the code due to the wholly randomized input that does not match the valid input.


Pros & Cons of dumb fuzzing

Dumb fuzzing prosDumb fuzzing cons
Straightforward to set up, run, and maintain Limited code coverage due to the fully randomized input
Requires minimum amount of work for the initial setup Sometimes, it tests a parser than your program

Smart Fuzzer

Smart fuzzers push the boundaries of fuzz testing by generating randomized data valid enough to pass program parser checks, get deep into the program logic, and potentially trigger edge cases and find bugs.

The more built-in intelligence you add into your smart fuzzer, the greater code coverage you will have.


Pros & Cons of smart fuzzing

Smart fuzzing prosSmart fuzzing cons
Greater code coverage in comparison with dumb fuzzers Requires more work to set up, run and maintain
Catches more bugs thanks to greater code coverage

Fuzzer types

Based on the way a fuzzer generates the randomized input data, we can divide fuzzers into mutation-based and generation-based fuzzers.


Mutation-based fuzzers

A mutation-based fuzzer takes valid inputs and generates a collection of inputs by changing [mutating] the valid inputs.


Generation-based fuzzers

A generation-based fuzzer analyses the provided valid input structure and generates entirely new data that matches the valid one from the structure perspective.


Generating random data

Mutation-based and generation-based fuzzers both generate random data, albeit taking different approaches. The experience has proven that including specific values can trigger edge cases and bring bugs to the surface. The table below goes through some values proven to bring bugs to the surface.

ValueDescription
Empty strings Sometimes, empty string by-pass missing value checks and trigger bugs
Long strings Bugs as a result of truncation come to the surface as a result of passing long strings to programs
Strings with variant length Short, medium, and long strings can trigger bugs as well
0 Similar to empty strings, value 0 can sometimes pass the missing value checks and trigger bugs
Negative numbers Triggers bugs related to assuming positive numbers but lacking validation for that
Decimals Triggers bugs related to assuming integers but lacking validation for that
Special characters Bring up bugs related to embedding values in URL or saving in database
Max / Min numbers Does the code cope well with a maximum allowed number? what about the minimum?

Code coverage in fuzz testing

Code coverage refers to the percentage of the executed code while running the test cases against the source code. Broadly speaking, the greater the coverage percentage, the better it is. Therefore, while doing fuzz testing, you should always keep an eye on the part of the code you fuzz. For example, a dumb fuzzer can potentially fuzz the parser code than your business logic. Moreover, a mutation-based or generation-based fuzzer will trigger the execution of the code in different branches of the source code.

The diagram below shows seven branches of code that a fuzzer can trigger via input. But, of course, not every fuzzer can start all branches.


Why should you keep an eye on API Fuzzing?

When it comes to keeping our apps secure, we perform various kinds of testing methods such as static code analysis, dynamic code analysis, penetration, and more to protect them from the eyes of attackers. But usually, APIs are in the blind spot of the application security testing methods.

Unfortunately, in many software companies, security leaders think their APIs and products are safe because of performing regular penetration testing, not knowing the hackers find the software vulnerabilities through fuzzing. So, here is the fun fact, if you want not to be a victim of hackers, think like a hacker and find your software loopholes.

Consider the fuzzing practice in your penetration tactics and techniques for more accurate results about API vulnerabilities.

Fuzz testing APIs using Testfully

Testfully’s embeddable value data generators and data templates enable our customers to easily create intelligent fuzzers based on the expected request payload shape while controlling the generated data to test different branches of the code. This feature is available under all plans [including free plan].

The below short demo shows how easy it is to add random data to your requests.


Fuzz testing glossary

TermDefinition
Fuzz The random input for fuzz testing
Fuzzer A program or programming code that generates random input
Dumb fuzzer A fuzzer that does not know the expected input structure
Smart fuzzer A fuzzer that knows input structure
Mutation-based fuzzer A fuzzer that generates input by changing the provided valid input
Generation-based fuzzer A fuzzer that generates input from scratch by analyzing the provided valid input
Code Coverage The percentage of the code that is executed by running the test cases
Source code branch A portion of the source code that will be executed under certain conditions

Looking for an API testing tool?

Testfully offers multi-step tests, local & deployed API testing, team collaboration, historical test results and many more features. Import from Postman supported!

Which of the following types of testing uses unexpected or invalid inputs?

Fuzzing, or fuzz testing [32], is a testing technique that involves providing invalid, unexpected, or random inputs for hardware or software and monitoring the result for exceptions, such as crashes, failing built-in code assertions, or memory leaks.

What is a set of software development tools called that can be installed as one unit?

A software development kit [SDK] is a collection of software development tools in one installable package. They facilitate the creation of applications by having a compiler, debugger and sometimes a software framework. They are normally specific to a hardware platform and operating system combination.

Which of the following are the two main causes of software vulnerabilities?

There are two main things that can cause a software vulnerability. A flaw in the program's design, such as in the login function, could introduce a vulnerability. But, even if the design is perfect, there could still be a vulnerability if there's a mistake in the program source code.

Which of the following is the first step in the waterfall application development model?

Description: The sequential phases described in the Waterfall model are: 1. Requirement Gathering- All possible requirements are captured in product requirement documents.

Chủ Đề