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

Fuzzer details

Fuzzer: fuzz_env_jinja_lexer

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 100 30.5%
gold [1:9] 0 0.0%
yellow [10:29] 0 0.0%
greenyellow [30:49] 0 0.0%
lawngreen 50+ 227 69.4%
All colors 327 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
79 230 jinja2.parser.Parser.parse_tuple call site: 00230 jinja2.parser.Parser.subparse
3 17 jinja2.environment.Environment._tokenize call site: 00017 jinja2.lexer.TokenStream.__init__
3 25 jinja2.parser.Parser.__init__ call site: 00025 jinja2.parser.Parser.parse
3 34 jinja2.nodes.Node.__init__ call site: 00034 jinja2.parser.Parser.parse_tuple
2 7 jinja2.environment.Environment.compile call site: 00007 jinja2.environment.Environment._parse
2 227 jinja2.parser.Parser.parse_tuple call site: 00227 jinja2.lexer.describe_token
1 12 jinja2.environment.Environment.preprocess call site: 00012 jinja2.environment.Environment.iter_extensions
1 15 jinja2.environment.Environment.iter_extensions call site: 00015 .str
1 41 jinja2.lexer.TokenStream.expect call site: 00041 expr.split
1 45 jinja2.parser.Parser.parse_tuple call site: 00045 jinja2.lexer.Token.test_any
1 131 jinja2.parser.Parser.parse_subscript call site: 00131 jinja2.parser.Parser.fail
1 143 jinja2.parser.Parser.parse_call_args call site: 00143 jinja2.lexer.TokenStream.look

Runtime coverage analysis

Covered functions
345
Functions that are reachable but not covered
58
Reachable functions
115
Percentage of reachable functions covered
49.57%
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
/ 1
...fuzz_env_jinja_lexer 6
jinja2.environment 20
jinja2.parser 72
jinja2.lexer 12
jinja2.nodes 9
jinja2.compiler 4

Fuzzer: fuzz_jinja_compile_expr

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 100 30.0%
gold [1:9] 0 0.0%
yellow [10:29] 0 0.0%
greenyellow [30:49] 0 0.0%
lawngreen 50+ 233 69.9%
All colors 333 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
87 234 jinja2.environment.Environment.compile call site: 00234 jinja2.environment.Environment._parse
3 12 jinja2.environment.Environment._tokenize call site: 00012 jinja2.lexer.TokenStream.__init__
2 74 jinja2.parser.Parser.parse_tuple call site: 00074 jinja2.lexer.describe_token
1 7 jinja2.environment.Environment.preprocess call site: 00007 jinja2.environment.Environment.iter_extensions
1 10 jinja2.environment.Environment.iter_extensions call site: 00010 .str
1 64 jinja2.lexer.TokenStream.expect call site: 00064 expr.split
1 68 jinja2.parser.Parser.parse_tuple call site: 00068 jinja2.lexer.Token.test_any
1 126 jinja2.parser.Parser.parse_subscript call site: 00126 jinja2.parser.Parser.fail
1 138 jinja2.parser.Parser.parse_call_args call site: 00138 jinja2.lexer.TokenStream.look
1 169 jinja2.parser.Parser.parse_test call site: 00169 jinja2.lexer.Token.test_any
1 219 jinja2.parser.Parser.parse_condexpr call site: 00219 jinja2.parser.Parser.parse_or

Runtime coverage analysis

Covered functions
345
Functions that are reachable but not covered
57
Reachable functions
115
Percentage of reachable functions covered
50.43%
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
/ 1
...fuzz_jinja_compile_expr 3
jinja2.environment 25
jinja2.parser 72
jinja2.lexer 12
jinja2.nodes 9
jinja2.compiler 4

Fuzzer: fuzz_jinja_compile_templates

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 137 36.2%
gold [1:9] 0 0.0%
yellow [10:29] 0 0.0%
greenyellow [30:49] 0 0.0%
lawngreen 50+ 241 63.7%
All colors 378 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
79 269 jinja2.parser.Parser.parse_tuple call site: 00269 jinja2.parser.Parser.subparse
16 361 jinja2.environment.Environment.compile call site: 00361 jinja2.environment.Environment.compile_templates.write_file
13 32 ...fuzz_jinja_compile_templates.TestOneInput call site: 00032 jinja2.environment.Environment.compile
8 21 jinja2.environment.Environment.__init__ call site: 00021 jinja2.utils.import_string
3 56 jinja2.environment.Environment._tokenize call site: 00056 jinja2.lexer.TokenStream.__init__
3 64 jinja2.parser.Parser.__init__ call site: 00064 jinja2.parser.Parser.parse
3 73 jinja2.nodes.Node.__init__ call site: 00073 jinja2.parser.Parser.parse_tuple
2 46 jinja2.environment.Environment.compile call site: 00046 jinja2.environment.Environment._parse
2 266 jinja2.parser.Parser.parse_tuple call site: 00266 jinja2.lexer.describe_token
1 51 jinja2.environment.Environment.preprocess call site: 00051 jinja2.environment.Environment.iter_extensions
1 54 jinja2.environment.Environment.iter_extensions call site: 00054 .str
1 80 jinja2.lexer.TokenStream.expect call site: 00080 expr.split

