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

Project overview: dulwich

High level conclusions

Reachability and coverage overview

Functions statically reachable by fuzzers
6.0%
86 / 1448
Cyclomatic complexity statically reachable by fuzzers
6.0%
306 / 4920
Runtime code coverage of functions
19.0%
272 / 1448

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_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 72 31.4%
gold [1:9] 0 0.0%
yellow [10:29] 0 0.0%
greenyellow [30:49] 0 0.0%
lawngreen 50+ 157 68.5%
All colors 229 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 185 dulwich.config.StackedConfig.default_backends call site: 00185 dulwich.config.get_win_system_paths
11 127 dulwich.repo.Repo.__init__ call site: 00127 dulwich.object_store.DiskObjectStore.from_config
9 147 dulwich.repo.Repo.__init__ call site: 00147 dulwich.repo.parse_graftpoints
7 25 dulwich.repo.Repo.__init__ call site: 00025 os.path.isfile
6 33 dulwich.repo.Repo.__init__ call site: 00033 dulwich.repo.read_gitfile
4 44 dulwich.repo.Repo.get_named_file call site: 00044 os.path.join
3 7 dulwich.repo.Repo.init call site: 00007 ctypes.WINFUNCTYPE
3 207 dulwich.repo.Repo._init_maybe_bare call site: 00207 test_utils.EnhancedFuzzedDataProvider.ConsumeRandomBytes
2 120 dulwich.config.ConfigDict._check_section_and_name call site: 00120 subsection.encode
2 219 ...dulwich.fuzzing.fuzz-targets.fuzz_repo.TestOneInput call site: 00219 repo.do_commit
2 226 ...dulwich.fuzzing.fuzz-targets.fuzz_repo.TestOneInput call site: 00226 test_utils.EnhancedFuzzedDataProvider.ConsumeRandomInt
1 3 ...dulwich.fuzzing.fuzz-targets.fuzz_repo.TestOneInput call site: 00003 os.mkdir

Runtime coverage analysis

Covered functions
303
Functions that are reachable but not covered
77
Reachable functions
113
Percentage of reachable functions covered
31.86%
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
...dulwich.fuzzing.fuzz-targets.fuzz_repo 17
dulwich.repo 42
dulwich.object_store 6
dulwich.config 52
dulwich.file 7
dulwich.refs 3
dulwich.objects 3
dulwich.hooks 2

Fuzzer: fuzz_configfile

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 2 3.44%
gold [1:9] 0 0.0%
yellow [10:29] 0 0.0%
greenyellow [30:49] 0 0.0%
lawngreen 50+ 56 96.5%
All colors 58 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
2 0 EP call site: 00000 dulwich.config.ConfigFile.from_file

Runtime coverage analysis

Covered functions
303
Functions that are reachable but not covered
23
Reachable functions
30
Percentage of reachable functions covered
23.33%
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
...dulwich.fuzzing.fuzz-targets.fuzz_configfile 3
dulwich.config 26

Fuzzer: fuzz_object_store

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 48 60.7%
gold [1:9] 0 0.0%
yellow [10:29] 0 0.0%
greenyellow [30:49] 0 0.0%
lawngreen 50+ 31 39.2%
All colors 79 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
19 59 dulwich.objects.S_ISGITLINK call site: 00059 dulwich.patch.unified_diff
13 45 dulwich.patch.write_tree_diff call site: 00045 dulwich.patch.write_object_diff
12 32 ...dulwich.fuzzing.fuzz-targets.fuzz_object_store.TestOneInput call site: 00032 dulwich.patch.write_tree_diff
2 0 EP call site: 00000 dulwich.repo.MemoryRepo.__init__
2 10 dulwich.config.ConfigFile.__init__ call site: 00010 dulwich.objects.ShaFile.from_string

Runtime coverage analysis

Covered functions
302
Functions that are reachable but not covered
32
Reachable functions
44
Percentage of reachable functions covered
27.27%
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
...dulwich.fuzzing.fuzz-targets.fuzz_object_store 14
dulwich.repo 4
dulwich.refs 2
dulwich.object_store 1
dulwich.config 1
dulwich.objects 4
dulwich.patch 21

