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 363 83.0%
gold [1:9] 0 0.0%
yellow [10:29] 0 0.0%
greenyellow [30:49] 0 0.0%
lawngreen 50+ 74 16.9%
All colors 437 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
86 258 lark.utils.bfs call site: 00258 lark.load_grammar.GrammarBuilder.build
46 85 lark.lark.Lark._prepare_callbacks call site: 00085 lark.parse_tree_builder.ParseTreeBuilder._init_builders
31 224 lark.visitors.Transformer_InPlace.transform call site: 00224 lark.load_grammar.GrammarBuilder.load_grammar
23 30 lark.utils.FS.open call site: 00030 lark.lark.Lark._load
19 136 lark.parse_tree_builder.ParseTreeBuilder.create_callback call site: 00136 lark.parsers.earley_forest.TreeForestTransformer.__default_ambig__
16 187 lark.lexer.Pattern.__init__ call site: 00187 lark.load_grammar.symbol_from_strcase
15 14 lark.lark.Lark.__init__ call site: 00014 lark.utils.isascii
15 69 lark.utils.Serialize.deserialize call site: 00069 lark.lark.Lark._prepare_callbacks
9 59 lark.utils._deserialize call site: 00059 lark.utils.Serialize.deserialize
9 171 lark.parser_frontends.ParsingFrontend.__init__ call site: 00171 lark.parser_frontends.create_contextual_lexer
9 214 lark.common.ParserConf.__init__ call site: 00214 lark.load_grammar._get_parser
9 372 lark.lexer._check_regex_collisions call site: 00372 lark.utils.classify

Runtime coverage analysis

Covered functions
63
Functions that are reachable but not covered
204
Reachable functions
213
Percentage of reachable functions covered
4.23%
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 88
lark.parser_frontends 23
lark.parse_tree_builder 22
lark.parsers.earley_forest 13
lark.lexer 20
lark.grammar 3
lark.common 2
lark.visitors 3

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.reconstruct.Reconstructor.reconstruct lark.reconstruct 4 ['N/A', 'N/A', 'N/A', 'N/A'] 6 0 2 2 4 112 0 364 268
lark.load_grammar.Grammar.compile lark.load_grammar 3 ['N/A', 'N/A', 'N/A'] 7 0 5 12 8 81 0 255 134
lark.tools.standalone.gen_standalone lark.tools.standalone 4 ['N/A', 'N/A', 'N/A', 'N/A'] 7 0 23 3 4 37 2 120 65
lark.parse_tree_builder.PropagatePositions.__call__ lark.parse_tree_builder 2 ['N/A', 'N/A'] 6 0 0 5 5 34 0 110 58
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
lark.lexer._create_unless lark.lexer 4 ['N/A', 'N/A', 'N/A', 'N/A'] 3 0 2 4 5 29 2 92 44
lark.parser_frontends.create_earley_parser lark.parser_frontends 3 ['N/A', 'N/A', 'N/A'] 5 0 0 2 4 55 0 178 43
lark.parsers.lalr_analysis.LALR_Analyzer.compute_lalr1_states lark.parsers.lalr_analysis 1 ['N/A'] 2 0 7 9 7 18 2 61 40
lark.tree.Tree._pretty lark.tree 3 ['N/A', 'N/A', 'N/A'] 2 0 5 2 4 12 2 41 35

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

Functions statically reachable by fuzzers
27.0%
162 / 606
Cyclomatic complexity statically reachable by fuzzers
30.0%
605 / 2016

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

Directories in report

Directory