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

Fuzzer details

Fuzzer: unpack_pack_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 21 9.76%
gold [1:9] 8 3.72%
yellow [10:29] 0 0.0%
greenyellow [30:49] 1 0.46%
lawngreen 50+ 185 86.0%
All colors 215 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
6 6 3 :

['ntohs', 'ntohl', '__bswap_64(unsigned long)']

6 96 voidmsgpack::v1::packer ::pack_imp_int64 (long) call site: 00000 /src/msgpack-c/include/msgpack/v1/pack.hpp:1621
2 2 1 :

['ntohl']

2 24 msgpack::v1::packer ::pack_str(unsignedint) call site: 00000 /src/msgpack-c/include/msgpack/v1/pack.hpp:1264
2 2 1 :

['ntohl']

2 24 msgpack::v1::packer ::pack_bin(unsignedint) call site: 00000 /src/msgpack-c/include/msgpack/v1/pack.hpp:1318
2 2 1 :

['ntohl']

2 24 msgpack::v1::packer ::pack_ext(unsignedlong,signedchar) call site: 00000 /src/msgpack-c/include/msgpack/v1/pack.hpp:1378
2 2 1 :

['ntohl']

2 24 msgpack::v1::packer ::pack_array(unsignedint) call site: 00000 /src/msgpack-c/include/msgpack/v1/pack.hpp:1222
2 2 1 :

['ntohl']

2 24 msgpack::v1::packer ::pack_map(unsignedint) call site: 00000 /src/msgpack-c/include/msgpack/v1/pack.hpp:1241
0 2 1 :

['msgpack::v2::detail::create_object_visitor::set_referenced(bool)']

0 2 msgpack::v2::detail::create_object_visitor::visit_str(charconst*,unsignedint) call site: 00000 /src/msgpack-c/include/msgpack/v2/create_object_visitor.hpp:114
0 2 1 :

['msgpack::v2::detail::create_object_visitor::set_referenced(bool)']

0 2 msgpack::v2::detail::create_object_visitor::visit_ext(charconst*,unsignedint) call site: 00000 /src/msgpack-c/include/msgpack/v2/create_object_visitor.hpp:162
0 2 1 :

['msgpack::v2::detail::create_object_visitor::set_referenced(bool)']

0 2 msgpack::v2::detail::create_object_visitor::visit_bin(charconst*,unsignedint) call site: 00000 /src/msgpack-c/include/msgpack/v2/create_object_visitor.hpp:138
0 0 None 6 6 msgpack::v1::zone::allocate_expand(unsignedlong) call site: 00000 /src/msgpack-c/include/msgpack/v1/detail/cpp11_zone.hpp:277
0 0 None 0 1585 msgpack::v2::detail::context >::execute(charconst*,unsignedlong,unsignedlong&) call site: 00000 /src/msgpack-c/include/msgpack/v2/parse.hpp:481
0 0 None 0 1585 msgpack::v2::detail::context >::execute(charconst*,unsignedlong,unsignedlong&) call site: 00000 /src/msgpack-c/include/msgpack/v2/parse.hpp:523

Runtime coverage analysis

Covered functions
160
Functions that are reachable but not covered
32
Reachable functions
179
Percentage of reachable functions covered
82.12%
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/msgpack-c/fuzz/unpack_pack_fuzzer.cpp 1
/src/msgpack-c/include/msgpack/v1/unpack_decl.hpp 4
/src/msgpack-c/include/msgpack/v3/unpack.hpp 2
/src/msgpack-c/include/msgpack/v2/object_fwd.hpp 1
/src/msgpack-c/include/msgpack/v1/object.hpp 8
/src/msgpack-c/include/msgpack/v1/detail/cpp11_zone.hpp 4
/src/msgpack-c/include/msgpack/v2/unpack.hpp 1
/src/msgpack-c/include/msgpack/v2/create_object_visitor.hpp 18
/src/msgpack-c/include/msgpack/v2/parse.hpp 13
/src/msgpack-c/include/msgpack/v1/unpack_exception.hpp 7
/src/msgpack-c/include/msgpack/v1/unpack.hpp 8
/usr/include/x86_64-linux-gnu/bits/byteswap.h 1
/src/msgpack-c/include/msgpack/v1/sbuffer.hpp 2
/src/msgpack-c/include/msgpack/v1/pack.hpp 2
/src/msgpack-c/include/msgpack/v1/adaptor/adaptor_base.hpp 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
voidmsgpack::v1::object_parser::parse >(msgpack::v1::object_pack_visitor &) /src/msgpack-c/include/msgpack/v1/object.hpp 2 ['N/A', 'N/A'] 8 0 365 64 20 117 0 206 190
msgpack::v2::parse_returnmsgpack::v2::detail::context >::start_aggregate >::map_sv,msgpack::v2::detail::context >::map_ev>(msgpack::v2::detail::context >::map_svconst&,msgpack::v2::detail::context >::map_evconst&,charconst*,unsignedlong&) /src/msgpack-c/include/msgpack/v2/parse.hpp 5 ['N/A', 'N/A', 'N/A', 'N/A', 'N/A'] 6 0 159 17 8 45 0 67 41

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