Fuzzer: fuzz_bundle

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 121 66.8%
gold [1:9] 0 0.0%
yellow [10:29] 0 0.0%
greenyellow [30:49] 0 0.0%
lawngreen 50+ 60 33.1%
All colors 181 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
53 12 dulwich.pack.pack_objects_to_data call site: 00012 dulwich.pack.deltify_pack_objects
20 84 dulwich.pack.PackChunkGenerator._pack_data_chunks call site: 00084 dulwich.pack.pack_object_chunks
16 163 ...dulwich.fuzzing.fuzz-targets.fuzz_bundle.TestOneInput call site: 00163 dulwich.bundle._read_bundle
10 126 dulwich.pack.read_pack_header call site: 00126 dulwich.pack.PackStreamReader._buf_len
6 66 dulwich.pack.pack_objects_to_data call site: 00066 dulwich.pack.full_unpacked_object
6 156 dulwich.bundle.write_bundle call site: 00156 dulwich.pack.write_pack_data
4 137 dulwich.pack.read_pack_header call site: 00137 dulwich.contrib.swift.SwiftPackReader.read
2 6 ...dulwich.fuzzing.fuzz-targets.fuzz_bundle.TestOneInput call site: 00006 test_utils.EnhancedFuzzedDataProvider.ConsumeRandomString
1 73 dulwich.pack.write_pack_objects call site: 00073 dulwich.pack.PackChunkGenerator.__iter__
1 77 dulwich.pack.PackChunkGenerator.__init__ call site: 00077 .len
1 113 dulwich.pack.PackData.from_file call site: 00113 dulwich.file.GitFile
1 117 dulwich.file._GitFile.__init__ call site: 00117 .getattr

Runtime coverage analysis

Covered functions
303
Functions that are reachable but not covered
90
Reachable functions
107
Percentage of reachable functions covered
15.89%
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
...dulwich.fuzzing.fuzz-targets.fuzz_bundle 13
dulwich.pack 73
dulwich.file 7
dulwich.contrib.swift 4
dulwich.bundle 19

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
dulwich.client.GitClient.clone dulwich.client 13 ['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'] 8 0 10 12 8 287 0 946 454
dulwich.porcelain.checkout_branch dulwich.porcelain 3 ['N/A', 'N/A', 'N/A'] 10 0 12 7 6 195 0 640 368
dulwich.repo.BaseRepo.do_commit dulwich.repo 14 ['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'] 6 0 13 20 11 179 0 582 308
dulwich.porcelain.upload_pack dulwich.porcelain 3 ['N/A', 'N/A', 'N/A'] 8 0 2 2 4 232 1 754 276
dulwich.porcelain.pull dulwich.porcelain 11 ['N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A'] 9 0 4 5 5 165 1 536 234
dulwich.object_store.DiskObjectStore._complete_pack dulwich.object_store 6 ['N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A'] 8 0 13 3 4 121 2 379 187
dulwich.refs.RefsContainer.import_refs dulwich.refs 8 ['N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A'] 6 0 4 3 4 103 0 341 176

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

Functions statically reachable by fuzzers
26.0%
373 / 1448
Cyclomatic complexity statically reachable by fuzzers
27.0%
1340 / 4920

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/dulwich/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=['dulwich.config.StackedConfig.default_backends', 'dulwich.repo.Repo.__init__', 'dulwich.repo.Repo.get_named_file', 'dulwich.repo.Repo.init', 'dulwich.repo.Repo._init_maybe_bare', 'dulwich.config.ConfigDict._check_section_and_name', '...dulwich.fuzzing.fuzz-targets.fuzz_repo.TestOneInput']

/src/dulwich/fuzzing/fuzz-targets/fuzz_configfile.py

Dictionary

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


/src/dulwich/fuzzing/fuzz-targets/fuzz_object_store.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=['dulwich.objects.S_ISGITLINK', 'dulwich.patch.write_tree_diff', '...dulwich.fuzzing.fuzz-targets.fuzz_object_store.TestOneInput', 'dulwich.config.ConfigFile.__init__']

