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: parse_options_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 19 4.58%
gold [1:9] 1 0.24%
yellow [10:29] 1 0.24%
greenyellow [30:49] 1 0.24%
lawngreen 50+ 392 94.6%
All colors 414 100

Fuzz blockers

The following nodes represent call sites where fuzz blockers occur.

Amount of callsites blocked Calltree index Parent function Callsite Largest blocked function
2 7 output_init call site: 00007 perror
2 34 gumbo_realloc call site: 00034 perror
2 135 insert_node call site: 00135 __assert_fail
2 151 maybe_flush_text_node_buffer call site: 00151 get_appropriate_insertion_location
2 300 adjust_mathml_attributes call site: 00300 gumbo_strdup
2 345 insert_foreign_element call site: 00345 parser_add_parse_error
1 27 read_char call site: 00027 add_error
1 87 create_element call site: 00087 insert_element
1 131 destroy_node_callback call site: 00131 destroy_node
1 149 append_node call site: 00149 __assert_fail
1 209 gumbo_token_destroy call site: 00209 gumbo_free
1 340 insert_foreign_element call site: 00340 attribute_matches_case_sensitive

Runtime coverage analysis

Covered functions
359
Functions that are reachable but not covered
8
Reachable functions
135
Percentage of reachable functions covered
94.07%
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
fuzzer/parse_options_fuzzer.cc 3
src/tag.c 2
src/parser.c 60
src/util.c 4
src/vector.c 6
src/error.c 3
src/tokenizer.c 13
src/string_buffer.c 6
src/utf8.c 6
src/./utf8.h 6
src/./ascii.h 4
src/token_buffer.c 2
src/tag_lookup.c 2
src/ascii.c 2
src/./util.h 1
src/attribute.c 2
src/svg_tags.c 2
src/svg_attrs.c 2
src/foreign_attrs.c 2

Fuzzer: parse_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 48 9.48%
gold [1:9] 2 0.39%
yellow [10:29] 0 0.0%
greenyellow [30:49] 1 0.19%
lawngreen 50+ 455 89.9%
All colors 506 100

Fuzz blockers

The following nodes represent call sites where fuzz blockers occur.

Amount of callsites blocked Calltree index Parent function Callsite Largest blocked function
10 67 gumbo_ascii_strncasecmp call site: 00067 insert_element_of_tag_type
7 54 parser_state_init call site: 00054 fragment_parser_init
6 376 gumbo_parse_with_options call site: 00376 destroy_fragment_ctx_element
2 3 output_init call site: 00003 perror
2 30 gumbo_realloc call site: 00030 perror
2 133 insert_node call site: 00133 __assert_fail
2 149 maybe_flush_text_node_buffer call site: 00149 get_appropriate_insertion_location
2 298 adjust_mathml_attributes call site: 00298 gumbo_strdup
2 343 insert_foreign_element call site: 00343 parser_add_parse_error
1 23 read_char call site: 00023 add_error
1 85 gumbo_normalized_tagname call site: 00085 insert_element
1 129 destroy_node_callback call site: 00129 destroy_node

Runtime coverage analysis

Covered functions
369
Functions that are reachable but not covered
12
Reachable functions
150
Percentage of reachable functions covered
92.0%
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
fuzzer/parse_fuzzer.cc 3
src/parser.c 60
src/util.c 4
src/vector.c 6
src/error.c 14
src/tokenizer.c 13
src/string_buffer.c 8
src/utf8.c 6
src/./utf8.h 6
src/./ascii.h 5
src/token_buffer.c 2
src/tag.c 2
src/tag_lookup.c 2
src/ascii.c 2
src/./util.h 1
src/attribute.c 2
src/svg_tags.c 2
src/svg_attrs.c 2
src/foreign_attrs.c 2

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
handle_in_row /src/nokogiri/gumbo-parser/src/parser.c 2 ['N/A', 'N/A'] 16 0 168 25 12 117 0 653 346
handle_attr_name_state /src/nokogiri/gumbo-parser/src/tokenizer.c 4 ['N/A', 'N/A', 'int', 'N/A'] 8 0 102 20 21 61 0 206 145
handle_named_character_reference_state /src/nokogiri/gumbo-parser/src/tokenizer.c 4 ['N/A', 'N/A', 'int', 'N/A'] 13 0 159 19 8 52 0 178 61
handle_attr_value_unquoted_state /src/nokogiri/gumbo-parser/src/tokenizer.c 4 ['N/A', 'N/A', 'int', 'N/A'] 11 0 124 21 22 58 0 187 53
handle_initial /src/nokogiri/gumbo-parser/src/parser.c 2 ['N/A', 'N/A'] 7 0 109 10 5 47 0 194 44
handle_in_select_in_table /src/nokogiri/gumbo-parser/src/parser.c 2 ['N/A', 'N/A'] 16 0 69 10 5 116 0 646 41
hashmap_murmur /src/nokogiri/gumbo-parser/src/hashmap.c 4 ['N/A', 'size_t', 'size_t', 'size_t'] 1 0 26 3 2 1 0 39 39

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

