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

Fuzzer details

Fuzzer: dgif_target

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 3 3.61%
gold [1:9] 2 2.40%
yellow [10:29] 3 3.61%
greenyellow [30:49] 2 2.40%
lawngreen 50+ 73 87.9%
All colors 83 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
0 0 None 2 39 DGifOpen call site: 00003 /src/giflib-code/dgif_lib.c:187
0 0 None 2 2 DGifCloseFile call site: 00077 /src/giflib-code/dgif_lib.c:707
0 0 None 0 72 DGifGetImageHeader call site: 00024 /src/giflib-code/dgif_lib.c:366
0 0 None 0 63 DGifGetImageDesc call site: 00023 /src/giflib-code/dgif_lib.c:433
0 0 None 0 58 DGifGetLine call site: 00046 /src/giflib-code/dgif_lib.c:487
0 0 None 0 58 DGifGetLine call site: 00046 /src/giflib-code/dgif_lib.c:493
0 0 None 0 43 DGifGetScreenDesc call site: 00007 /src/giflib-code/dgif_lib.c:254
0 0 None 0 16 DGifSlurp call site: 00041 /src/giflib-code/dgif_lib.c:1204
0 0 None 0 16 DGifSlurp call site: 00044 /src/giflib-code/dgif_lib.c:1211
0 0 None 0 15 DGifGetExtension call site: 00062 /src/giflib-code/dgif_lib.c:572
0 0 None 0 5 DGifGetRecordType call site: 00021 /src/giflib-code/dgif_lib.c:329
0 0 None 0 0 DGifOpen call site: 00002 /src/giflib-code/dgif_lib.c:173

Runtime coverage analysis

Covered functions
31
Functions that are reachable but not covered
6
Reachable functions
39
Percentage of reachable functions covered
84.62%
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/dgif_target.cc 1
/src/dgif_fuzz_common.cc 2
/src/giflib-code/dgif_lib.c 21
/src/giflib-code/gifalloc.c 6
/src/giflib-code/openbsd-reallocarray.c 1

Fuzzer: egif_target

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 21 25.3%
gold [1:9] 0 0.0%
yellow [10:29] 0 0.0%
greenyellow [30:49] 0 0.0%
lawngreen 50+ 62 74.6%
All colors 83 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
2 2 1 :

['fwrite']

2 2 InternalWrite call site: 00028 /src/giflib-code/egif_lib.c:262
0 14 2 :

['GifFreeMapObject', 'GifMakeMapObject']

0 92 EGifPutImageDesc call site: 00043 /src/giflib-code/egif_lib.c:390
0 5 1 :

['InternalWrite']

0 36 EGifPutImageDesc call site: 00051 /src/giflib-code/egif_lib.c:419
0 0 None 124 472 rgb_to_gif(unsignedcharconst*,unsignedlong) call site: 00000 /src/egif_fuzz_common.cc:43
0 0 None 124 461 rgb_to_gif(unsignedcharconst*,unsignedlong) call site: 00000 /src/egif_fuzz_common.cc:62
0 0 None 124 458 rgb_to_gif(unsignedcharconst*,unsignedlong) call site: 00000 /src/egif_fuzz_common.cc:71
0 0 None 31 57 rgb_to_gif(unsignedcharconst*,unsignedlong) call site: 00000 /src/egif_fuzz_common.cc:131
0 0 None 31 57 rgb_to_gif(unsignedcharconst*,unsignedlong) call site: 00000 /src/egif_fuzz_common.cc:148
0 0 None 31 57 rgb_to_gif(unsignedcharconst*,unsignedlong) call site: 00000 /src/egif_fuzz_common.cc:168
0 0 None 31 34 rgb_to_gif(unsignedcharconst*,unsignedlong) call site: 00000 /src/egif_fuzz_common.cc:105
0 0 None 4 59 EGifPutScreenDesc call site: 00025 /src/giflib-code/egif_lib.c:286
0 0 None 2 13 EGifCloseFile call site: 00038 /src/giflib-code/egif_lib.c:770

Runtime coverage analysis