/src/dulwich/fuzzing/fuzz-targets/fuzz_bundle.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=['dulwich.pack.pack_objects_to_data', 'dulwich.pack.PackChunkGenerator._pack_data_chunks', '...dulwich.fuzzing.fuzz-targets.fuzz_bundle.TestOneInput', 'dulwich.pack.read_pack_header', 'dulwich.bundle.write_bundle', 'dulwich.pack.write_pack_objects', 'dulwich.pack.PackChunkGenerator.__init__']

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
[] []
os [] []
collections [] []
dulwich.graph [] []
dulwich.contrib.diffstat [] []
gzip [] []
dulwich.bundle ['fuzz_bundle'] []
re [] []
dulwich.server [] []
dulwich.objects ['fuzz_repo', 'fuzz_object_store'] []
winreg [] []
datetime [] []
fastimport [] []
io [] []
dulwich.lfs [] []
dulwich.patch ['fuzz_object_store'] []
zlib [] []
gevent [] []
itertools [] []
dulwich.credentials [] []
posixpath [] []
...dulwich.fuzzing.fuzz-targets.fuzz_bundle ['fuzz_bundle'] []
paramiko [] []
dulwich [] []
win32api [] []
mmap [] []
dulwich.pack ['fuzz_bundle'] []
pathlib [] []
geventhttpclient [] []
wsgiref [] []
difflib [] []
dulwich.cloud.gcs [] []
dulwich.config ['fuzz_repo', 'fuzz_configfile', 'fuzz_object_store'] []
dulwich.refs ['fuzz_repo', 'fuzz_object_store'] []
dulwich.archive [] []
dulwich.porcelain [] []
dulwich.cli [] []
dulwich.contrib.release_robot [] []
hashlib [] []
dulwich.objectspec [] []
dulwich.errors [] []
select [] []
dulwich.index [] []
dulwich.hooks ['fuzz_repo'] []
msvcrt [] []
dulwich.client [] []
...dulwich.fuzzing.fuzz-targets.fuzz_configfile ['fuzz_configfile'] []
shlex [] []
dulwich.diff_tree [] []
...dulwich.fuzzing.fuzz-targets.fuzz_object_store ['fuzz_object_store'] []
heapq [] []
gpg [] []
dulwich.reflog [] []
atheris [] []
stat [] []
copy [] []
subprocess [] []
dulwich.log_utils [] []
dulwich.greenthreads [] []
contextlib [] []
fnmatch [] []
functools [] []
dulwich.line_ending [] []
dulwich.cloud [] []
ctypes [] []
time [] []
cdifflib [] []
tarfile [] []
warnings [] []
dulwich.walk [] []
dulwich.file ['fuzz_repo', 'fuzz_bundle'] []
json [] []
dulwich.contrib.requests_vendor [] []
ipaddress [] []
dulwich.mailmap [] []
test_utils [] []
dulwich.protocol [] []
argparse [] []
pdb [] []
optparse [] []
tempfile [] []
shutil [] []
dulwich.repo ['fuzz_repo', 'fuzz_object_store'] []
dulwich.lru_cache [] []
pwd [] []
dulwich.contrib.swift ['fuzz_bundle'] []
...dulwich.fuzzing.fuzz-targets.fuzz_repo ['fuzz_repo'] []
urllib [] []
binascii [] []
getopt [] []
dulwich.submodule [] []
signal [] []
dulwich.web [] []
platform [] []
urllib3 [] []
dulwich.fastexport [] []
dulwich.object_store ['fuzz_repo', 'fuzz_object_store'] []
[] []
struct [] []
sys [] []
socketserver [] []
dulwich.ignore [] []
dulwich.stash [] []
typing [] []
logging [] []
configparser [] []
requests [] []
socket [] []
dulwich.__main__ [] []
dulwich.contrib [] []
dulwich.contrib.paramiko_vendor [] []

Directories in report

Directory