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: fuzz_parsers

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 562 47.2%
gold [1:9] 15 1.26%
yellow [10:29] 14 1.17%
greenyellow [30:49] 4 0.33%
lawngreen 50+ 594 49.9%
All colors 1189 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
8 8 4 :

['__cxa_allocate_exception', '__cxa_free_exception', '__cxa_throw', 'std::runtime_error::runtime_error(char const*)']

8 8 Pistache::Http::Mime::Q::Q(unsignedshort) call site: 00000 /src/pistache/src/../include/pistache/mime.h:100
8 8 4 :

['__cxa_allocate_exception', '__cxa_free_exception', '__cxa_throw', 'std::runtime_error::runtime_error(char const*)']

8 8 Pistache::Http::Header::Registry::registerHeader(std::__1::basic_string ,std::__1::allocator >const&,std::__1::function >()>) call site: 00000 /src/pistache/src/common/http_headers.cc:165
8 8 4 :

['__cxa_allocate_exception', '__cxa_free_exception', '__cxa_throw', 'std::runtime_error::runtime_error(char const*)']

8 8 Pistache::Http::Header::Registry::makeHeader(std::__1::basic_string ,std::__1::allocator >const&) call site: 00000 /src/pistache/src/common/http_headers.cc:189
6 6 5 :

['std::__1::unique_ptr ::reset[abi:ne180100](unsigned char*)', 'malloc', '__cxa_allocate_exception', 'std::bad_alloc::bad_alloc()', '__cxa_throw']

16 16 std::__1::basic_string ,std::__1::allocator >const*date::detail::scan_keyword ,std::__1::basic_string ,std::__1::allocator >const*>(std::__1::basic_istream >&,std::__1::basic_string ,std::__1::allocator >const*,std::__1::basic_string ,std::__1::allocator >const*) call site: 00000 /src/pistache/src/../subprojects/hinnant-date/include/date/date.h:4922
4 11 2 :

['std::__1::optional ::operator*[abi:ne180100]() const &', 'Pistache::Http::Mime::Q::toString() const']

4 11 Pistache::Http::Mime::MediaType::toString()const call site: 00000 /src/pistache/src/common/mime.cc:347
4 4 1 :

['std::invalid_argument::invalid_argument[abi:ne180100](char const*)']

10 10 Pistache::Port::Port(std::__1::basic_string ,std::__1::allocator >const&) call site: 00000 /src/pistache/src/common/net.cc:56
2 2 1 :

['strncmp']

2 11 Pistache::match_string(charconst*,unsignedlong,Pistache::StreamCursor&,Pistache::CaseSensitivity) call site: 00000 /src/pistache/src/common/stream.cc:238
0 0 None 746 2796 std::__1::basic_istream >&date::from_stream ,std::__1::chrono::duration >,std::__1::allocator >(std::__1::basic_istream >&,charconst*,date::fields >>&,std::__1::basic_string ,std::__1::allocator >*,std::__1::chrono::duration >*) call site: 00000 /src/pistache/src/../subprojects/hinnant-date/include/date/date.h:6627
0 0 None 746 2796 std::__1::basic_istream >&date::from_stream ,std::__1::chrono::duration >,std::__1::allocator >(std::__1::basic_istream >&,charconst*,date::fields >>&,std::__1::basic_string ,std::__1::allocator >*,std::__1::chrono::duration >*) call site: 00000 /src/pistache/src/../subprojects/hinnant-date/include/date/date.h:6709
0 0 None 746 2796 std::__1::basic_istream >&date::from_stream ,std::__1::chrono::duration >,std::__1::allocator >(std::__1::basic_istream >&,charconst*,date::fields >>&,std::__1::basic_string ,std::__1::allocator >*,std::__1::chrono::duration >*) call site: 00000 /src/pistache/src/../subprojects/hinnant-date/include/date/date.h:6955
0 0 None 746 2796 std::__1::basic_istream >&date::from_stream ,std::__1::chrono::duration >,std::__1::allocator >(std::__1::basic_istream >&,charconst*,date::fields >>&,std::__1::basic_string ,std::__1::allocator >*,std::__1::chrono::duration >*) call site: 00000 /src/pistache/src/../subprojects/hinnant-date/include/date/date.h:7291
0 0 None 746 2796 std::__1::basic_istream >&date::from_stream ,std::__1::chrono::duration >,std::__1::allocator >(std::__1::basic_istream >&,charconst*,date::fields >>&,std::__1::basic_string ,std::__1::allocator >*,std::__1::chrono::duration >*) call site: 00000 /src/pistache/src/../subprojects/hinnant-date/include/date/date.h:7320

