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 259 27.5%
gold [1:9] 53 5.63%
yellow [10:29] 44 4.68%
greenyellow [30:49] 17 1.80%
lawngreen 50+ 567 60.3%
All colors 940 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
274 317 8 :

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

274 317 OSS_FUZZ_png_init_read_transformations call site: 00729 /src/libpng/pngrtran.c:1574
97 97 1 :

['png_cache_unknown_chunk']

183 255 OSS_FUZZ_png_handle_unknown call site: 00203 /src/libpng/pngrutil.c:3031
91 91 1 :

['png_do_compose']

262 297 OSS_FUZZ_png_do_read_transformations call site: 00864 /src/libpng/pngrtran.c:4875
43 43 1 :

['OSS_FUZZ_png_colorspace_set_rgb_coefficients']

317 390 OSS_FUZZ_png_init_read_transformations call site: 00721 /src/libpng/pngrtran.c:1432
27 37 2 :

['OSS_FUZZ_png_warning', 'png_do_rgb_to_gray']

289 359 OSS_FUZZ_png_do_read_transformations call site: 00860 /src/libpng/pngrtran.c:4813
25 47 2 :

['OSS_FUZZ_png_app_warning', 'OSS_FUZZ_png_chunk_warning']

208 326 OSS_FUZZ_png_handle_unknown call site: 00193 /src/libpng/pngrutil.c:2956
25 25 1 :

['OSS_FUZZ_png_app_error']

25 25 OSS_FUZZ_png_read_update_info call site: 00713 /src/libpng/pngread.c:273
25 25 1 :

['OSS_FUZZ_png_app_error']

25 25 png_rtran_ok call site: 00703 /src/libpng/pngrtran.c:118
21 21 1 :

['png_do_gamma']

171 206 OSS_FUZZ_png_do_read_transformations call site: 00865 /src/libpng/pngrtran.c:4880
19 19 1 :

['png_do_encode_alpha']

133 168 OSS_FUZZ_png_do_read_transformations call site: 00867 /src/libpng/pngrtran.c:4911
19 19 1 :

['png_do_read_filler']

31 31 OSS_FUZZ_png_do_read_transformations call site: 00882 /src/libpng/pngrtran.c:4997
17 17 1 :

['OSS_FUZZ_png_do_strip_channel']

150 185 OSS_FUZZ_png_do_read_transformations call site: 00866 /src/libpng/pngrtran.c:4902

Runtime coverage analysis

Covered functions
180
Functions that are reachable but not covered
53
Reachable functions
222
Percentage of reachable functions covered
76.13%
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
/src/libpng/contrib/oss-fuzz/libpng_read_fuzzer.cc 3
/src/libpng/png.c 55
/src/libpng/pngread.c 9
/src/libpng/pngmem.c 11
/src/libpng/pngerror.c 18
/src/libpng/pngrio.c 2
/src/libpng/pngrtran.c 28
/src/libpng/pngrutil.c 51
/src/libpng/pngset.c 16
/src/libpng/pngget.c 2
/src/libpng/pngtrans.c 8

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
OSS_FUZZ_png_image_finish_read /src/libpng/pngread.c 5 ['struct.png_image *', 'struct.png_color_struct *', 'char *', 'int ', 'char *'] 8 0 310 49 19 152 0 1488 371
OSS_FUZZ_png_set_quantize /src/libpng/pngrtran.c 6 ['struct.png_struct_def *', 'struct.png_color_struct *', 'int ', 'int ', 'N/A', 'int '] 3 0 1647 190 58 15 0 116 60
OSS_FUZZ_png_set_sCAL /src/libpng/pngset.c 5 ['struct.png_struct_def *', 'struct.png_info_def *', 'int ', 'N/A', 'N/A'] 3 0 67 9 4 18 0 125 56
OSS_FUZZ_png_set_cHRM_XYZ /src/libpng/pngset.c 11 ['struct.png_struct_def *', 'struct.png_info_def *', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A'] 5 0 74 3 2 27 0 225 50
OSS_FUZZ_png_read_png /src/libpng/pngread.c 4 ['struct.png_struct_def *', 'struct.png_info_def *', 'int ', 'char *'] 6 0 385 67 22 202 0 2038 46
OSS_FUZZ_png_check_keyword /src/libpng/pngset.c 3 ['struct.png_struct_def *', 'char *', 'char *'] 2 0 246 46 17 7 0 65 39

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

Functions statically reachable by fuzzers
67.0%
262 / 393
Cyclomatic complexity statically reachable by fuzzers
83.0%
2714 / 3259

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

Directories in report

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