Functions statically reachable by fuzzers
65.0%
258 / 395
Cyclomatic complexity statically reachable by fuzzers
59.0%
1393 / 2369

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

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/nokogiri/gumbo-parser/src/string_piece.c [] []
/src/nokogiri/gumbo-parser/src/error.c ['parse_options_fuzzer', 'parse_fuzzer'] ['parse_options_fuzzer', 'parse_fuzzer']
/src/nokogiri/gumbo-parser/src/svg_tags.c ['parse_options_fuzzer', 'parse_fuzzer'] ['parse_options_fuzzer', 'parse_fuzzer']
/src/nokogiri/gumbo-parser/src/src/char_ref.rl [] []
/src/nokogiri/gumbo-parser/src/util.c ['parse_options_fuzzer', 'parse_fuzzer'] ['parse_options_fuzzer', 'parse_fuzzer']
/src/nokogiri/gumbo-parser/src/svg_attrs.c ['parse_options_fuzzer', 'parse_fuzzer'] ['parse_options_fuzzer', 'parse_fuzzer']
/src/nokogiri/gumbo-parser/src/./util.h ['parse_options_fuzzer', 'parse_fuzzer'] []
/src/nokogiri/gumbo-parser/src/utf8.c ['parse_options_fuzzer', 'parse_fuzzer'] ['parse_options_fuzzer', 'parse_fuzzer']
/src/nokogiri/gumbo-parser/src/hashmap.c [] []
/src/nokogiri/gumbo-parser/fuzzer/parse_fuzzer.cc ['parse_fuzzer'] ['parse_fuzzer']
/src/nokogiri/gumbo-parser/src/string_buffer.c ['parse_options_fuzzer', 'parse_fuzzer'] ['parse_options_fuzzer', 'parse_fuzzer']
/src/nokogiri/gumbo-parser/src/token_buffer.c ['parse_options_fuzzer', 'parse_fuzzer'] ['parse_options_fuzzer', 'parse_fuzzer']
/src/nokogiri/gumbo-parser/src/attribute.c ['parse_options_fuzzer', 'parse_fuzzer'] ['parse_options_fuzzer', 'parse_fuzzer']
/src/nokogiri/gumbo-parser/src/tag.c ['parse_options_fuzzer', 'parse_fuzzer'] ['parse_options_fuzzer', 'parse_fuzzer']
/src/nokogiri/gumbo-parser/fuzzer/parse_options_fuzzer.cc ['parse_options_fuzzer'] ['parse_options_fuzzer']
/src/nokogiri/gumbo-parser/src/./ascii.h ['parse_options_fuzzer', 'parse_fuzzer'] []
/src/nokogiri/gumbo-parser/src/tag_lookup.c ['parse_options_fuzzer', 'parse_fuzzer'] ['parse_options_fuzzer', 'parse_fuzzer']
/src/nokogiri/gumbo-parser/src/tokenizer.c ['parse_options_fuzzer', 'parse_fuzzer'] ['parse_options_fuzzer', 'parse_fuzzer']
/src/nokogiri/gumbo-parser/src/./utf8.h ['parse_options_fuzzer', 'parse_fuzzer'] []
/src/nokogiri/gumbo-parser/src/parser.c ['parse_options_fuzzer', 'parse_fuzzer'] ['parse_options_fuzzer', 'parse_fuzzer']
/src/nokogiri/gumbo-parser/src/string_set.c [] []
/src/nokogiri/gumbo-parser/src/foreign_attrs.c ['parse_options_fuzzer', 'parse_fuzzer'] ['parse_options_fuzzer', 'parse_fuzzer']
/src/nokogiri/gumbo-parser/src/vector.c ['parse_options_fuzzer', 'parse_fuzzer'] ['parse_options_fuzzer', 'parse_fuzzer']
/src/nokogiri/gumbo-parser/src/ascii.c ['parse_options_fuzzer', 'parse_fuzzer'] ['parse_options_fuzzer', 'parse_fuzzer']

Directories in report

Directory
/src/nokogiri/gumbo-parser/src/src/
/src/nokogiri/gumbo-parser/fuzzer/
/src/nokogiri/gumbo-parser/src/./
/src/nokogiri/gumbo-parser/src/