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_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_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 157 89.2%
gold [1:9] 0 0.0%
yellow [10:29] 0 0.0%
greenyellow [30:49] 0 0.0%
lawngreen 50+ 19 10.7%
All colors 176 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 23 ...fuzz_icon.TestOneInput call site: 00023 xdg.DesktopEntry.DesktopEntry.checkKey
7 168 ...fuzz_icon.TestOneInput call site: 00168 xdg.IconTheme.IconData.__init__
4 17 xdg.IconTheme.IconTheme.parse call site: 00017 xdg.IconTheme.IconData.parse
3 10 xdg.IconTheme.IconTheme.parse call site: 00010 xdg.IconTheme.IconTheme.parse
1 3 ...fuzz_icon.TestOneInput call site: 00003 f.write
1 7 xdg.IniFile.IniFile.__init__ call site: 00007 xdg.IconTheme.IconTheme.parse

Runtime coverage analysis

Covered functions
32
Functions that are reachable but not covered
53
Reachable functions
60
Percentage of reachable functions covered
11.67%
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 15
xdg.IniFile 35
xdg.DesktopEntry 14

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 114 85.7%
gold [1:9] 0 0.0%
yellow [10:29] 0 0.0%
greenyellow [30:49] 0 0.0%
lawngreen 50+ 19 14.2%
All colors 133 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 49 ...fuzz_desktop_entry.TestOneInput call site: 00049 xdg.IniFile.IniFile.checkValue
26 19 xdg.DesktopEntry.DesktopEntry.parse call site: 00019 xdg.DesktopEntry.DesktopEntry.new
3 10 xdg.DesktopEntry.DesktopEntry.parse call site: 00010 xdg.DesktopEntry.DesktopEntry.parse
2 16 xdg.IconTheme.IconTheme.parse call site: 00016 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
46
Reachable functions
50
Percentage of reachable functions covered
8.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_desktop_entry 9
xdg.DesktopEntry 19
xdg.IconTheme 5
xdg.IniFile 23

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_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 332 95.9%
gold [1:9] 0 0.0%
yellow [10:29] 0 0.0%
greenyellow [30:49] 0 0.0%
lawngreen 50+ 14 4.04%
All colors 346 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 185 xdg.DesktopEntry.DesktopEntry.parse call site: 00185 xdg.Menu.XMLMenuBuilder.parse_kde_legacy_dirs
3 177 xdg.IconTheme.IconTheme.parse call site: 00177 xdg.IconTheme.IconTheme.parse
2 181 xdg.IconTheme.IconTheme.parse call site: 00181 os.path.dirname
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
173
Reachable functions
177
Percentage of reachable functions covered
2.26%
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 10
xdg.IconTheme 5
xdg.IniFile 14

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'] 8 0 4 5 5 85 1 289 268
lxml.doctestcompare.LXMLOutputChecker.output_difference lxml.doctestcompare 4 ['N/A', 'N/A', 'N/A', 'N/A'] 5 0 3 3 4 49 0 166 133
lxml.sax.ElementTreeProducer.saxify lxml.sax 1 ['N/A'] 2 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'] 3 0 8 6 5 24 7 83 74
lxml.ElementInclude._include lxml.ElementInclude 5 ['N/A', 'N/A', 'N/A', 'N/A', 'N/A'] 2 0 2 15 9 22 2 82 73
xdg.IconTheme.getIconPath xdg.IconTheme 4 ['N/A', 'N/A', 'N/A', 'N/A'] 10 0 1 11 7 44 1 160 67
lxml.html.HtmlMixin.rewrite_links lxml.html 4 ['N/A', 'N/A', 'N/A', 'N/A'] 10 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%
226 / 666
Cyclomatic complexity statically reachable by fuzzers
38.0%
940 / 2451

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_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_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__']

/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.IconTheme.IconTheme.parse', 'xdg.DesktopEntry.DesktopEntry.__init__']

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

Directories in report

Directory