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: empty-file.cpp

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 1 100.%
gold [1:9] 0 0.0%
yellow [10:29] 0 0.0%
greenyellow [30:49] 0 0.0%
lawngreen 50+ 0 0.0%
All colors 1 100

Runtime coverage analysis

Covered functions
1243
Functions that are reachable but not covered
0
Reachable functions
0
Percentage of reachable functions covered
0.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

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
ABSL_RETIRED_FLAG /src/amphtml/validator/cpp/htmlparser/parser.cc 1 ['retired'] 4 0 2660 899 680 175 0 745 745
amp::validator::ValidateTag /src/amphtml/validator/cpp/engine/validator-internal.cc 3 ['ParsedHtmlTag', 'ParsedTagSpec*', 'Context'] 9 0 40 13 18 268 0 379 352
htmlparser::Tokenizer::Next /src/amphtml/validator/cpp/htmlparser/tokenizer.cc 1 ['bool'] 5 0 105 22 27 38 0 241 236
htmlparser::css::Tokenizer::Tokenizer /src/amphtml/validator/cpp/htmlparser/css/parse-css.cc 5 ['vector *', 'int', 'int', 'vector >*', 'vector >*'] 6 0 25 3 4 102 0 199 152
htmlparser::css::url::Tokenizer::Tokenizer /src/amphtml/validator/cpp/htmlparser/css/parse-css-urls.cc 3 ['vector ', 'vector >*', 'vector >*'] 6 0 13 2 2 81 0 145 139
htmlparser::css::ParseASelectorsGroup /src/amphtml/validator/cpp/htmlparser/css/parse-css.cc 1 ['TokenStream*'] 10 0 30 9 10 75 0 103 102
Parser::ParseImpliedToken /src/amphtml/validator/cpp/htmlparser/parser.cc 3 ['TokenType', 'Atom', 'std::string'] 6 0 21 6 6 73 20 154 101
amp::validator::Validator::ValidateNode /src/amphtml/validator/cpp/engine/validator-internal.cc 1 ['htmlparser::Node*'] 6 0 90 25 30 111 1 152 98
htmlparser::URL::URL /src/amphtml/validator/cpp/htmlparser/url.cc 1 ['std::string_view'] 4 0 7 2 2 58 0 138 93
Parser::InBodyEndTagFormatting /src/amphtml/validator/cpp/htmlparser/parser.cc 2 ['Atom', 'std::string_view'] 3 0 94 23 32 22 19 82 66

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

Functions statically reachable by fuzzers
16.0%
204 / 1301
Cyclomatic complexity statically reachable by fuzzers
48.0%
2054 / 4257

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

Runtime coverage analysis

This section shows analysis of runtime coverage data.

For futher technical details on how this section is generated, please see the Glossary .

Complex functions with low coverage