Runtime coverage analysis

Covered functions
345
Functions that are reachable but not covered
93
Reachable functions
155
Percentage of reachable functions covered
40.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
/ 1
...fuzz_jinja_compile_templates 12
jinja2.environment 47
jinja2.utils 7
jinja2.loaders 5
jinja2.parser 72
jinja2.lexer 12
jinja2.nodes 9
jinja2.compiler 4

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
jinja2.compiler.CodeGenerator.visit_Macro jinja2.compiler 3 ['N/A', 'N/A', 'N/A'] 8 0 5 2 4 60 0 195 160
jinja2.ext.InternationalizationExtension.parse jinja2.ext 2 ['N/A', 'N/A'] 3 0 14 20 11 35 0 125 84
jinja2.compiler.optimizeconst.new_func jinja2.compiler 4 ['N/A', 'N/A', 'N/A', 'N/A'] 6 0 0 2 4 48 0 164 78
jinja2.debug.rewrite_traceback_stack jinja2.debug 1 ['N/A'] 2 0 4 3 4 25 0 83 74
jinja2.filters.do_urlize jinja2.filters 7 ['N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A'] 3 0 3 5 5 27 0 90 72
jinja2.filters.async_select_or_reject jinja2.filters 6 ['N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A'] 4 0 1 2 4 23 4 75 63
jinja2.lexer.Lexer.tokeniter jinja2.lexer 5 ['N/A', 'N/A', 'N/A', 'N/A', 'N/A'] 1 0 11 27 14 19 1 71 56
jinja2.ext.babel_extract jinja2.ext 4 ['N/A', 'N/A', 'N/A', 'N/A'] 39 0 2 5 5 133 0 451 55
jinja2.compiler.CodeGenerator.visit_Template jinja2.compiler 3 ['N/A', 'N/A', 'N/A'] 7 0 39 11 7 58 0 190 53
jinja2.sandbox.SandboxedEnvironment.call jinja2.sandbox 5 ['N/A', 'N/A', 'N/A', 'N/A', 'N/A'] 5 0 1 2 4 16 0 59 44

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

Functions statically reachable by fuzzers
23.0%
173 / 738
Cyclomatic complexity statically reachable by fuzzers
26.0%
648 / 2509

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
[] []
zipfile [] []
jinja2.filters [] []
...fuzz_jinja_compile_templates ['fuzz_jinja_compile_templates'] []
fnmatch [] []
jinja2.parser ['fuzz_env_jinja_lexer', 'fuzz_jinja_compile_expr', 'fuzz_jinja_compile_templates'] []
jinja2.compiler ['fuzz_env_jinja_lexer', 'fuzz_jinja_compile_expr', 'fuzz_jinja_compile_templates'] []
ast [] []
jinja2.utils ['fuzz_jinja_compile_templates'] []
asyncio [] []
functools [] []
markupsafe [] []
urllib [] []
pickle [] []
logging [] []
itertools [] []
pprint [] []
sys [] []
_string [] []
posixpath [] []
gettext [] []
[] []
weakref [] []
collections [] []
jinja2.visitor [] []
textwrap [] []
types [] []
...fuzz_env_jinja_lexer ['fuzz_env_jinja_lexer'] []
jinja2.runtime [] []
jinja2.nodes ['fuzz_env_jinja_lexer', 'fuzz_jinja_compile_expr', 'fuzz_jinja_compile_templates'] []
jinja2.ext [] []
jinja2.async_utils [] []
jinja2.loaders ['fuzz_jinja_compile_templates'] []
re [] []
tempfile [] []
jinja2._identifier [] []
inspect [] []
jinja2.tests [] []
threading [] []
jinja2.environment ['fuzz_env_jinja_lexer', 'fuzz_jinja_compile_expr', 'fuzz_jinja_compile_templates'] []
jinja2.bccache [] []
string [] []
atheris [] []
importlib [] []
...fuzz_jinja_compile_expr ['fuzz_jinja_compile_expr'] []
enum [] []
jinja2.defaults [] []
jinja2.nativetypes [] []
typing [] []
jinja2.optimizer [] []
keyword [] []
io [] []
jinja2 [] []
stat [] []
jinja2.meta [] []
jinja2.sandbox [] []
os [] []
json [] []
hashlib [] []
jinja2.lexer ['fuzz_env_jinja_lexer', 'fuzz_jinja_compile_expr', 'fuzz_jinja_compile_templates'] []
jinja2.exceptions [] []
jinja2.idtracking [] []
random [] []
jinja2.constants [] []
jinja2.debug [] []
marshal [] []
traceback [] []

Directories in report

Directory