Fuzz introspector
For issues and ideas: https://github.com/ossf/fuzz-introspector/issues

Project functions overview

The following table shows data about each function in the project. The functions included in this table correspond to all functions that exist in the executables of the fuzzers. As such, there may be functions that are from third-party libraries.

For further technical details on the meaning of columns in the below table, please see the Glossary .

Func name Functions filename Args Function call depth Reached by Fuzzers Runtime reached by Fuzzers Combined reached by Fuzzers Fuzzers runtime hit Func lines hit % I Count BB Count Cyclomatic complexity Functions reached Reached by functions Accumulated cyclomatic complexity Undiscovered complexity

Fuzzer details

Fuzzer: unzip_fuzzer

Call tree

The calltree shows the control flow of the fuzzer. This is overlaid with coverage information to display how much of the potential code a fuzzer can reach is in fact covered at runtime. In the following there is a link to a detailed calltree visualisation as well as a bitmap showing a high-level view of the calltree. For further information about these topics please see the glossary for full calltree and calltree overview

Call tree overview bitmap:

The distribution of callsites in terms of coloring is
Color Runtime hitcount Callsite count Percentage
red 0 161 27.9%
gold [1:9] 0 0.0%
yellow [10:29] 1 0.17%
greenyellow [30:49] 0 0.0%
lawngreen 50+ 414 71.8%
All colors 576 100

Fuzz blockers

The following nodes represent call sites where fuzz blockers occur.

Amount of callsites blocked Calltree index Parent function Callsite Largest blocked function
39 416 mz_zip_entry_read_close call site: 00416 mz_zip_write_cd
24 364 mz_stream_close call site: 00364 mz_zip_entry_write_header
14 519 mz_stream_zlib_create call site: 00519 mz_stream_set_prop_int64
10 392 mz_zip_entry_seek_local_header call site: 00392 mz_zip_entry_write_crc_sizes
8 144 mz_stream_write call site: 00144 mz_stream_zstd_compress
6 34 mz_stream_read call site: 00034 mz_stream_read
6 347 mz_zip_recover_cd call site: 00347 mz_stream_seek
6 490 mz_stream_wzaes_create call site: 00490 mz_crypt_hmac_delete
6 510 mz_stream_open call site: 00510 MZ_UNUSED
4 410 mz_zip_entry_read_close call site: 00410 mz_zip_extrafield_contains
3 21 mz_stream_seek call site: 00021 MZ_UNUSED
3 292 mz_zip_entry_write_header call site: 00292 mz_stream_write

Runtime coverage analysis

Covered functions
157
Functions that are reachable but not covered
44
Reachable functions
152
Percentage of reachable functions covered
71.05%
NB: The sum of covered functions and functions that are reachable but not covered need not be equal to Reachable functions . This is because the reachability analysis is an approximation and thus at runtime some functions may be covered that are not included in the reachability analysis. This is a limitation of our static analysis capabilities.
Warning: The number of covered functions are larger than the number of reachable functions. This means that there are more functions covered at runtime than are extracted using static analysis. This is likely a result of the static analysis component failing to extract the right call graph or the coverage runtime being compiled with sanitizers in code that the static analysis has not analysed. This can happen if lto/gold is not used in all places that coverage instrumentation is used.
Function name source code lines source lines hit percentage hit

Files reached

filename functions hit
test/fuzz/unzip_fuzzer.c 22
mz_strm_mem.c 7
mz_zip.c 109
mz_strm.c 25
mz_strm_zstd.c 15
mz_strm_wzaes.c 5
mz_crypt_winvista.c 6
mz_strm_pkcrypt.c 1
mz_strm_zlib.c 1
mz_strm_bzip.c 1
mz_strm_libcomp.c 1
mz_strm_lzma.c 1
mz_strm_ppmd.c 1
mz_crypt.c 2

Fuzzer: zip_fuzzer

Call tree

The calltree shows the control flow of the fuzzer. This is overlaid with coverage information to display how much of the potential code a fuzzer can reach is in fact covered at runtime. In the following there is a link to a detailed calltree visualisation as well as a bitmap showing a high-level view of the calltree. For further information about these topics please see the glossary for full calltree and calltree overview