Covered functions
28
Functions that are reachable but not covered
10
Reachable functions
41
Percentage of reachable functions covered
75.61%
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/egif_target.cc 1
/src/egif_fuzz_common.cc 3
/src/giflib-code/gifalloc.c 3
/src/giflib-code/quantize.c 3
/src/giflib-code/egif_lib.c 13
/src/giflib-code/gif_hash.c 5
/src/giflib-code/qprintf.c 1
/src/giflib-code/gif_err.c 1

Fuzzer: dgif_protobuf_target

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 39 11.5%
gold [1:9] 2 0.59%
yellow [10:29] 5 1.47%
greenyellow [30:49] 1 0.29%
lawngreen 50+ 291 86.0%
All colors 338 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
7 15 3 :

['gifProtoFuzzer::GlobalColorTable::_internal_colors() const', 'void google::protobuf::internal::ArenaStringPtr::Set<>(std::__1::basic_string , std::__1::allocator > const&, google::protobuf::Arena*)', 'google::protobuf::MessageLite::GetArena() const']

11 19 gifProtoFuzzer::GlobalColorTable::MergeImpl(google::protobuf::MessageLite&,google::protobuf::MessageLiteconst&) call site: 00000 /src/genfiles/gif_fuzz_proto.pb.cc:1295
7 15 3 :

['gifProtoFuzzer::LocalColorTable::_internal_colors() const', 'void google::protobuf::internal::ArenaStringPtr::Set<>(std::__1::basic_string , std::__1::allocator > const&, google::protobuf::Arena*)', 'google::protobuf::MessageLite::GetArena() const']

11 19 gifProtoFuzzer::LocalColorTable::MergeImpl(google::protobuf::MessageLite&,google::protobuf::MessageLiteconst&) call site: 00000 /src/genfiles/gif_fuzz_proto.pb.cc:2494
6 6 1 :

['google::protobuf::internal::ArenaStringPtr::ClearNonDefaultToEmpty()']

8 8 gifProtoFuzzer::LocalColorTable::Clear() call site: 00000 /src/genfiles/gif_fuzz_proto.pb.cc:2421
0 0 3 :

['std::__1::basic_ofstream >::basic_ofstream(char const*, unsigned int)', 'std::__1::basic_ostream >::write(char const*, long)', 'std::__1::basic_ofstream >::~basic_ofstream()']

4 235 TestOneProtoInput(gifProtoFuzzer::GifProtoconst&) call site: 00000 /src/dgif_protobuf_target.cc:19
0 0 None 4 4 gifProtoFuzzer::LogicalScreenDescriptor::MergeImpl(google::protobuf::MessageLite&,google::protobuf::MessageLiteconst&) call site: 00000 /src/genfiles/gif_fuzz_proto.pb.cc:1027
0 0 None 4 4 gifProtoFuzzer::ImageDescriptor::MergeImpl(google::protobuf::MessageLite&,google::protobuf::MessageLiteconst&) call site: 00000 /src/genfiles/gif_fuzz_proto.pb.cc:1628
0 0 None 4 4 gifProtoFuzzer::ImageData::MergeImpl(google::protobuf::MessageLite&,google::protobuf::MessageLiteconst&) call site: 00000 /src/genfiles/gif_fuzz_proto.pb.cc:3065
0 0 None 4 4 gifProtoFuzzer::Header::MergeImpl(google::protobuf::MessageLite&,google::protobuf::MessageLiteconst&) call site: 00000 /src/genfiles/gif_fuzz_proto.pb.cc:4235
0 0 None 2 39 DGifOpen call site: 00226 /src/giflib-code/dgif_lib.c:187
0 0 None 2 2 gifProtoFuzzer::ImageDescriptor::Clear() call site: 00000 /src/genfiles/gif_fuzz_proto.pb.cc:1491
0 0 None 2 2 DGifCloseFile call site: 00300 /src/giflib-code/dgif_lib.c:707
0 0 None 0 72 DGifGetImageHeader call site: 00247 /src/giflib-code/dgif_lib.c:366

Runtime coverage analysis

