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

Fuzzer details

Fuzzer: fuzz_parse

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 550 86.4%
gold [1:9] 0 0.0%
yellow [10:29] 0 0.0%
greenyellow [30:49] 0 0.0%
lawngreen 50+ 86 13.5%
All colors 636 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
111 432 lark.utils.bfs call site: 00432 lark.load_grammar.GrammarBuilder._define
91 85 lark.lark.Lark._prepare_callbacks call site: 00085 lark.parse_tree_builder.ParseTreeBuilder._init_builders
45 274 lark.common.ParserConf.__init__ call site: 00274 lark.visitors.Transformer_InPlace.transform
37 359 lark.reconstruct.WriteTokensTransformer.__default__ call site: 00359 lark.parsers.earley_forest.TreeForestTransformer.__default_ambig__
32 397 lark.visitors.Transformer_InPlace.transform call site: 00397 lark.load_grammar.GrammarBuilder.load_grammar
30 185 lark.parse_tree_builder.ParseTreeBuilder.create_callback call site: 00185 lark.parsers.earley_forest.TreeForestTransformer.__default_ambig__
28 320 lark.reconstruct.WriteTokensTransformer.__default__ call site: 00320 lark.parsers.earley_forest.TreeForestTransformer.__default_ambig__
25 59 lark.utils._deserialize call site: 00059 lark.lark.Lark._prepare_callbacks
23 30 lark.utils.FS.open call site: 00030 lark.lark.Lark._load
22 241 lark.lark.Lark.__init__ call site: 00241 lark.load_grammar.GrammarBuilder.load_grammar
16 582 lark.lexer._check_regex_collisions call site: 00582 lark.lark.Lark.save
15 14 lark.lark.Lark.__init__ call site: 00014 lark.utils.isascii

Runtime coverage analysis

Covered functions
56
Functions that are reachable but not covered
280
Reachable functions
291
Percentage of reachable functions covered
3.78%
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
/ 1
...fuzz_parse 5
lark.lark 47
lark.utils 39
lark.load_grammar 115
lark.parser_frontends 23
lark.parse_tree_builder 37
lark.parsers.earley_forest 28
lark.lexer 20
lark.grammar 3
lark.common 2
lark.visitors 60
lark.tree 6
lark.reconstruct 36

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
lark.parse_tree_builder.PropagatePositions.__call__ lark.parse_tree_builder 2 ['N/A', 'N/A'] 5 0 0 5 5 131 0 401 304
lark.reconstruct.Reconstructor.reconstruct lark.reconstruct 4 ['N/A', 'N/A', 'N/A', 'N/A'] 10 0 2 2 4 174 0 554 265
lark.tree.Tree._pretty lark.tree 3 ['N/A', 'N/A', 'N/A'] 2 0 5 2 4 42 2 131 125
lark.tools.standalone.gen_standalone lark.tools.standalone 4 ['N/A', 'N/A', 'N/A', 'N/A'] 4 0 23 3 4 67 2 210 110
lark.load_grammar.Grammar.compile lark.load_grammar 3 ['N/A', 'N/A', 'N/A'] 8 0 5 12 8 116 0 362 82
lark.tree.Tree._rich lark.tree 2 ['N/A', 'N/A'] 2 0 2 2 4 24 2 77 74
lark.parse_tree_builder.maybe_create_child_filter lark.parse_tree_builder 4 ['N/A', 'N/A', 'N/A', 'N/A'] 4 0 1 4 5 55 0 171 74
lark.parse_tree_builder.AmbiguousExpander.__call__ lark.parse_tree_builder 2 ['N/A', 'N/A'] 5 0 2 3 4 95 0 290 73
lark.tree.Tree.scan_values lark.tree 2 ['N/A', 'N/A'] 2 0 3 2 4 21 1 68 65
lark.parsers.lalr_parser.LALR_Parser.parse lark.parsers.lalr_parser 4 ['N/A', 'N/A', 'N/A', 'N/A'] 3 0 1 6 5 21 0 69 57

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

Functions statically reachable by fuzzers
27.0%
161 / 600
Cyclomatic complexity statically reachable by fuzzers
30.0%
599 / 1997

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
[] []
unicodedata [] []
random [] []
copy [] []
typing [] []
lark.parsers.lalr_analysis [] []
js2py [] []
lark.load_grammar ['fuzz_parse'] []
lark.__pyinstaller.hook-lark [] []
collections [] []
PyInstaller [] []
lark.parser_frontends ['fuzz_parse'] []
lark.parsers.lalr_parser [] []
pkgutil [] []
lark.tools.nearley [] []
lark.parsers.grammar_analysis [] []
inspect [] []
atomicwrites [] []
lark.parsers.earley_forest ['fuzz_parse'] []
operator [] []
lark.parse_tree_builder ['fuzz_parse'] []
sre_parse [] []
lark.parsers.earley [] []
regex [] []
importlib [] []
lark.indenter [] []
getpass [] []
lark.exceptions [] []
hashlib [] []
lark.lark ['fuzz_parse'] []
lark.__pyinstaller [] []
textwrap [] []
functools [] []
Tree [] []
lark.tools.serialize [] []
lark.parsers.lalr_interactive_parser [] []
lark.tools.standalone [] []
sys [] []
codecs [] []
[] []
pickle [] []
lark.ast_utils [] []
re [] []
tempfile [] []
lark.visitors ['fuzz_parse'] []
tokenize [] []
os [] []
abc [] []
ast [] []
interegular [] []
pydot [] []
lark.parsers.xearley [] []
json [] []
lark [] []
argparse [] []
...fuzz_parse ['fuzz_parse'] []
lark.utils ['fuzz_parse'] []
lark.common ['fuzz_parse'] []
lark.grammar ['fuzz_parse'] []
zlib [] []
lark.parsers.cyk [] []
logging [] []
atheris [] []
itertools [] []
lark.grammars [] []
lark.tools [] []
lark.tree_matcher [] []
base64 [] []
lark.parsers [] []
lark.tree_templates [] []
rich [] []
lark.tree ['fuzz_parse'] []
lark.lexer ['fuzz_parse'] []
contextlib [] []
warnings [] []
lark.parsers.earley_common [] []
lark.reconstruct ['fuzz_parse'] []

Directories in report

Directory