Call tree overview bitmap:

The distribution of callsites in terms of coloring is
Color Runtime hitcount Callsite count Percentage
red 0 367 61.8%
gold [1:9] 0 0.0%
yellow [10:29] 0 0.0%
greenyellow [30:49] 0 0.0%
lawngreen 50+ 226 38.1%
All colors 593 100

Fuzz blockers

The following nodes represent call sites where fuzz blockers occur.

Amount of callsites blocked Calltree index Parent function Callsite Largest blocked function
87 164 mz_stream_write call site: 00164 mz_zip_entry_write_header
52 59 mz_stream_tell call site: 00059 mz_zip_recover_cd
34 321 mz_zip_entry_write_header call site: 00321 mz_zip_extrafield_write
26 130 mz_stream_get_prop_int64 call site: 00130 mz_zip_entry_read_header
17 112 mz_stream_set_prop_int64 call site: 00112 mz_stream_find
17 517 mz_zip_entry_write_open call site: 00517 mz_stream_wzaes_create
16 402 mz_zip_entry_write_close call site: 00402 mz_zip_entry_seek_local_header
15 356 mz_zip_entry_write_header call site: 00356 mz_zip_close
15 444 mz_zip_write_cd call site: 00444 mz_stream_write_uint32
11 422 mz_zip_entry_close_int call site: 00422 mz_zip_entry_read_close
9 256 mz_zip_attrib_convert call site: 00256 mz_stream_read_uint16
8 552 mz_stream_zlib_create call site: 00552 mz_stream_set_prop_int64

Runtime coverage analysis

Covered functions
138
Functions that are reachable but not covered
74
Reachable functions
140
Percentage of reachable functions covered
47.14%
NB: The sum of covered functions and functions that are reachable but not covered need not be equal to Reachable functions . This is because the reachability analysis is an approximation and thus at runtime some functions may be covered that are not included in the reachability analysis. This is a limitation of our static analysis capabilities.
Function name source code lines source lines hit percentage hit

Files reached

filename functions hit
test/fuzz/zip_fuzzer.c 19
mz_strm_mem.c 7
mz_strm.c 25
mz_strm_zstd.c 15
mz_zip.c 103
mz_strm_wzaes.c 5
mz_crypt_winvista.c 6
mz_strm_pkcrypt.c 1
mz_strm_zlib.c 1
mz_strm_bzip.c 1
mz_strm_libcomp.c 1
mz_strm_lzma.c 1
mz_strm_ppmd.c 1
mz_crypt.c 2

Analyses and suggestions

Optimal target analysis

Remaining optimal interesting functions

The following table shows a list of functions that are optimal targets. Optimal targets are identified by finding the functions that in combination, yield a high code coverage.

Func name Functions filename Arg count Args Function depth hitcount instr count bb count cyclomatic complexity Reachable functions Incoming references total cyclomatic complexity Unreached complexity
minizip_extract /src/minizip-ng/minizip.c 5 ['char*', 'char*', 'char*', 'char*', 'minizip_opt*'] 13 0 35 7 6 256 0 1099 351
minizip_add /src/minizip-ng/minizip.c 5 ['char*', 'char*', 'minizip_opt*', 'int32_t', 'char**'] 15 0 33 5 5 250 0 1038 193
test_unzip_compat /src/minizip-ng/test/test_compat.cc 1 ['unzFile'] 13 0 38 3 2 155 0 651 94
mz_stream_wzaes_open /src/minizip-ng/mz_strm_wzaes.c 3 ['void*', 'char*', 'int32_t'] 5 0 52 15 15 48 0 111 93
minizip_erase /src/minizip-ng/minizip.c 4 ['char*', 'char*', 'int32_t', 'char**'] 15 0 77 18 23 243 0 1076 50
minigzip_copy /src/minizip-ng/minigzip.c 4 ['char*', 'char*', 'int16_t', 'int16_t'] 6 0 55 12 11 55 0 111 45
mz_stream_split_write /src/minizip-ng/mz_strm_split.c 3 ['void*', 'void*', 'int32_t'] 7 0 32 9 12 31 0 81 38