Covered functions
251
Functions that are reachable but not covered
96
Reachable functions
356
Percentage of reachable functions covered
73.03%
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/dgif_protobuf_target.cc 2
/src/genfiles/gif_fuzz_proto.pb.h 82
/src/genfiles/gif_fuzz_proto.pb.cc 10
/src/LPM/external.protobuf/include/google/protobuf/message.h 2
/src/LPM/external.protobuf/include/google/protobuf/message_lite.h 4
/src/LPM/external.protobuf/include/google/protobuf/metadata_lite.h 2
/src/LPM/external.protobuf/include/google/protobuf/internal_visibility.h 1
/src/LPM/external.protobuf/include/google/protobuf/repeated_ptr_field.h 28
/src/./ProtoToGif.h 2
/src/ProtoToGif.cpp 22
/src/LPM/external.protobuf/include/google/protobuf/arenastring.h 2
/src/dgif_fuzz_common.cc 2
/src/giflib-code/dgif_lib.c 21
/src/giflib-code/gifalloc.c 6
/src/giflib-code/openbsd-reallocarray.c 1

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
gifProtoFuzzer::GifProto::CopyFrom(gifProtoFuzzer::GifProtoconst&) /src/genfiles/gif_fuzz_proto.pb.cc 2 ['N/A', 'N/A'] 15 0 32 6 3 236 0 538 500
gifProtoFuzzer::ImageChunk::CopyFrom(gifProtoFuzzer::ImageChunkconst&) /src/genfiles/gif_fuzz_proto.pb.cc 2 ['N/A', 'N/A'] 16 0 32 6 3 234 0 504 158
gifProtoFuzzer::GifProto::IsInitializedImpl(google::protobuf::MessageLiteconst&) /src/genfiles/gif_fuzz_proto.pb.cc 1 ['N/A'] 9 0 152 23 10 118 0 169 145
gifProtoFuzzer::GifProto::ByteSizeLong()const /src/genfiles/gif_fuzz_proto.pb.cc 1 ['N/A'] 8 0 199 22 8 188 0 247 144
gifProtoFuzzer::GifProto::GifProto(google::protobuf::Arena*,gifProtoFuzzer::GifProtoconst&) /src/genfiles/gif_fuzz_proto.pb.cc 3 ['N/A', 'N/A', 'N/A'] 18 0 315 38 37 178 0 486 46
fuzz_dgif_ala_android(unsignedcharconst*,unsignedlong) /src/dgif_fuzz_common.cc 2 ['N/A', 'size_t'] 6 0 468 56 22 47 0 291 35

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

Functions statically reachable by fuzzers
67.0%
440 / 656
Cyclomatic complexity statically reachable by fuzzers
71.0%
1822 / 2550

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

Fuzz engine guidance

This sections provides heuristics that can be used as input to a fuzz engine when running a given fuzz target. The current focus is on providing input that is usable by libFuzzer.

/src/dgif_target.cc

Dictionary

Use this with the libFuzzer -dict=DICT.file flag


Fuzzer function priority

Use one of these functions as input to libfuzzer with flag: -focus_function name

-focus_function=['DGifGetImageDesc', 'DGifDecreaseImageCounter', 'DGifSlurp']

/src/egif_target.cc

Dictionary

Use this with the libFuzzer -dict=DICT.file flag


Fuzzer function priority

Use one of these functions as input to libfuzzer with flag: -focus_function name

-focus_function=['stub_output_writer(GifFileType*, unsigned char const*, int)', 'EGifPutScreenDesc', 'EGifCompressOutput', 'EGifCompressLine', 'rgb_to_gif(unsigned char const*, unsigned long)', 'GifMakeMapObject', 'SubdivColorMap', 'EGifCloseFile', 'EGifPutImageDesc']

/src/dgif_protobuf_target.cc

Dictionary

Use this with the libFuzzer -dict=DICT.file flag


Fuzzer function priority

Use one of these functions as input to libfuzzer with flag: -focus_function name

