Fuzz introspector
For issues and ideas: https://github.com/ossf/fuzz-introspector/issues
Report generation date: 2024-05-27

Project overview: gitpython

High level conclusions

Reachability and coverage overview

Functions statically reachable by fuzzers
9.0%
56 / 643
Cyclomatic complexity statically reachable by fuzzers
10.0%
238 / 2275
Runtime code coverage of functions
42.0%
272 / 643

Warning: The number of runtime covered functions are larger than the number of reachable functions. This means that Fuzz Introspector found there are more functions covered at runtime than what is considered reachable based on the static analysis. This is a limitation in the analysis as anything covered at runtime is by definition reachable by the fuzzers.
This is likely due to a limitation in the static analysis. In this case, the count of functions covered at runtime is the true value, which means this is what should be considered "achieved" by the fuzzer.

Use the project functions table below to query all functions that were not covered at runtime.

Fuzzer details

Fuzzer: fuzz_config

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 19 20.8%
gold [1:9] 0 0.0%
yellow [10:29] 0 0.0%
greenyellow [30:49] 0 0.0%
lawngreen 50+ 72 79.1%
All colors 91 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
13 63 git.config.GitConfigParser._included_paths call site: 00063 git.config.GitConfigParser.items
4 81 git.config.GitConfigParser.read call site: 00081 typing.cast
1 1 ...gitpython.fuzzing.fuzz-targets.fuzz_config.TestOneInput call site: 00001 git.config.GitConfigParser.read
1 89 git.config.GitConfigParser.read call site: 00089 .str

Runtime coverage analysis

Covered functions
319
Functions that are reachable but not covered
67
Reachable functions
74
Percentage of reachable functions covered
9.46%
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
...gitpython.fuzzing.fuzz-targets.fuzz_config 3
git.config 71

Fuzzer: fuzz_blob

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 116 58.5%
gold [1:9] 0 0.0%
yellow [10:29] 0 0.0%
greenyellow [30:49] 0 0.0%
lawngreen 50+ 82 41.4%
All colors 198 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
32 5 git.util.expand_path call site: 00005 typing.cast.tree.resolve
16 56 git.util._is_cygwin_git call site: 00056 git.util.py_where
14 128 git.config.GitConfigParser.__init__ call site: 00128 git.config.get_config_path
11 100 git.repo.fun.is_git_dir call site: 00100 git.repo.base.Repo._config_reader
10 158 git.repo.fun.find_submodule_git_dir call site: 00158 git.repo.fun.find_submodule_git_dir
7 76 git.util._is_cygwin_git call site: 00076 git.util.cygpath
6 170 git.repo.base.Repo.__init__ call site: 00170 git.repo.fun.find_worktree_git_dir
5 143 git.config.GitConfigParser.__init__ call site: 00143 git.util.LockFile._obtain_lock
3 121 git.repo.base.Repo._get_config_path call site: 00121 git.types.assert_never
3 152 git.util.LockFile._obtain_lock_or_raise call site: 00152 configparser.RawConfigParser.has_option
1 42 git.repo.base.Repo.init call site: 00042 os.makedirs
1 49 git.repo.base.Repo.__init__ call site: 00049 os.getcwd

Runtime coverage analysis

Covered functions
320
Functions that are reachable but not covered
100
Reachable functions
122
Percentage of reachable functions covered
18.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
...gitpython.fuzzing.fuzz-targets.fuzz_blob 9
git.repo.base 37
git.util 66
git.cmd 3
git.repo.fun 20
git.config 15
git.db 1

Fuzzer: fuzz_diff

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 331 76.6%
gold [1:9] 0 0.0%
yellow [10:29] 0 0.0%
greenyellow [30:49] 0 0.0%
lawngreen 50+ 101 23.3%
All colors 432 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
101 305 git.cmd.Git.AutoInterrupt._terminate call site: 00305 git.util.RemoteProgress.new_message_handler.handler
67 229 ...gitpython.fuzzing.fuzz-targets.fuzz_diff.TestOneInput call site: 00229 git.diff.Diff._index_from_patch_format
37 5 git.util.expand_path call site: 00005 git.cmd.Popen.tree.resolve
24 407 ...gitpython.fuzzing.fuzz-targets.fuzz_diff.BytesProcessAdapter.__init__ call site: 00407 git.diff.Diff._handle_diff_line
16 61 git.util._is_cygwin_git call site: 00061 git.util.py_where
14 133 git.config.GitConfigParser.__init__ call site: 00133 git.config.get_config_path
11 105 git.repo.fun.is_git_dir call site: 00105 git.repo.base.Repo._config_reader
10 163 git.repo.fun.find_submodule_git_dir call site: 00163 git.repo.fun.find_submodule_git_dir
7 81 git.util._is_cygwin_git call site: 00081 git.util.cygpath
7 210 git.objects.base.IndexObject.__init__ call site: 00210 git.objects.base.IndexObject.__init__
6 175 git.repo.base.Repo.__init__ call site: 00175 git.repo.fun.find_worktree_git_dir
5 148 git.config.GitConfigParser.__init__ call site: 00148 git.util.LockFile._obtain_lock

