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

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 19 21.5%
gold [1:9] 0 0.0%
yellow [10:29] 0 0.0%
greenyellow [30:49] 0 0.0%
lawngreen 50+ 69 78.4%
All colors 88 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_throw', '__cxa_free_exception', 'std::runtime_error::runtime_error(char const*)', '__cxa_allocate_exception']

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

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

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:72
6 6 5 :

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

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:4918
4 4 1 :

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

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

['strncmp']

2 11 Pistache::match_string(charconst*,unsignedlong,Pistache::StreamCursor&,Pistache::CaseSensitivity) call site: 00000 /src/pistache/src/common/stream.cc:232
0 0 None 1374 2692 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:6603
0 0 None 1374 2692 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:6685
0 0 None 1374 2692 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:6931
0 0 None 1374 2692 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:7267
0 0 None 1374 2692 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:7296
0 0 None 1374 2692 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:7540
0 0 None 1374 2692 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:7574

Runtime coverage analysis

Covered functions
199
Functions that are reachable but not covered
30
Reachable functions
96
Percentage of reachable functions covered
68.75%
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/pistache/build/../tests/fuzzers/fuzz_parser.cpp 1
/src/pistache/src/common/http.cc 2
/src/pistache/build/../include/pistache/http_header.h 13
/src/pistache/src/common/http_header.cc 4
/src/pistache/build/../include/pistache/http_defs.h 1
/src/pistache/src/common/http_defs.cc 4
/src/pistache/src/../subprojects/hinnant-date/include/date/date.h 2
/src/pistache/src/../include/pistache/http_defs.h 1
/src/pistache/src/common/net.cc 5
/usr/local/bin/../include/c++/v1/stdexcept 2
/src/pistache/src/../include/pistache/net.h 2
/src/pistache/build/../include/pistache/mime.h 2
/src/pistache/build/../include/pistache/http.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::Http::(anonymousnamespace)::writeCookies(Pistache::Http::CookieJarconst&,Pistache::DynamicStreamBuf&) /src/pistache/src/common/http.cc 2 ['class.Pistache::Http::Uri::Query *', 'class.Pistache::ArrayStreamBuf *'] 10 0 150 32 26 170 0 922 920
Pistache::Tcp::Transport::onReady(Pistache::Aio::FdSetconst&) /src/pistache/src/common/transport.cc 2 ['class.Pistache::Tcp::Transport *', 'class.Pistache::Aio::FdSet *'] 6 0 262 41 6 261 0 656 648
Pistache::Http::Handler::onInput(charconst*,unsignedlong,std::__1::shared_ptr const&) /src/pistache/src/common/http.cc 4 ['class.Pistache::Http::Handler *', 'char *', 'size_t ', 'class.std::__1::shared_ptr.360 *'] 5 0 448 84 58 215 0 469 399
Pistache::Http::Private::HeadersStep::apply(Pistache::StreamCursor&) /src/pistache/src/common/http.cc 2 ['class.Pistache::Http::Private::RequestLineStep *', 'class.Pistache::StreamCursor *'] 6 0 448 112 88 150 0 444 378
std::__1::basic_istream >&date::operator>> >>,char,std::__1::char_traits ,std::__1::allocator >(std::__1::basic_istream >&,date::parse_manip >>,char,std::__1::char_traits ,std::__1::allocator >const&) /src/pistache/src/../subprojects/hinnant-date/include/date/date.h 2 ['class.std::__1::basic_istream *', 'struct.date::parse_manip *'] 4 0 22 3 2 205 0 447 319
Pistache::Http::Header::Accept::parseRaw(charconst*,unsignedlong) /src/pistache/src/common/http_header.cc 3 ['class.Pistache::Http::Header::Accept *', 'char *', 'size_t '] 5 0 230 62 53 85 0 390 301
Pistache::Http::Private::RequestLineStep::apply(Pistache::StreamCursor&) /src/pistache/src/common/http.cc 2 ['class.Pistache::Http::Private::RequestLineStep *', 'class.Pistache::StreamCursor *'] 4 0 579 147 131 65 0 237 140
Pistache::Address::Address(std::__1::basic_string ,std::__1::allocator >,Pistache::Port) /src/pistache/src/common/net.cc 3 ['class.Pistache::Address *', 'class.std::__1::basic_string *', 'N/A'] 3 0 70 12 9 57 0 169 134
Pistache::Http::serveFile(Pistache::Http::ResponseWriter&,std::__1::basic_string ,std::__1::allocator >const&,Pistache::Http::Mime::MediaTypeconst&) /src/pistache/src/common/http.cc 4 ['class.Pistache::Async::Promise *', 'class.Pistache::Http::ResponseWriter *', 'class.std::__1::basic_string *', 'class.Pistache::Http::Mime::MediaType *'] 4 0 430 89 64 152 0 327 129
Pistache::Tcp::Transport::registerPoller(Pistache::Polling::Epoll&) /src/pistache/src/common/transport.cc 2 ['class.Pistache::Tcp::Transport *', 'union.anon.153 *'] 3 0 21 3 2 43 0 127 105

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

Functions statically reachable by fuzzers
37.0%
459 / 1242
Cyclomatic complexity statically reachable by fuzzers
52.0%
3540 / 6771

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

Directories in report

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