-focus_function=['gifProtoFuzzer::ProtoConverter::visit(gifProtoFuzzer::GifProto const&)', 'gifProtoFuzzer::ProtoConverter::visit(gifProtoFuzzer::GifProto const&)', 'gifProtoFuzzer::GifProto::SharedDtor(google::protobuf::MessageLite&)', 'gifProtoFuzzer::GifProto::GifProto(google::protobuf::Arena*)', 'gifProtoFuzzer::ProtoConverter::visit(gifProtoFuzzer::ImageData const&)', 'gifProtoFuzzer::GifProto::GifProto(google::protobuf::Arena*)', 'gifProtoFuzzer::GifProto::SharedCtor(google::protobuf::Arena*)', 'gifProtoFuzzer::ProtoConverter::visit(gifProtoFuzzer::ImageData const&)', 'gifProtoFuzzer::GifProto::SharedCtor(google::protobuf::Arena*)']

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
[] []
/usr/local/bin/../include/c++/v1/sstream [] []
/src/giflib-code/gif_err.c ['egif_target'] []
/src/LPM/external.protobuf/include/google/protobuf/repeated_ptr_field.h ['dgif_protobuf_target'] ['dgif_protobuf_target']
/src/LPM/external.protobuf/include/google/protobuf/internal_visibility.h ['dgif_protobuf_target'] []
/src/giflib-code/quantize.c ['egif_target'] ['egif_target']
/src/dgif_target.cc ['dgif_target'] ['dgif_target']
/src/dgif_fuzz_common.cc ['dgif_target', 'dgif_protobuf_target'] ['dgif_target', 'dgif_protobuf_target']
/src/giflib-code/dgif_lib.c ['dgif_target', 'dgif_protobuf_target'] ['dgif_target', 'dgif_protobuf_target']
/src/LPM/external.protobuf/include/google/protobuf/arena_align.h [] []
/src/dgif_protobuf_target.cc ['dgif_protobuf_target'] ['dgif_protobuf_target']
/src/./ProtoToGif.h ['dgif_protobuf_target'] []
/src/LPM/external.protobuf/include/google/protobuf/arenastring.h ['dgif_protobuf_target'] ['dgif_protobuf_target']
/src/egif_target.cc ['egif_target'] ['egif_target']
/src/LPM/external.protobuf/include/google/protobuf/message.h ['dgif_protobuf_target'] ['dgif_protobuf_target']
/src/giflib-code/gifalloc.c ['dgif_target', 'egif_target', 'dgif_protobuf_target'] ['dgif_target', 'egif_target', 'dgif_protobuf_target']
/src/giflib-code/egif_lib.c ['egif_target'] ['egif_target']
/src/LPM/external.protobuf/include/google/protobuf/message_lite.h ['dgif_protobuf_target'] ['dgif_protobuf_target']
/src/giflib-code/gif_hash.c ['egif_target'] ['egif_target']
/src/genfiles/gif_fuzz_proto.pb.cc ['dgif_protobuf_target'] ['dgif_protobuf_target']
/src/LPM/external.protobuf/include/google/protobuf/generated_message_util.h [] []
/src/LPM/external.protobuf/include/absl/log/internal/nullstream.h [] []
/src/giflib-code/openbsd-reallocarray.c ['dgif_target', 'dgif_protobuf_target'] ['dgif_target', 'dgif_protobuf_target']
/src/LPM/external.protobuf/include/google/protobuf/metadata_lite.h ['dgif_protobuf_target'] ['dgif_protobuf_target']
/src/giflib-code/gif_font.c [] []
/src/LPM/external.protobuf/include/google/protobuf/port.h [] []
/src/LPM/external.protobuf/include/google/protobuf/generated_message_bases.h [] []
/src/egif_fuzz_common.cc ['egif_target'] ['egif_target']
/src/LPM/external.protobuf/include/google/protobuf/wire_format_lite.h [] []
/src/LPM/external.protobuf/include/absl/numeric/bits.h [] []
/src/LPM/external.protobuf/include/google/protobuf/arena.h [] []
/src/LPM/external.protobuf/include/google/protobuf/io/coded_stream.h [] []
/src/giflib-code/qprintf.c ['egif_target'] []
/src/genfiles/gif_fuzz_proto.pb.h ['dgif_protobuf_target'] ['dgif_protobuf_target']
/src/ProtoToGif.cpp ['dgif_protobuf_target'] ['dgif_protobuf_target']
/src/LPM/external.protobuf/include/google/protobuf/unknown_field_set.h [] []

Directories in report

Directory
/src/
/src/genfiles/
/src/giflib-code/
/src/LPM/external.protobuf/include/absl/numeric/
/src/LPM/external.protobuf/include/absl/log/internal/
/usr/local/bin/../include/c++/v1/
/src/./
/src/LPM/external.protobuf/include/google/protobuf/
/src/LPM/external.protobuf/include/google/protobuf/io/