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

Project functions overview

The following table shows data about each function in the project. The functions included in this table correspond to all functions that exist in the executables of the fuzzers. As such, there may be functions that are from third-party libraries.

For further technical details on the meaning of columns in the below table, please see the Glossary .

Func name Functions filename Args Function call depth Reached by Fuzzers Runtime reached by Fuzzers Combined 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

Fuzzer details

Fuzzer: fuzz_icon

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 159 84.1%
gold [1:9] 0 0.0%
yellow [10:29] 0 0.0%
greenyellow [30:49] 0 0.0%
lawngreen 50+ 30 15.8%
All colors 189 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
141 36 ...fuzz_icon.TestOneInput call site: 00036 xdg.DesktopEntry.DesktopEntry.checkKey
7 181 ...fuzz_icon.TestOneInput call site: 00181 xdg.IconTheme.IconData.__init__
4 21 xdg.IconTheme.IconTheme.parse call site: 00021 xdg.IconTheme.IconTheme.parse
4 30 xdg.IconTheme.IconTheme.parse call site: 00030 xdg.IconTheme.IconData.parse
1 3 ...fuzz_icon.TestOneInput call site: 00003 f.write
1 7 xdg.IniFile.IniFile.__init__ call site: 00007 xdg.IniFile.IniFile.parse
1 17 xdg.IniFile.IniFile.parse call site: 00017 xdg.IconTheme.IconTheme.parse

Runtime coverage analysis

Covered functions
32
Functions that are reachable but not covered
61
Reachable functions
69
Percentage of reachable functions covered
11.59%
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_icon 10
xdg.IconTheme 16
xdg.IniFile 45
xdg.DesktopEntry 15

Fuzzer: fuzz_xml_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 3 75.0%
gold [1:9] 0 0.0%
yellow [10:29] 0 0.0%
greenyellow [30:49] 0 0.0%
lawngreen 50+ 1 25.0%
All colors 4 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 atheris.FuzzedDataProvider

Runtime coverage analysis

Covered functions
31
Functions that are reachable but not covered
4
Reachable functions
4
Percentage of reachable functions covered
0.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
...inspector.light.source_files.src.lxml.src.lxml.tests.fuzz_xml_parse 3

Fuzzer: fuzz_desktop_entry

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 115 79.3%
gold [1:9] 0 0.0%
yellow [10:29] 0 0.0%
greenyellow [30:49] 0 0.0%
lawngreen 50+ 30 20.6%
All colors 145 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
82 61 ...fuzz_desktop_entry.TestOneInput call site: 00061 xdg.IniFile.IniFile.checkValue
26 31 xdg.DesktopEntry.DesktopEntry.parse call site: 00031 xdg.DesktopEntry.DesktopEntry.new
2 9 xdg.DesktopEntry.DesktopEntry.parse call site: 00009 xdg.IconTheme.IconData.parse
2 20 xdg.IniFile.IniFile.parse call site: 00020 xdg.DesktopEntry.DesktopEntry.parse
2 26 xdg.IconTheme.IconTheme.parse call site: 00026 os.path.dirname
1 7 xdg.DesktopEntry.DesktopEntry.__init__ call site: 00007 xdg.DesktopEntry.DesktopEntry.parse

Runtime coverage analysis

Covered functions
32
Functions that are reachable but not covered
54
Reachable functions
59
Percentage of reachable functions covered
8.47%
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_desktop_entry 9
xdg.DesktopEntry 20
xdg.IconTheme 6
xdg.IniFile 31

Fuzzer: fuzz_mime

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 114 88.3%
gold [1:9] 0 0.0%
yellow [10:29] 0 0.0%
greenyellow [30:49] 0 0.0%
lawngreen 50+ 15 11.6%
All colors 129 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
107 5 ...fuzz_mime.TestOneInput call site: 00005 xdg.Mime.get_type_by_name
2 113 ...fuzz_mime.TestOneInput call site: 00113 xdg.Mime.update_cache
2 116 ...fuzz_mime.TestOneInput call site: 00116 xdg.Mime.update_cache
2 126 ...fuzz_mime.TestOneInput call site: 00126 .str
1 123 ...fuzz_mime.TestOneInput call site: 00123 xdg.Mime.MagicDB.__init__

Runtime coverage analysis

Covered functions
31
Functions that are reachable but not covered
72
Reachable functions
72
Percentage of reachable functions covered
0.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.
Function name source code lines source lines hit percentage hit

Files reached

filename functions hit
/ 1
...fuzz_mime 14
xdg.Mime 63
xdg.BaseDirectory 2

Fuzzer: fuzz_menu

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 333 93.0%
gold [1:9] 0 0.0%
yellow [10:29] 0 0.0%
greenyellow [30:49] 0 0.0%
lawngreen 50+ 25 6.98%
All colors 358 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
165 6 ...fuzz_menu.TestOneInput call site: 00006 xdg.Menu.parse
160 197 xdg.DesktopEntry.DesktopEntry.parse call site: 00197 xdg.Menu.XMLMenuBuilder.parse_kde_legacy_dirs
4 190 xdg.IniFile.IniFile.parse call site: 00190 xdg.DesktopEntry.DesktopEntry.parse
2 175 xdg.DesktopEntry.DesktopEntry.parse call site: 00175 xdg.IconTheme.IconData.parse
1 1 ...fuzz_menu.TestOneInput call site: 00001 et.XML
1 173 xdg.DesktopEntry.DesktopEntry.__init__ call site: 00173 xdg.DesktopEntry.DesktopEntry.parse

Runtime coverage analysis

