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

Fuzzer details

Fuzzer: libpng_read_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 387 56.4%
gold [1:9] 14 2.04%
yellow [10:29] 10 1.45%
greenyellow [30:49] 11 1.60%
lawngreen 50+ 264 38.4%
All colors 686 100

Fuzz blockers

The followings are the branches where fuzzer fails to bypass.

Unique non-covered Complexity Unique Reachable Complexities Unique Reachable Functions All non-covered Complexity All Reachable Complexity Function Name Function Callsite Blocked Branch
105 225 3 :

['OSS_FUZZ_png_destroy_read_struct', 'OSS_FUZZ_png_image_error', 'OSS_FUZZ_png_destroy_info_struct']

105 225 png_image_read_init call site: 00472 /src/libpng/pngread.c:1144
105 105 1 :

['OSS_FUZZ_png_image_error']

105 105 OSS_FUZZ_png_image_begin_read_from_memory call site: 00460 /src/libpng/pngread.c:1434
105 105 1 :

['OSS_FUZZ_png_image_error']

105 105 OSS_FUZZ_png_image_finish_read call site: 00495 /src/libpng/pngread.c:4031
104 203 7 :

['OSS_FUZZ_png_reciprocal2', 'OSS_FUZZ_png_gamma_correct', 'OSS_FUZZ_png_error', 'OSS_FUZZ_png_warning', 'OSS_FUZZ_png_reciprocal', 'OSS_FUZZ_png_gamma_8bit_correct', 'OSS_FUZZ_png_gamma_significant']

104 203 OSS_FUZZ_png_init_read_transformations call site: 00278 /src/libpng/pngrtran.c:1665
100 100 1 :

['png_cache_unknown_chunk']

185 257 OSS_FUZZ_png_handle_unknown call site: 00154 /src/libpng/pngrutil.c:2897
99 99 1 :

['OSS_FUZZ_png_set_rgb_coefficients']

203 438 OSS_FUZZ_png_init_read_transformations call site: 00238 /src/libpng/pngrtran.c:1506
91 91 1 :

['png_do_compose']

222 297 OSS_FUZZ_png_do_read_transformations call site: 00410 /src/libpng/pngrtran.c:4949
71 71 2 :

['OSS_FUZZ_png_set_strip_alpha', 'OSS_FUZZ_png_set_background_fixed']

78 1941 png_image_read_direct call site: 00633 /src/libpng/pngread.c:3689
50 50 2 :

['OSS_FUZZ_png_app_error', 'OSS_FUZZ_png_app_warning']

50 50 unsupported_gamma call site: 00586 /src/libpng/pngrtran.c:338
40 40 1 :

['OSS_FUZZ_png_set_rgb_to_gray_fixed']

152 2152 png_image_read_direct call site: 00624 /src/libpng/pngread.c:3564
34 34 1 :

['OSS_FUZZ_png_set_expand_16']

112 2009 png_image_read_direct call site: 00630 /src/libpng/pngread.c:3673
27 37 2 :

['OSS_FUZZ_png_warning', 'png_do_rgb_to_gray']

249 359 OSS_FUZZ_png_do_read_transformations call site: 00406 /src/libpng/pngrtran.c:4887

Runtime coverage analysis

Covered functions
212
Functions that are reachable but not covered
63
Reachable functions
196
Percentage of reachable functions covered
67.86%
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
/src/libpng/contrib/oss-fuzz/libpng_read_fuzzer.cc 3
/src/libpng/png.c 33
/src/libpng/pngread.c 32
/src/libpng/pngmem.c 10
/src/libpng/pngerror.c 20
/src/libpng/pngrio.c 2
/src/libpng/pngrtran.c 38
/src/libpng/pngrutil.c 23
/src/libpng/pngset.c 5
/src/libpng/pngget.c 3
/src/libpng/pngtrans.c 13

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
png_handle_iCCP /src/libpng/pngrutil.c 3 ['N/A', 'N/A', 'int'] 9 0 547 79 28 41 0 261 93
png_handle_iTXt /src/libpng/pngrutil.c 3 ['N/A', 'N/A', 'int'] 8 0 499 83 29 36 0 238 87
OSS_FUZZ_png_set_sCAL /src/libpng/pngset.c 5 ['N/A', 'N/A', 'int', 'double', 'double'] 5 0 67 9 4 18 0 124 81
OSS_FUZZ_png_set_quantize /src/libpng/pngrtran.c 6 ['N/A', 'N/A', 'int', 'int', 'N/A', 'int'] 6 0 1626 190 58 14 0 113 58
OSS_FUZZ_png_read_png /src/libpng/pngread.c 4 ['N/A', 'N/A', 'int', 'N/A'] 12 0 384 67 22 132 0 1318 46
png_handle_pCAL /src/libpng/pngrutil.c 3 ['N/A', 'N/A', 'int'] 8 0 498 64 23 27 0 159 43
OSS_FUZZ_png_check_keyword /src/libpng/pngset.c 3 ['N/A', 'N/A', 'N/A'] 3 0 246 46 17 7 0 65 39
OSS_FUZZ_png_set_cHRM_XYZ /src/libpng/pngset.c 11 ['N/A', 'N/A', 'double', 'double', 'double', 'double', 'double', 'double', 'double', 'double', 'double'] 6 0 74 3 2 14 0 70 39

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

Functions statically reachable by fuzzers
56.0%
225 / 401
Cyclomatic complexity statically reachable by fuzzers
72.0%
2314 / 3197

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 Fuzzers runtime hit Func lines hit % I Count BB Count Cyclomatic complexity Functions reached Reached by functions Accumulated cyclomatic complexity Undiscovered complexity

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/libpng/pngtrans.c ['libpng_read_fuzzer'] ['libpng_read_fuzzer']
/src/libpng/pngset.c ['libpng_read_fuzzer'] ['libpng_read_fuzzer']
/src/libpng/png.c ['libpng_read_fuzzer'] ['libpng_read_fuzzer']
/src/libpng/contrib/oss-fuzz/libpng_read_fuzzer.cc ['libpng_read_fuzzer'] ['libpng_read_fuzzer']
/src/libpng/pngrutil.c ['libpng_read_fuzzer'] ['libpng_read_fuzzer']
/src/libpng/pngget.c ['libpng_read_fuzzer'] ['libpng_read_fuzzer']
/src/libpng/pngread.c ['libpng_read_fuzzer'] ['libpng_read_fuzzer']
/src/libpng/pngerror.c ['libpng_read_fuzzer'] ['libpng_read_fuzzer']
/usr/local/bin/../include/c++/v1/stdexcept [] []
/src/libpng/pngrtran.c ['libpng_read_fuzzer'] ['libpng_read_fuzzer']
/src/libpng/pngmem.c ['libpng_read_fuzzer'] ['libpng_read_fuzzer']
/src/libpng/pngrio.c ['libpng_read_fuzzer'] ['libpng_read_fuzzer']

Directories in report

Directory
/usr/local/bin/../include/c++/v1/
/src/libpng/
/src/libpng/contrib/oss-fuzz/