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

Fuzzer details

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 17 5.10%
gold [1:9] 0 0.0%
yellow [10:29] 0 0.0%
greenyellow [30:49] 0 0.0%
lawngreen 50+ 316 94.8%
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
3 0 EP call site: 00000 jinja2.environment.Environment.compile_expression
3 12 jinja2.environment.Environment._tokenize call site: 00012 jinja2.lexer.TokenStream.__init__
2 300 jinja2.parser.Parser._fail_ut_eof call site: 00300 .map
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 75 jinja2.parser.Parser.parse_tuple call site: 00075 jinja2.lexer.describe_token
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 266 jinja2.parser.Parser.parse_assign_target call site: 00266 jinja2.parser.Parser.parse_primary
1 278 jinja2.parser.Parser.parse_assign_target call site: 00278 .type
1 315 jinja2.parser.Parser.subparse call site: 00315 body.extend

Runtime coverage analysis

Covered functions
397
Functions that are reachable but not covered
42
Reachable functions
115
Percentage of reachable functions covered
63.48%
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_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 14 4.28%
gold [1:9] 0 0.0%
yellow [10:29] 0 0.0%
greenyellow [30:49] 0 0.0%
lawngreen 50+ 313 95.7%
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
3 17 jinja2.environment.Environment._tokenize call site: 00017 jinja2.lexer.TokenStream.__init__
2 288 jinja2.parser.Parser._fail_ut_eof call site: 00288 .map
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 115 jinja2.parser.Parser.parse_subscript call site: 00115 jinja2.parser.Parser.fail
1 127 jinja2.parser.Parser.parse_call_args call site: 00127 jinja2.lexer.TokenStream.look
1 158 jinja2.parser.Parser.parse_test call site: 00158 jinja2.lexer.Token.test_any
1 228 jinja2.parser.Parser.parse_tuple call site: 00228 jinja2.lexer.describe_token
1 254 jinja2.parser.Parser.parse_assign_target call site: 00254 jinja2.parser.Parser.parse_primary
1 266 jinja2.parser.Parser.parse_assign_target call site: 00266 .type
1 303 jinja2.parser.Parser.subparse call site: 00303 body.extend

Runtime coverage analysis

Covered functions
397
Functions that are reachable but not covered
44
Reachable functions
115
Percentage of reachable functions covered
61.74%
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_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 51 13.4%
gold [1:9] 0 0.0%
yellow [10:29] 0 0.0%
greenyellow [30:49] 0 0.0%
lawngreen 50+ 327 86.5%
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
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__
2 327 jinja2.parser.Parser._fail_ut_eof call site: 00327 .map
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 154 jinja2.parser.Parser.parse_subscript call site: 00154 jinja2.parser.Parser.fail
1 166 jinja2.parser.Parser.parse_call_args call site: 00166 jinja2.lexer.TokenStream.look
1 197 jinja2.parser.Parser.parse_test call site: 00197 jinja2.lexer.Token.test_any
1 267 jinja2.parser.Parser.parse_tuple call site: 00267 jinja2.lexer.describe_token
1 293 jinja2.parser.Parser.parse_assign_target call site: 00293 jinja2.parser.Parser.parse_primary

Runtime coverage analysis

Covered functions
397
Functions that are reachable but not covered
79
Reachable functions
155
Percentage of reachable functions covered
49.03%
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'] 4 0 5 2 4 60 0 195 160
jinja2.ext.InternationalizationExtension.parse jinja2.ext 2 ['N/A', 'N/A'] 2 0 14 20 11 35 0 125 84
jinja2.compiler.optimizeconst.new_func jinja2.compiler 4 ['N/A', 'N/A', 'N/A', 'N/A'] 4 0 0 2 4 48 0 164 78
jinja2.debug.rewrite_traceback_stack jinja2.debug 1 ['N/A'] 1 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'] 1 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'] 2 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'] 0 0 11 27 14 19 1 71 56
jinja2.ext.babel_extract jinja2.ext 4 ['N/A', 'N/A', 'N/A', 'N/A'] 23 0 2 5 5 133 0 451 55
jinja2.compiler.CodeGenerator.visit_Template jinja2.compiler 3 ['N/A', 'N/A', 'N/A'] 4 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'] 2 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
24.0%
173 / 734
Cyclomatic complexity statically reachable by fuzzers
26.0%
648 / 2496

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

Directories in report

Directory