Runtime coverage analysis

Covered functions
450
Functions that are reachable but not covered
268
Reachable functions
885
Percentage of reachable functions covered
69.72%
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/pistache/build/../tests/fuzzers/fuzz_parser.cpp 65
/src/pistache/build/../include/pistache/http_header.h 28
/src/pistache/src/common/http_header.cc 27
/src/pistache/src/common/mime.cc 5
/usr/local/bin/../include/c++/v1/optional 2
/src/pistache/src/../include/pistache/http_defs.h 2
/src/pistache/src/common/http_defs.cc 8
/usr/local/bin/../include/c++/v1/stdexcept 3
/src/pistache/build/../include/pistache/mime.h 2
/src/pistache/src/../include/pistache/http_header.h 1
/src/pistache/src/../include/pistache/base64.h 4
/src/pistache/src/common/base64.cc 7
/src/pistache/build/../include/pistache/http_defs.h 1
/src/pistache/src/../subprojects/hinnant-date/include/date/date.h 190
/usr/include/ctype.h 4
/src/pistache/src/common/net.cc 8
/src/pistache/src/../include/pistache/net.h 4
/src/pistache/src/common/cookie.cc 16
/src/pistache/src/../include/pistache/stream.h 15
/src/pistache/src/common/stream.cc 10
/src/pistache/build/../include/pistache/cookie.h 2
/src/pistache/src/common/http.cc 7
/src/pistache/build/../include/pistache/stream.h 2
/src/pistache/src/../include/pistache/http.h 3
/src/pistache/src/../include/pistache/http_headers.h 1
/src/pistache/build/../include/pistache/http.h 7
/src/pistache/build/../include/pistache/http_headers.h 1
/src/pistache/build/../include/pistache/net.h 1
/src/pistache/src/server/router.cc 7
/src/pistache/build/../include/pistache/router.h 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
Pistache::Rest::Swagger::install(Pistache::Rest::Router&)::$_0::operator()(Pistache::Rest::Requestconst&,Pistache::Http::ResponseWriter)const /src/pistache/src/common/description.cc 3 ['N/A', 'N/A', 'N/A'] 17 0 333 67 52 527 0 1953 865
Pistache::Tcp::Transport::onReady(Pistache::Aio::FdSetconst&) /src/pistache/src/common/transport.cc 2 ['N/A', 'N/A'] 8 0 237 38 7 306 0 839 674
Pistache::Http::Header::Accept::parseRaw(charconst*,unsignedlong) /src/pistache/src/common/http_header.cc 3 ['N/A', 'N/A', 'size_t'] 6 0 222 62 53 87 0 392 307
Pistache::Rest::Private::RouterHandler::onRequest(Pistache::Http::Requestconst&,Pistache::Http::ResponseWriter) /src/pistache/src/server/router.cc 3 ['N/A', 'N/A', 'N/A'] 18 0 29 5 5 579 0 1964 215
Pistache::Http::Private::RequestLineStep::apply(Pistache::StreamCursor&) /src/pistache/src/common/http.cc 2 ['N/A', 'N/A'] 5 0 556 147 131 66 0 238 160
Pistache::Http::Handler::onInput(charconst*,unsignedlong,std::__1::shared_ptr const&) /src/pistache/src/common/http.cc 4 ['N/A', 'N/A', 'size_t', 'N/A'] 17 0 418 85 58 569 0 1897 126
Pistache::Aio::AsyncImpl::Worker::Worker(Pistache::Aio::Reactor*,std::__1::basic_string ,std::__1::allocator >const&) /src/pistache/src/common/reactor.cc 3 ['N/A', 'N/A', 'N/A'] 10 0 44 10 8 76 0 248 124
Pistache::Http::Private::HeadersStep::apply(Pistache::StreamCursor&) /src/pistache/src/common/http.cc 2 ['N/A', 'N/A'] 19 0 435 112 88 451 0 1050 120
Pistache::Async::Private::impl::Continuation ,std::__1::allocator >const&,Pistache::Http::Mime::MediaTypeconst&)::$_1,Pistache::Async::Private::Throw,Pistache::Async::Promise (long)>::doResolve(std::__1::shared_ptr >const&) /src/pistache/src/../include/pistache/async.h 2 ['N/A', 'N/A'] 11 0 33 5 5 133 0 312 112
Pistache::Aio::SyncImpl::runOnce() /src/pistache/src/common/reactor.cc 1 ['N/A'] 4 0 131 27 26 41 0 123 109

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