Func name Function total lines Lines covered at runtime percentage covered Reached by fuzzers
htmlparser::ParseDoctype(std::__1::basic_string_view >,htmlparser::Node*) 73 29 39.72%
htmlparser::Parser::ResetInsertionMode() 82 20 24.39%
htmlparser::Tokenizer::ReadTagAttributeKey(bool) 64 32 50.0%
absl::container_internal::AssertSameContainer(absl::container_internal::ctrl_tconst*,absl::container_internal::ctrl_tconst*,voidconst*const&,voidconst*const&,unsignedcharconst*,unsignedcharconst*) 44 15 34.09%
absl::container_internal::AssertIsFull(absl::container_internal::ctrl_tconst*,unsignedchar,unsignedcharconst*,charconst*) 33 9 27.27%
intUnwindImpl (void**,int*,int,int,voidconst*,int*) 44 21 47.72%
void**NextStackFrame (void**,voidconst*,unsignedlong,unsignedlong) 37 18 48.64%
absl::flags_internal::FlagImpl::ParseFrom(std::__1::basic_string_view >,absl::flags_internal::FlagSettingMode,absl::flags_internal::ValueSource,std::__1::basic_string ,std::__1::allocator >&) 41 15 36.58%
void*absl::flags_internal::FlagOps (absl::flags_internal::FlagOp,voidconst*,void*,void*) 47 13 27.65%
void*absl::flags_internal::FlagOps (absl::flags_internal::FlagOp,voidconst*,void*,void*) 47 13 27.65%
void*absl::flags_internal::FlagOps ,std::__1::allocator >,std::__1::allocator ,std::__1::allocator >>>>(absl::flags_internal::FlagOp,voidconst*,void*,void*) 47 14 29.78%
absl::flags_internal::HandleUsageFlags(std::__1::basic_ostream >&,std::__1::basic_string_view >) 49 7 14.28%
absl::flags_internal::(anonymousnamespace)::DeduceFlagValue(absl::CommandLineFlagconst&,std::__1::basic_string_view >,bool,bool,absl::flags_internal::(anonymousnamespace)::ArgsList*) 48 6 12.5%
absl::flags_internal::FlagRegistry::RegisterFlag(absl::CommandLineFlag&,charconst*) 53 8 15.09%
absl::hash_internal::LowLevelHash(voidconst*,unsignedlong,unsignedlong,unsignedlongconst*) 55 30 54.54%
absl::strings_internal::Base64EscapeInternal(unsignedcharconst*,unsignedlong,char*,unsignedlong,charconst*,bool) 82 41 50.0%
absl::(anonymousnamespace)::safe_parse_sign_and_base(std::__1::basic_string_view >*,int*,bool*) 55 29 52.72%
absl::DeadlockCheck(absl::Mutex*) 69 19 27.53%
absl::LockLeave(absl::Mutex*,absl::synchronization_internal::GraphId,absl::SynchLocksHeld*) 32 15 46.87%
absl::FormatDuration(absl::Duration) 31 11 35.48%
absl::ParseDuration(std::__1::basic_string_view >,absl::Duration*) 35 12 34.28%
fuzztest::GetMatchingFuzzTestOrExit(std::__1::basic_string_view >) 31 11 35.48%
testing::internal::TypeParameterizedTestSuiteRegistry::CheckForInstantiations() 33 4 12.12%
testing::Test::HasSameFixtureClass() 42 12 28.57%
testing::internal::ShouldShard(charconst*,charconst*,bool) 36 8 22.22%

Fuzz driver synthesis

New fuzzers

The below fuzzers are templates and suggestions for how to target the set of optimal functions above

parser.cc

Target file: /src/amphtml/validator/cpp/htmlparser/parser.cc
Target functions: ABSL_RETIRED_FLAG, Parser::ParseImpliedToken, Parser::InBodyEndTagFormatting
#include "ada_fuzz_header.h"

int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
  af_safe_gb_init(data, size);

  /* target ABSL_RETIRED_FLAG */
  UNKNOWN_TYPE unknown_0;
  ABSL_RETIRED_FLAG(unknown_0);

  /* target Parser::ParseImpliedToken */
  UNKNOWN_TYPE unknown_14;
  UNKNOWN_TYPE unknown_15;
  UNKNOWN_TYPE unknown_16;
  Parser::ParseImpliedToken(unknown_14, unknown_15, unknown_16);

  /* target Parser::InBodyEndTagFormatting */
  UNKNOWN_TYPE unknown_19;
  UNKNOWN_TYPE unknown_20;
  Parser::InBodyEndTagFormatting(unknown_19, unknown_20);

  af_safe_gb_cleanup();
}

validator-internal.cc

Target file: /src/amphtml/validator/cpp/engine/validator-internal.cc
Target functions: amp::validator::ValidateTag, amp::validator::Validator::ValidateNode
#include "ada_fuzz_header.h"

int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
  af_safe_gb_init(data, size);

  /* target amp::validator::ValidateTag */
  UNKNOWN_TYPE unknown_1;
  UNKNOWN_TYPE unknown_2;
  UNKNOWN_TYPE unknown_3;
  amp::validator::ValidateTag(unknown_1, unknown_2, unknown_3);

  /* target amp::validator::Validator::ValidateNode */
  UNKNOWN_TYPE unknown_17;
  amp::validator::Validator::ValidateNode(unknown_17);

  af_safe_gb_cleanup();
}

tokenizer.cc

Target file: /src/amphtml/validator/cpp/htmlparser/tokenizer.cc
Target functions: htmlparser::Tokenizer::Next
#include "ada_fuzz_header.h"

int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
  af_safe_gb_init(data, size);

  /* target htmlparser::Tokenizer::Next */
  UNKNOWN_TYPE unknown_4;
  htmlparser::Tokenizer::Next(unknown_4);

  af_safe_gb_cleanup();
}

parse-css.cc

Target file: /src/amphtml/validator/cpp/htmlparser/css/parse-css.cc
Target functions: htmlparser::css::Tokenizer::Tokenizer, htmlparser::css::ParseASelectorsGroup
#include "ada_fuzz_header.h"