Runtime coverage analysis

Covered functions
320
Functions that are reachable but not covered
246
Reachable functions
281
Percentage of reachable functions covered
12.46%
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
...gitpython.fuzzing.fuzz-targets.fuzz_diff 15
git.repo.base 37
git.util 123
git.cmd 66
git.repo.fun 20
git.config 15
git.db 1
git.diff 40
git.objects.util 4
git.objects.base 1

Fuzzer: fuzz_repo

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 5 3.37%
gold [1:9] 0 0.0%
yellow [10:29] 0 0.0%
greenyellow [30:49] 0 0.0%
lawngreen 50+ 143 96.6%
All colors 148 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
4 63 ...gitpython.fuzzing.fuzz-targets.fuzz_repo.TestOneInput call site: 00063 os.path.join
1 0 EP call site: 00000 atheris.FuzzedDataProvider

Runtime coverage analysis

Covered functions
320
Functions that are reachable but not covered
141
Reachable functions
144
Percentage of reachable functions covered
2.08%
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
...gitpython.fuzzing.fuzz-targets.fuzz_repo 75
git.objects.tree 2
git.objects.fun 4
git.compat 62

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
git.objects.submodule.base.Submodule.update git.objects.submodule.base 12 ['N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A'] 8 0 22 25 13 634 1 2001 1531
git.objects.submodule.root.RootModule.update git.objects.submodule.root 10 ['N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A'] 6 0 20 24 13 446 0 1393 662
git.cmd.Git.execute git.cmd 16 ['N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A'] 4 0 11 18 10 175 11 548 432

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

Functions statically reachable by fuzzers
19.0%
120 / 643
Cyclomatic complexity statically reachable by fuzzers
22.0%
508 / 2275

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

Fuzz engine guidance

This sections provides heuristics that can be used as input to a fuzz engine when running a given fuzz target. The current focus is on providing input that is usable by libFuzzer.

/src/gitpython/fuzzing/fuzz-targets/fuzz_config.py

Dictionary

Use this with the libFuzzer -dict=DICT.file flag


Fuzzer function priority

Use one of these functions as input to libfuzzer with flag: -focus_function name

-focus_function=['git.config.GitConfigParser._included_paths', 'git.config.GitConfigParser.read', '...gitpython.fuzzing.fuzz-targets.fuzz_config.TestOneInput']

/src/gitpython/fuzzing/fuzz-targets/fuzz_blob.py

Dictionary

Use this with the libFuzzer -dict=DICT.file flag


Fuzzer function priority

Use one of these functions as input to libfuzzer with flag: -focus_function name

-focus_function=['git.util.expand_path', 'git.util._is_cygwin_git', 'git.config.GitConfigParser.__init__', 'git.repo.fun.is_git_dir', 'git.repo.fun.find_submodule_git_dir', 'git.repo.base.Repo.__init__', 'git.repo.base.Repo._get_config_path', 'git.util.LockFile._obtain_lock_or_raise']

/src/gitpython/fuzzing/fuzz-targets/fuzz_diff.py

Dictionary

Use this with the libFuzzer -dict=DICT.file flag


Fuzzer function priority

Use one of these functions as input to libfuzzer with flag: -focus_function name

-focus_function=['git.cmd.Git.AutoInterrupt._terminate', '...gitpython.fuzzing.fuzz-targets.fuzz_diff.TestOneInput', 'git.util.expand_path', '...gitpython.fuzzing.fuzz-targets.fuzz_diff.BytesProcessAdapter.__init__', 'git.util._is_cygwin_git', 'git.config.GitConfigParser.__init__', 'git.repo.fun.is_git_dir', 'git.repo.fun.find_submodule_git_dir', 'git.objects.base.IndexObject.__init__']

/src/gitpython/fuzzing/fuzz-targets/fuzz_repo.py

Dictionary

Use this with the libFuzzer -dict=DICT.file flag


Fuzzer function priority

