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

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__
6 28 xdg.IconTheme.IconTheme.parse call site: 00028 xdg.IconTheme.IconTheme.parse
3 7 xdg.IniFile.IniFile.__init__ call site: 00007 xdg.IconTheme.IconData.parse
1 3 ...fuzz_icon.TestOneInput call site: 00003 f.write
1 19 xdg.IniFile.IniFile.parse call site: 00019 xdg.DesktopEntry.DesktopEntry.parse

Runtime coverage analysis

Covered functions
58
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_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
6 24 xdg.IconTheme.IconTheme.parse call site: 00024 xdg.DesktopEntry.DesktopEntry.parse
1 7 xdg.DesktopEntry.DesktopEntry.__init__ call site: 00007 xdg.DesktopEntry.DesktopEntry.parse

Runtime coverage analysis

Covered functions
58
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.IniFile 31
xdg.IconTheme 6

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 93.5%
gold [1:9] 0 0.0%
yellow [10:29] 0 0.0%
greenyellow [30:49] 0 0.0%
lawngreen 50+ 23 6.47%
All colors 355 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 3 ...fuzz_menu.TestOneInput call site: 00003 xdg.Menu.parse
160 194 xdg.DesktopEntry.DesktopEntry.parse call site: 00194 xdg.Menu.XMLMenuBuilder.parse_kde_legacy_dirs
6 185 xdg.IconTheme.IconTheme.parse call site: 00185 xdg.IconTheme.IconTheme.parse
1 170 xdg.DesktopEntry.DesktopEntry.__init__ call site: 00170 xdg.DesktopEntry.DesktopEntry.parse

Runtime coverage analysis

Covered functions
58
Functions that are reachable but not covered
177
Reachable functions
182
Percentage of reachable functions covered
2.75%
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 7
xdg.Menu 147
xdg.DesktopEntry 11
xdg.IconTheme 6
xdg.IniFile 22

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 64 49.6%
gold [1:9] 0 0.0%
yellow [10:29] 0 0.0%
greenyellow [30:49] 0 0.0%
lawngreen 50+ 65 50.3%
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
35 45 xdg.Mime.MagicDB.merge_file call site: 00045 xdg.Mime.MagicMatchAny.from_file
7 94 xdg.Mime.get_type2 call site: 00094 xdg.Mime._get_type_by_stat
6 31 xdg.Mime.GlobDB.finalise call site: 00031 mtype.canonical
3 90 xdg.Mime.get_type2 call site: 00090 xdg.Mime.get_type_by_name
2 13 xdg.BaseDirectory.load_data_paths call site: 00013 .open
2 82 xdg.Mime.MagicDB.finalise call site: 00082 rule.maxlen
2 86 xdg.Mime._cache_database call site: 00086 .open
2 126 ...fuzz_mime.TestOneInput call site: 00126 .str
1 19 xdg.Mime._cache_database call site: 00019 xdg.Mime.GlobDB.merge_file
1 41 xdg.Mime._cache_database call site: 00041 xdg.Mime.MagicDB.merge_file
1 103 xdg.Mime.get_type2 call site: 00103 .len
1 111 xdg.Mime._is_text call site: 00111 .any

Runtime coverage analysis

Covered functions
57
Functions that are reachable but not covered
56
Reachable functions
72
Percentage of reachable functions covered
22.22%
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

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.doctestcompare.LXMLOutputChecker.output_difference lxml.doctestcompare 4 ['N/A', 'N/A', 'N/A', 'N/A'] 5 0 3 3 4 47 0 160 142
lxml.html._MethodFunc.__call__ lxml.html 4 ['N/A', 'N/A', 'N/A', 'N/A'] 3 0 0 5 5 28 0 100 94
xdg.MenuEditor.MenuEditor.__addEntry xdg.MenuEditor 5 ['N/A', 'N/A', 'N/A', 'N/A', 'N/A'] 2 0 8 6 5 25 7 86 77
lxml.html.HtmlMixin.rewrite_links lxml.html 4 ['N/A', 'N/A', 'N/A', 'N/A'] 9 0 4 7 6 24 3 90 74
lxml.ElementInclude.include lxml.ElementInclude 4 ['N/A', 'N/A', 'N/A', 'N/A'] 3 0 1 6 5 23 0 81 69
xdg.IconTheme.getIconPath xdg.IconTheme 4 ['N/A', 'N/A', 'N/A', 'N/A'] 9 0 1 11 7 53 1 191 67
lxml.html.soupparser._parse lxml.html.soupparser 4 ['N/A', 'N/A', 'N/A', 'N/A'] 4 0 0 6 5 23 3 78 63
lxml.html.formfill._fill_form lxml.html.formfill 2 ['N/A', 'N/A'] 3 0 2 7 6 18 2 66 47
lxml.html._diffcommand.main lxml.html._diffcommand 1 ['N/A'] 2 0 5 5 5 19 0 64 46
xdg.MenuEditor.MenuEditor.__saveEntries xdg.MenuEditor 2 ['N/A', 'N/A'] 4 0 3 4 5 16 2 59 44

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

Functions statically reachable by fuzzers
33.0%
176 / 538
Cyclomatic complexity statically reachable by fuzzers
38.0%
750 / 1975

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

/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=['xdg.Mime.MagicDB.merge_file', 'xdg.Mime.get_type2', 'xdg.Mime.GlobDB.finalise', 'xdg.BaseDirectory.load_data_paths', 'xdg.Mime.MagicDB.finalise', 'xdg.Mime._cache_database', '...fuzz_mime.TestOneInput']

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

Directories in report

Directory