Functions statically reachable by fuzzers
71.0%
135 / 189
Cyclomatic complexity statically reachable by fuzzers
74.0%
504 / 679

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/msgpack-c/fuzz/unpack_pack_fuzzer.cpp

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=['msgpack::v2::detail::context >::execute(char const*, unsigned long, unsigned long&)', 'msgpack::v2::detail::context >::execute(char const*, unsigned long, unsigned long&)', 'msgpack::v2::detail::context >::execute(char const*, unsigned long, unsigned long&)', 'msgpack::v2::detail::context >::execute(char const*, unsigned long, unsigned long&)', 'msgpack::v2::parse_return msgpack::v2::detail::parse_imp(char const*, unsigned long, unsigned long&, msgpack::v2::detail::create_object_visitor&)', 'msgpack::v3::unpack(char const*, unsigned long, unsigned long&, bool&, bool (*)(msgpack::v1::type::object_type, unsigned long, void*), void*, msgpack::v1::unpack_limit const&)', 'msgpack::v2::detail::unpack_imp(char const*, unsigned long, unsigned long&, msgpack::v1::zone&, msgpack::v2::object&, bool&, bool (*)(msgpack::v1::type::object_type, unsigned long, void*), void*, msgpack::v1::unpack_limit const&)', 'msgpack::v2::detail::parse_helper::parse_helper(msgpack::v2::detail::create_object_visitor&)', 'msgpack::v1::size_overflow::size_overflow(char const*)', 'msgpack::v1::ext_size_overflow::ext_size_overflow(char const*)']

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/msgpack-c/include/msgpack/v1/unpack.hpp ['unpack_pack_fuzzer'] ['unpack_pack_fuzzer']
/src/msgpack-c/fuzz/unpack_pack_fuzzer.cpp ['unpack_pack_fuzzer'] ['unpack_pack_fuzzer']
/src/msgpack-c/include/msgpack/v1/sbuffer.hpp ['unpack_pack_fuzzer'] ['unpack_pack_fuzzer']
/usr/include/x86_64-linux-gnu/bits/byteswap.h ['unpack_pack_fuzzer'] []
/src/msgpack-c/include/msgpack/v2/unpack.hpp ['unpack_pack_fuzzer'] ['unpack_pack_fuzzer']
/src/msgpack-c/include/msgpack/v2/object_fwd.hpp ['unpack_pack_fuzzer'] ['unpack_pack_fuzzer']
/src/msgpack-c/include/msgpack/v1/unpack_decl.hpp ['unpack_pack_fuzzer'] ['unpack_pack_fuzzer']
/src/msgpack-c/include/msgpack/v2/parse.hpp ['unpack_pack_fuzzer'] ['unpack_pack_fuzzer']
/usr/local/bin/../include/c++/v1/stdexcept [] []
/src/msgpack-c/include/msgpack/v1/unpack_exception.hpp ['unpack_pack_fuzzer'] ['unpack_pack_fuzzer']
/src/msgpack-c/include/msgpack/v1/adaptor/adaptor_base.hpp ['unpack_pack_fuzzer'] ['unpack_pack_fuzzer']
/src/msgpack-c/include/msgpack/v3/unpack.hpp ['unpack_pack_fuzzer'] ['unpack_pack_fuzzer']
/usr/include/boost/none_t.hpp [] []
/src/msgpack-c/include/msgpack/v1/object.hpp ['unpack_pack_fuzzer'] ['unpack_pack_fuzzer']
/src/msgpack-c/include/msgpack/v1/object_fwd.hpp [] []
/src/msgpack-c/include/msgpack/v1/pack.hpp ['unpack_pack_fuzzer'] ['unpack_pack_fuzzer']
/src/msgpack-c/include/msgpack/v2/create_object_visitor.hpp ['unpack_pack_fuzzer'] ['unpack_pack_fuzzer']
/src/msgpack-c/include/msgpack/v1/detail/cpp11_zone.hpp ['unpack_pack_fuzzer'] ['unpack_pack_fuzzer']
/usr/include/boost/optional/optional.hpp [] []
/src/msgpack-c/include/msgpack/v1/adaptor/check_container_size.hpp [] []

Directories in report

Directory
/src/msgpack-c/fuzz/
/src/msgpack-c/include/msgpack/v1/
/src/msgpack-c/include/msgpack/v3/
/usr/local/bin/../include/c++/v1/
/src/msgpack-c/include/msgpack/v1/adaptor/
/usr/include/x86_64-linux-gnu/bits/
/src/msgpack-c/include/msgpack/v2/
/usr/include/boost/optional/
/usr/include/boost/
/src/msgpack-c/include/msgpack/v1/detail/