Use one of these functions as input to libfuzzer with flag: -focus_function name

-focus_function=['...gitpython.fuzzing.fuzz-targets.fuzz_repo.TestOneInput']

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
git.objects.submodule 38 20 52.63% []
git.cmd.handle_process_output.pump_stream 51 2 3.921% []
git.cmd.Git.refresh 35 12 34.28% []
git.cmd.Git.execute.communicate 34 16 47.05% []
git.remote.PushInfo._from_line 32 0 0.0% []
git.remote.FetchInfo._from_line 56 0 0.0% []
git.remote.Remote._get_fetch_info_from_stderr 39 0 0.0% []
repo.git.read_tree 38 17 44.73% []
git.objects.util.parse_date 46 2 4.347% []
git.objects.commit.Commit._deserialize 53 26 49.05% []
git.util.RemoteProgress._parse_progress_line 44 0 0.0% ['fuzz_diff']
git.objects.submodule.base.Submodule.add 56 0 0.0% []
git.objects.submodule.base.Submodule.update 94 0 0.0% []
git.objects.submodule.base.Submodule.move 48 0 0.0% []
git.objects.submodule.base.Submodule.remove 60 0 0.0% []
stream.close 299 141 47.15% []
buf.find 70 16 22.85% []
git.repo.base.Repo.blame_incremental 36 0 0.0% []
git.repo.base.Repo.blame 75 0 0.0% []
git.repo.base.Repo._clone 32 0 0.0% []
git.repo.fun.rev_parse 97 22 22.68% []
git.index.base.IndexFile.checkout.handle_stderr 75 0 0.0% []
f.readline 55 20 36.36% []
git.diff.Diffable.diff 38 4 10.52% []
git.diff.Diff.__str__ 33 0 0.0% ['fuzz_diff']
git.diff.Diff._handle_diff_line 38 0 0.0% ['fuzz_diff']
git.index.fun.aggressive_tree_merge 36 0 0.0% []
git.objects.submodule.root.RootModule.update 104 0 0.0% []
ref.set_reference 44 10 22.72% []

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
[] []
gitdb [] []
...gitpython.fuzzing.fuzz-targets.fuzz_diff ['fuzz_diff'] []
git.repo.fun ['fuzz_blob', 'fuzz_diff'] []
shlex [] []
git.objects.base ['fuzz_diff'] []
git.index.fun [] []
git.objects.blob [] []
git.refs [] []
git.objects.util ['fuzz_diff'] []
stat [] []
fnmatch [] []
enum [] []
inspect [] []
logging [] []
warnings [] []
os [] []
git.refs.log [] []
git.types [] []
git.refs.reference [] []
git.config ['fuzz_config', 'fuzz_blob', 'fuzz_diff'] []
typing_extensions [] []
mimetypes [] []
platform [] []
uuid [] []
configparser [] []
calendar [] []
collections [] []
glob [] []
urllib [] []
git.compat ['fuzz_repo'] []
[] []
git [] []
git.refs.tag [] []
git.remote [] []
threading [] []
functools [] []
struct [] []
git.objects.submodule [] []
atheris [] []
locale [] []
...gitpython.fuzzing.fuzz-targets.fuzz_config ['fuzz_config'] []
git.index [] []
git.objects.commit [] []
git.index.base [] []
typing [] []
git.objects.fun ['fuzz_repo'] []
itertools [] []
git.refs.head [] []
git.refs.symbolic [] []
subprocess [] []
git.objects.submodule.base [] []
git.diff ['fuzz_diff'] []
io [] []
git.repo [] []
git.objects.tree ['fuzz_repo'] []
git.util ['fuzz_blob', 'fuzz_diff'] []
contextlib [] []
git.repo.base ['fuzz_blob', 'fuzz_diff'] []
re [] []
importlib [] []
git.objects.submodule.root [] []
pathlib [] []
git.exc [] []
weakref [] []
git.objects.submodule.util [] []
...gitpython.fuzzing.fuzz-targets.fuzz_repo ['fuzz_repo'] []
git.objects [] []
getpass [] []
...gitpython.fuzzing.fuzz-targets.fuzz_blob ['fuzz_blob'] []
shutil [] []
git.index.typ [] []
datetime [] []
gc [] []
binascii [] []
git.refs.remote [] []
git.cmd ['fuzz_blob', 'fuzz_diff'] []
git.objects.tag [] []
sys [] []
textwrap [] []
time [] []
tempfile [] []
git.db ['fuzz_blob', 'fuzz_diff'] []
git.index.util [] []

Directories in report

Directory