int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
  af_safe_gb_init(data, size);

  /* target htmlparser::css::Tokenizer::Tokenizer */
  UNKNOWN_TYPE unknown_5;
  int new_var6 = ada_safe_get_int();
  int new_var7 = ada_safe_get_int();
  UNKNOWN_TYPE unknown_8;
  UNKNOWN_TYPE unknown_9;
  htmlparser::css::Tokenizer::Tokenizer(unknown_5, new_var6, new_var7, unknown_8, unknown_9);

  /* target htmlparser::css::ParseASelectorsGroup */
  UNKNOWN_TYPE unknown_13;
  htmlparser::css::ParseASelectorsGroup(unknown_13);

  af_safe_gb_cleanup();
}

parse-css-urls.cc

Target file: /src/amphtml/validator/cpp/htmlparser/css/parse-css-urls.cc
Target functions: htmlparser::css::url::Tokenizer::Tokenizer
#include "ada_fuzz_header.h"

int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
  af_safe_gb_init(data, size);

  /* target htmlparser::css::url::Tokenizer::Tokenizer */
  UNKNOWN_TYPE unknown_10;
  UNKNOWN_TYPE unknown_11;
  UNKNOWN_TYPE unknown_12;
  htmlparser::css::url::Tokenizer::Tokenizer(unknown_10, unknown_11, unknown_12);

  af_safe_gb_cleanup();
}

url.cc

Target file: /src/amphtml/validator/cpp/htmlparser/url.cc
Target functions: htmlparser::URL::URL
#include "ada_fuzz_header.h"