Implementing fuzzers that target the above functions will improve reachability such that it becomes:

Functions statically reachable by fuzzers
49.0%
299 / 611
Cyclomatic complexity statically reachable by fuzzers
70.0%
1672 / 2381

All functions overview

If you implement fuzzers for these functions, the status of all functions in the project will be:

Func name Functions filename Args Function call depth Reached by Fuzzers Runtime reached by Fuzzers Combined reached by Fuzzers Fuzzers runtime hit Func lines hit % I Count BB Count Cyclomatic complexity Functions reached Reached by functions Accumulated cyclomatic complexity Undiscovered complexity

Fuzz driver synthesis

New fuzzers

The below fuzzers are templates and suggestions for how to target the set of optimal functions above

minizip.c

Target file: /src/minizip-ng/minizip.c
Target functions: minizip_extract, minizip_add, minizip_erase
#include "ada_fuzz_header.h"

int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
  af_safe_gb_init(data, size);

  /* target minizip_extract */
  char *new_var0 = ada_safe_get_char_p();
  char *new_var1 = ada_safe_get_char_p();
  char *new_var2 = ada_safe_get_char_p();
  char *new_var3 = ada_safe_get_char_p();
  UNKNOWN_TYPE unknown_4;
  minizip_extract(new_var0, new_var1, new_var2, new_var3, unknown_4);

  /* target minizip_add */
  char *new_var5 = ada_safe_get_char_p();
  char *new_var6 = ada_safe_get_char_p();
  UNKNOWN_TYPE unknown_7;
  UNKNOWN_TYPE unknown_8;
  char **new_var9 = af_get_double_char_p();
  minizip_add(new_var5, new_var6, unknown_7, unknown_8, new_var9);

  /* target minizip_erase */
  char *new_var14 = ada_safe_get_char_p();
  char *new_var15 = ada_safe_get_char_p();
  UNKNOWN_TYPE unknown_16;
  char **new_var17 = af_get_double_char_p();
  minizip_erase(new_var14, new_var15, unknown_16, new_var17);

  af_safe_gb_cleanup();
}

test_compat.cc

Target file: /src/minizip-ng/test/test_compat.cc
Target functions: test_unzip_compat
#include "ada_fuzz_header.h"

int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
  af_safe_gb_init(data, size);

  /* target test_unzip_compat */
  UNKNOWN_TYPE unknown_10;
  test_unzip_compat(unknown_10);

  af_safe_gb_cleanup();
}

mz_strm_wzaes.c

Target file: /src/minizip-ng/mz_strm_wzaes.c
Target functions: mz_stream_wzaes_open
#include "ada_fuzz_header.h"

int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
  af_safe_gb_init(data, size);

  /* target mz_stream_wzaes_open */
  UNKNOWN_TYPE unknown_11;
  char *new_var12 = ada_safe_get_char_p();
  UNKNOWN_TYPE unknown_13;
  mz_stream_wzaes_open(unknown_11, new_var12, unknown_13);

  af_safe_gb_cleanup();
}

minigzip.c

Target file: /src/minizip-ng/minigzip.c
Target functions: minigzip_copy
#include "ada_fuzz_header.h"

int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
  af_safe_gb_init(data, size);

  /* target minigzip_copy */
  char *new_var18 = ada_safe_get_char_p();
  char *new_var19 = ada_safe_get_char_p();
  UNKNOWN_TYPE unknown_20;
  UNKNOWN_TYPE unknown_21;
  minigzip_copy(new_var18, new_var19, unknown_20, unknown_21);

  af_safe_gb_cleanup();
}

mz_strm_split.c

Target file: /src/minizip-ng/mz_strm_split.c
Target functions: mz_stream_split_write
#include "ada_fuzz_header.h"

int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
  af_safe_gb_init(data, size);

  /* target mz_stream_split_write */
  UNKNOWN_TYPE unknown_22;
  UNKNOWN_TYPE unknown_23;
  UNKNOWN_TYPE unknown_24;
  mz_stream_split_write(unknown_22, unknown_23, unknown_24);

  af_safe_gb_cleanup();
}

Files and Directories in report