Functions statically reachable by fuzzers
51.0%
800 / 1584
Cyclomatic complexity statically reachable by fuzzers
63.0%
5474 / 8658

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 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/pistache/build/../tests/fuzzers/fuzz_parser.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=['date::year_month_day::from_days(std::__1::chrono::duration >)', 'std::__1::basic_ostream >& date::to_stream, std::__1::chrono::duration > >(std::__1::basic_ostream >&, char const*, date::fields > > const&, std::__1::basic_string, std::__1::allocator > const*, std::__1::chrono::duration > const*)', 'std::__1::basic_istream >& date::from_stream, std::__1::chrono::duration >, std::__1::allocator >(std::__1::basic_istream >&, char const*, date::fields > >&, std::__1::basic_string, std::__1::allocator >*, std::__1::chrono::duration >*)', 'void date::detail::read>(std::__1::basic_istream >&, date::detail::rld)', 'std::__1::basic_ostream >& date::operator<<  >(std::__1::basic_ostream >&, date::hh_mm_ss > > const&)', 'std::__1::basic_istream >& date::from_stream, std::__1::chrono::duration >, std::__1::allocator >(std::__1::basic_istream >&, char const*, date::fields > >&, std::__1::basic_string, std::__1::allocator >*, std::__1::chrono::duration >*)', 'std::__1::basic_istream >& date::from_stream, std::__1::chrono::duration >, std::__1::allocator >(std::__1::basic_istream >&, char const*, date::fields > >&, std::__1::basic_string, std::__1::allocator >*, std::__1::chrono::duration >*)', 'std::__1::basic_ostream >& date::to_stream, std::__1::chrono::duration > >(std::__1::basic_ostream >&, char const*, date::fields > > const&, std::__1::basic_string, std::__1::allocator > const*, std::__1::chrono::duration > const*)', 'std::__1::basic_ostream >& date::operator<<  >(std::__1::basic_ostream >&, date::year const&)', 'date::year::max()']

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/pistache/src/common/peer.cc [] []
/src/pistache/src/../include/pistache/stream.h ['fuzz_parsers'] []
/src/pistache/src/../include/pistache/flags.h [] []
/src/pistache/build/../include/pistache/cookie.h ['fuzz_parsers'] []
/src/pistache/src/common/transport.cc [] []
/src/pistache/src/common/http_header.cc ['fuzz_parsers'] ['fuzz_parsers']
/src/pistache/src/common/base64.cc ['fuzz_parsers'] ['fuzz_parsers']
/src/pistache/build/../include/pistache/http_defs.h ['fuzz_parsers'] []
/src/pistache/src/../include/pistache/base64.h ['fuzz_parsers'] []
/src/pistache/src/common/http_defs.cc ['fuzz_parsers'] ['fuzz_parsers']
/src/pistache/build/../include/pistache/http.h ['fuzz_parsers'] []
/src/pistache/src/common/pist_syslog.cc [] []
/usr/include/x86_64-linux-gnu/bits/byteswap.h [] []
/usr/include/x86_64-linux-gnu/sys/stat.h [] []
/src/pistache/build/../include/pistache/http_headers.h ['fuzz_parsers'] []
/src/pistache/src/../include/pistache/mime.h [] []
/src/pistache/src/../subprojects/hinnant-date/include/date/date.h ['fuzz_parsers'] []
/src/pistache/src/common/http_headers.cc [] []
/src/pistache/src/common/ps_basename.cc [] []
/usr/local/bin/../include/c++/v1/sstream [] []
/src/pistache/src/../include/pistache/cookie.h [] []
/usr/local/bin/../include/c++/v1/__charconv/from_chars_integral.h [] []
/src/pistache/src/../include/pistache/async.h [] []
/src/pistache/src/../include/pistache/os.h [] []
/src/pistache/src/common/ps_strl.cc [] []
/src/pistache/src/../include/pistache/net.h ['fuzz_parsers'] []
/src/pistache/src/../include/pistache/reactor.h [] []
/src/pistache/src/../include/pistache/mailbox.h [] []
/src/pistache/src/common/tcp.cc [] []
/src/pistache/src/../include/pistache/description.h [] []
/src/pistache/src/common/description.cc [] []
/src/pistache/build/../include/pistache/stream.h ['fuzz_parsers'] []
/usr/local/bin/../include/c++/v1/optional ['fuzz_parsers'] []
/src/pistache/src/common/os.cc [] []
/src/pistache/src/../include/pistache/tcp.h [] []
/usr/local/bin/../include/c++/v1/string [] []
/src/pistache/build/../tests/fuzzers/fuzz_parser.cpp ['fuzz_parsers'] []
/src/pistache/build/../include/pistache/http_header.h ['fuzz_parsers'] []
/src/pistache/build/../include/pistache/mime.h ['fuzz_parsers'] []
/src/pistache/src/common/cookie.cc ['fuzz_parsers'] ['fuzz_parsers']
/src/pistache/build/../include/pistache/router.h ['fuzz_parsers'] []
/src/pistache/src/../include/pistache/http_header.h ['fuzz_parsers'] []
/src/pistache/src/../include/pistache/router.h [] []
/usr/local/bin/../include/c++/v1/__exception/exception.h [] []
/src/pistache/src/../include/pistache/prototype.h [] []
/src/pistache/src/../include/pistache/http_defs.h ['fuzz_parsers'] []
/src/pistache/src/common/mime.cc ['fuzz_parsers'] ['fuzz_parsers']
/src/pistache/src/common/net.cc ['fuzz_parsers'] ['fuzz_parsers']
/src/pistache/src/../include/pistache/http.h ['fuzz_parsers'] []
/src/pistache/src/server/router.cc ['fuzz_parsers'] ['fuzz_parsers']
/usr/local/bin/../include/c++/v1/stdexcept ['fuzz_parsers'] []
/src/pistache/src/../include/pistache/iterator_adapter.h [] []
/usr/include/ctype.h ['fuzz_parsers'] []
/src/pistache/src/../include/pistache/typeid.h [] []
/usr/local/bin/../include/c++/v1/__exception/exception_ptr.h [] []
/src/pistache/src/common/stream.cc ['fuzz_parsers'] ['fuzz_parsers']
/src/pistache/src/common/reactor.cc [] []
/src/pistache/src/../include/pistache/http_headers.h ['fuzz_parsers'] []
/src/pistache/src/../include/pistache/transport.h [] []
/src/pistache/build/../include/pistache/net.h ['fuzz_parsers'] []
/src/pistache/src/common/http.cc ['fuzz_parsers'] ['fuzz_parsers']

Directories in report

Directory
/src/pistache/build/../include/pistache/
/usr/local/bin/../include/c++/v1/__charconv/
/src/pistache/src/common/
/src/pistache/src/../include/pistache/
/usr/include/x86_64-linux-gnu/sys/
/usr/include/x86_64-linux-gnu/bits/
/usr/local/bin/../include/c++/v1/
/usr/local/bin/../include/c++/v1/__exception/
/src/pistache/src/../subprojects/hinnant-date/include/date/
/src/pistache/src/server/
/src/pistache/build/../tests/fuzzers/
/usr/include/