Covered functions
32
Functions that are reachable but not covered
180
Reachable functions
185
Percentage of reachable functions covered
2.7%
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_menu 10
xdg.Menu 147
xdg.DesktopEntry 11
xdg.IconTheme 6
xdg.IniFile 22

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
lxml.html._diffcommand.main lxml.html._diffcommand 1 ['N/A'] 6 0 5 5 5 115 1 379 352
lxml.html._difflib.HtmlDiff.make_table lxml.html._difflib 7 ['N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A'] 7 0 4 5 5 85 1 289 268
lxml.doctestcompare.LXMLOutputChecker.output_difference lxml.doctestcompare 4 ['N/A', 'N/A', 'N/A', 'N/A'] 4 0 3 3 4 48 0 163 130
lxml.sax.ElementTreeProducer.saxify lxml.sax 1 ['N/A'] 3 0 6 2 4 26 1 86 77
xdg.MenuEditor.MenuEditor.__addEntry xdg.MenuEditor 5 ['N/A', 'N/A', 'N/A', 'N/A', 'N/A'] 2 0 8 6 5 24 7 83 74
lxml.ElementInclude._include lxml.ElementInclude 5 ['N/A', 'N/A', 'N/A', 'N/A', 'N/A'] 3 0 2 15 9 22 2 82 73
xdg.IconTheme.getIconPath xdg.IconTheme 4 ['N/A', 'N/A', 'N/A', 'N/A'] 6 0 1 11 7 53 1 191 67
lxml.html.HtmlMixin.rewrite_links lxml.html 4 ['N/A', 'N/A', 'N/A', 'N/A'] 6 0 4 7 6 24 3 90 65
lxml.html.soupparser._parse lxml.html.soupparser 4 ['N/A', 'N/A', 'N/A', 'N/A'] 3 0 0 6 5 23 3 78 63
lxml.html._MethodFunc.__call__ lxml.html 4 ['N/A', 'N/A', 'N/A', 'N/A'] 3 0 0 5 5 28 0 100 52

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

Functions statically reachable by fuzzers
34.0%
227 / 669
Cyclomatic complexity statically reachable by fuzzers
38.0%
947 / 2460

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 Runtime reached by Fuzzers Combined 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/fuzz_icon.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=['...fuzz_icon.TestOneInput', 'xdg.IconTheme.IconTheme.parse', 'xdg.IniFile.IniFile.__init__', 'xdg.IniFile.IniFile.parse']

/src/inspector/light/source_files/src/lxml/src/lxml/tests/fuzz_xml_parse.py

Dictionary

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


/src/fuzz_desktop_entry.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=['...fuzz_desktop_entry.TestOneInput', 'xdg.DesktopEntry.DesktopEntry.parse', 'xdg.IniFile.IniFile.parse', 'xdg.IconTheme.IconTheme.parse', 'xdg.DesktopEntry.DesktopEntry.__init__']

/src/fuzz_mime.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=['...fuzz_mime.TestOneInput']

/src/fuzz_menu.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=['...fuzz_menu.TestOneInput', 'xdg.DesktopEntry.DesktopEntry.parse', 'xdg.IniFile.IniFile.parse', 'xdg.DesktopEntry.DesktopEntry.__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
[] []
html [] []
xdg.RecentFiles [] []
etree [] []
warnings [] []
...fuzz_mime ['fuzz_mime'] []
lxml.html._difflib [] []
lxml.html._html5builder [] []
lxml.includes.libexslt [] []
lxml.html.clean [] []
lxml [] []
lxml.html.defs [] []
lxml.html.usedoctest [] []
cgi [] []
lxml.includes [] []
optparse [] []
lxml.html._diffcommand [] []
lxml.html.ElementSoup [] []
fnmatch [] []
webbrowser [] []
BeautifulSoup [] []
doctest [] []
xdg.IconTheme ['fuzz_icon', 'fuzz_desktop_entry', 'fuzz_menu'] []
[] []
lxml.includes.extlibs [] []
lxml.includes.libxslt [] []
collections [] []
xdg.DesktopEntry ['fuzz_icon', 'fuzz_desktop_entry', 'fuzz_menu'] []
functools [] []
lxml.usedoctest [] []
stat [] []
fcntl [] []
re [] []
...fuzz_menu ['fuzz_menu'] []
ast [] []
urllib2 [] []
html5lib [] []
subprocess [] []
time [] []
xdg.Mime ['fuzz_mime'] []
...fuzz_icon ['fuzz_icon'] []
shutil [] []
lxml.html [] []
lxml.ElementInclude [] []
lxml.isoschematron [] []
xdg.IniFile ['fuzz_icon', 'fuzz_desktop_entry', 'fuzz_menu'] []
xdg.util [] []
lxml.html.diff [] []
tempfile [] []
sys [] []
lxml.html.soupparser [] []
cssselect [] []
bs4 [] []
lxml.doctestcompare [] []
lxml.pyclasslookup [] []
os [] []
xdg.MenuEditor [] []
getpass [] []
xdg [] []
lxml.html._setmixin [] []
lxml.includes.libxml [] []
difflib [] []
heapq [] []
...fuzz_desktop_entry ['fuzz_desktop_entry'] []
lxml.html.html5parser [] []
lxml.cssselect [] []
lxml.builder [] []
xdg.BaseDirectory ['fuzz_mime'] []
lxml._elementpath [] []
xdg.Exceptions [] []
io [] []
lxml.html.builder [] []
urlparse [] []
...inspector.light.source_files.src.lxml.src.lxml.tests.fuzz_xml_parse ['fuzz_xml_parse'] []
urllib [] []
atheris [] []
xdg.Config [] []
lxml.html.formfill [] []
xml [] []
xdg.Locale [] []
xdg.Menu ['fuzz_menu'] []
lxml.sax [] []
locale [] []

Directories in report

Directory