This section shows which files and directories are considered in this report. The main reason for showing this is fuzz introspector may include more code in the reasoning than is desired. This section helps identify if too many files/directories are included, e.g. third party code, which may be irrelevant for the threat model. In the event too much is included, fuzz introspector supports a configuration file that can exclude data from the report. See the following link for more information on how to create a config file: link

Files in report

Source file Reached by Covered by
/src/minizip-ng/mz_strm_mem.c ['unzip_fuzzer', 'zip_fuzzer'] ['unzip_fuzzer', 'zip_fuzzer']
/src/minizip-ng/mz_strm_bzip.c ['unzip_fuzzer', 'zip_fuzzer'] []
/src/minizip-ng/mz_strm_pkcrypt.c ['unzip_fuzzer', 'zip_fuzzer'] ['unzip_fuzzer', 'zip_fuzzer']
/src/minizip-ng/test/test_stream_crypt.cc [] []
/src/minizip-ng/mz_zip.c ['unzip_fuzzer', 'zip_fuzzer'] ['unzip_fuzzer', 'zip_fuzzer']
/src/minizip-ng/test/test_stream_compress.cc [] []
/src/minizip-ng/mz_os_win32.c [] []
/src/minizip-ng/test/test_stream.cc [] []
/src/minizip-ng/mz_crypt_winvista.c ['unzip_fuzzer', 'zip_fuzzer'] []
/src/minizip-ng/minigzip.c [] []
/src/minizip-ng/mz_strm_ppmd.c ['unzip_fuzzer', 'zip_fuzzer'] ['zip_fuzzer']
/src/minizip-ng/test/test_path.cc [] []
/src/minizip-ng/mz.h [] []
/src/minizip-ng/test/fuzz/unzip_fuzzer.c ['unzip_fuzzer'] ['unzip_fuzzer']
/src/minizip-ng/test/fuzz/standalone.c [] []
/src/minizip-ng/test/fuzz/zip_fuzzer.c ['zip_fuzzer'] ['zip_fuzzer']
/src/minizip-ng/mz_crypt.c ['unzip_fuzzer', 'zip_fuzzer'] ['unzip_fuzzer', 'zip_fuzzer']
/src/minizip-ng/mz_strm_os_win32.c [] []
/src/minizip-ng/mz_strm_zlib.c ['unzip_fuzzer', 'zip_fuzzer'] ['unzip_fuzzer', 'zip_fuzzer']
/src/minizip-ng/mz_crypt_openssl.c [] []
/src/minizip-ng/minizip.c [] []
/src/minizip-ng/mz_crypt_winxp.c [] []
/src/minizip-ng/mz_os_posix.c [] []
/src/minizip-ng/mz_strm_lzma.c ['unzip_fuzzer', 'zip_fuzzer'] []
/src/minizip-ng/compat/crypt.h [] []
/src/minizip-ng/mz_strm_split.c [] []
/src/minizip-ng/compat/zip.c [] []
/src/minizip-ng/compat/unzip.c [] []
/src/minizip-ng/compat/ioapi.c [] []
/src/minizip-ng/mz_strm_zstd.c ['unzip_fuzzer', 'zip_fuzzer'] []
/src/minizip-ng/test/test_crypt.cc [] []
/src/minizip-ng/mz_zip_rw.c [] []
/src/minizip-ng/mz_strm.c ['unzip_fuzzer', 'zip_fuzzer'] ['unzip_fuzzer', 'zip_fuzzer']
/src/minizip-ng/test/test_compat.cc [] []
/src/minizip-ng/mz_strm_libcomp.c ['unzip_fuzzer', 'zip_fuzzer'] []
/src/minizip-ng/test/test_encoding.cc [] []
/src/minizip-ng/mz_os.c [] []
/src/minizip-ng/mz_strm_buf.c [] []
/src/minizip-ng/mz_strm_wzaes.c ['unzip_fuzzer', 'zip_fuzzer'] ['unzip_fuzzer']

Directories in report

Directory
/src/minizip-ng/compat/
/src/minizip-ng/test/
/src/minizip-ng/
/src/minizip-ng/test/fuzz/