int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
  af_safe_gb_init(data, size);

  /* target htmlparser::URL::URL */
  UNKNOWN_TYPE unknown_18;
  htmlparser::URL::URL(unknown_18);

  af_safe_gb_cleanup();
}

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/amphtml/validator/cpp/htmlparser/validators/json_test.cc [] []
/src/amphtml/validator/cpp/htmlparser/node.h [] []
/src/amphtml/validator/cpp/htmlparser/validators/supported_media_query.h [] []
/src/amphtml/validator/cpp/htmlparser/error.cc [] []
/src/amphtml/validator/cpp/htmlparser/fileutil_test.cc [] []
/src/amphtml/validator/cpp/engine/wasm/validator_outer_wrapper.cc [] []
/src/amphtml/validator/cpp/htmlparser/document.cc [] []
/src/amphtml/validator/cpp/htmlparser/json/types.cc [] []
/src/amphtml/validator/cpp/htmlparser/atomutil.cc [] []
/src/amphtml/validator/cpp/htmlparser/htmldataset_test.cc [] []
/src/amphtml/validator/cpp/engine/error-formatter.h [] []
/src/amphtml/validator/cpp/htmlparser/parser_fuzz_test.cc [] []
/src/amphtml/validator/cpp/htmlparser/css/parse-css.cc [] []
/src/amphtml/validator/cpp/htmlparser/fileutil.cc [] []
/src/amphtml/validator/cpp/engine/parse-layout-sizes.h [] []
/src/amphtml/validator/cpp/htmlparser/hash.h [] []
/src/amphtml/validator/cpp/engine/parse-srcset.cc [] []
/src/amphtml/validator/cpp/htmlparser/url.cc [] []
/src/amphtml/validator/cpp/engine/parse-viewport.cc [] []
/src/amphtml/validator/cpp/htmlparser/grammar/tablebuilder.cc [] []
/src/amphtml/validator/cpp/htmlparser/glog_polyfill.h [] []
/src/amphtml/validator/cpp/engine/parse-srcset.h [] []
/src/amphtml/validator/cpp/htmlparser/foreign.cc [] []
/src/amphtml/validator/cpp/htmlparser/iterators.h [] []
/src/amphtml/validator/cpp/engine/type-identifier.cc [] []
/src/amphtml/validator/cpp/htmlparser/css/parse-css-urls.cc [] []
/src/amphtml/validator/cpp/htmlparser/strings.cc [] []
/src/amphtml/validator/cpp/engine/parse-layout_test.cc [] []
/src/amphtml/validator/cpp/htmlparser/bin/entitytablegen.cc [] []
/src/amphtml/validator/cpp/engine/keyframes-parse-css.cc [] []
/src/amphtml/validator/cpp/htmlparser/parser.cc [] []
/src/amphtml/validator/cpp/htmlparser/css/amp4ads-parse-css_test.cc [] []
/src/amphtml/validator/cpp/htmlparser/json/types.h [] []
/src/amphtml/validator/cpp/engine/keyframes-parse-css_test.cc [] []
/src/amphtml/validator/cpp/engine/testing-utils.cc [] []
/src/amphtml/validator/cpp/engine/parse-layout.cc [] []
/src/amphtml/validator/cpp/engine/validator_test.cc [] []
/src/amphtml/validator/cpp/htmlparser/casetable.h [] []
/src/amphtml/validator/cpp/engine/utf8-util_test.cc [] []
/src/amphtml/validator/cpp/htmlparser/document.h [] []
/src/amphtml/validator/cpp/htmlparser/validators/ipaddress.h [] []
/src/amphtml/validator/cpp/htmlparser/css/parse-css-urls_test.cc [] []
/src/amphtml/validator/cpp/htmlparser/defer.h [] []
/src/amphtml/validator/cpp/htmlparser/json/json.cc [] []
/src/amphtml/validator/cpp/htmlparser/token.cc [] []
/src/amphtml/validator/cpp/htmlparser/allocator_test.cc [] []
/src/amphtml/validator/cpp/htmlparser/validators/json.h [] []
/src/amphtml/validator/cpp/htmlparser/css/amp4ads-parse-css.cc [] []
/src/amphtml/validator/cpp/htmlparser/parser.h [] []
/src/amphtml/validator/cpp/htmlparser/allocator.h [] []
/src/amphtml/validator/cpp/engine/wasm/validator_inner_wrapper.cc [] []
/src/amphtml/validator/cpp/engine/utf8-util.cc [] []
/src/amphtml/validator/cpp/htmlparser/utf8.h [] []
/src/amphtml/validator/cpp/engine/parse-viewport_test.cc [] []
/src/amphtml/validator/cpp/htmlparser/css/parse-css_test.cc [] []
/src/amphtml/validator/cpp/engine/parse-layout-sizes.cc [] []
/src/amphtml/validator/cpp/htmlparser/fileutil.h [] []
/src/amphtml/validator/cpp/engine/type-identifier_test.cc [] []
/src/amphtml/validator/cpp/htmlparser/bin/atomgen.cc [] []
/src/amphtml/validator/cpp/htmlparser/css/parse-css-urls.h [] []
/src/amphtml/validator/cpp/htmlparser/strings.h [] []
/src/amphtml/validator/cpp/htmlparser/renderer_test.cc [] []
/src/amphtml/validator/cpp/htmlparser/css/parse-css.h [] []
/src/amphtml/validator/cpp/htmlparser/renderer.cc [] []
/src/amphtml/validator/cpp/engine/error-formatter.cc [] []
/src/amphtml/validator/cpp/htmlparser/tokenizer.h [] []
/src/amphtml/validator/cpp/htmlparser/tokenizer.cc [] []
/src/amphtml/validator/cpp/htmlparser/url.h [] []
/src/amphtml/validator/cpp/htmlparser/validators/ipaddress_test.cc [] []
/src/amphtml/validator/cpp/engine/parse-srcset_test.cc [] []
/src/amphtml/validator/cpp/engine/validator-internal.cc [] []
/src/amphtml/validator/cpp/htmlparser/comparators.h [] []
/src/amphtml/validator/cpp/htmlparser/doctype.cc [] []
/src/amphtml/validator/cpp/htmlparser/node.cc [] []
/src/amphtml/validator/cpp/htmlparser/validators/supported_media_query_test.cc [] []
/src/amphtml/validator/cpp/engine/update-tests.cc [] []
/src/amphtml/validator/cpp/engine/parse-layout-sizes_test.cc [] []
/src/amphtml/validator/cpp/htmlparser/entity.h [] []
/src/amphtml/validator/cpp/engine/scripts/validator_example.cc [] []
/src/amphtml/validator/cpp/htmlparser/atomutil.h [] []

Directories in report

Directory
/src/amphtml/validator/cpp/htmlparser/validators/
/src/amphtml/validator/cpp/engine/
/src/amphtml/validator/cpp/htmlparser/bin/
/src/amphtml/validator/cpp/htmlparser/css/
/src/amphtml/validator/cpp/htmlparser/json/
/src/amphtml/validator/cpp/htmlparser/
/src/amphtml/validator/cpp/htmlparser/grammar/
/src/amphtml/validator/cpp/engine/wasm/
/src/amphtml/validator/cpp/engine/scripts/