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

Fuzzer details

Fuzzer: xpath

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 3615 62.1%
gold [1:9] 235 4.03%
yellow [10:29] 81 1.39%
greenyellow [30:49] 48 0.82%
lawngreen 50+ 1840 31.6%
All colors 5819 100

Fuzz blockers

The followings are the branches where fuzzer fails to bypass.

Unique non-covered Complexity Unique Reachable Complexities Unique Reachable Functions All non-covered Complexity All Reachable Complexity Function Name Function Callsite Blocked Branch
8675 26452 7 :

['xmlParserShrink', 'xmlSkipBlankChars', 'xmlParserGrow', 'xmlParsePEReference', 'xmlNextChar', 'xmlParseConditionalSections', 'xmlParseMarkupDecl']

8675 30326 xmlParseInternalSubset call site: 02302 /src/libxml2/parser.c:8142
8533 22818 5 :

['xmlParserEntityCheck', 'xmlParseExternalEntityPrivate', 'xmlErrMsgStr', 'xmlFatalErr', 'xmlParseBalancedChunkMemoryInternal']

8533 22818 xmlParseReference call site: 02631 /src/libxml2/parser.c:7066
8468 8848 5 :

['xmlStrdup', 'xmlCompileAttributeTest', 'xmlDictLookup', 'xmlStrEqual', 'xmlPatScanName']

8468 8872 xmlCompileStepPattern call site: 02907 /src/libxml2/pattern.c:1053
5726 7653 3 :

['xmlNsWarnMsg', 'xmlSAX2ErrMemory', 'xmlNewNs']

5726 19332 xmlSAX2StartElementNs call site: 00538 /src/libxml2/SAX2.c:2381
5618 10076 3 :

['xmlXPathParseName', 'xmlXPtrEvalChildSeq', 'xmlXPathRoot']

5618 11987 xmlXPtrEvalXPtrPart call site: 04853 /src/libxml2/xpointer.c:1026
5033 9055 6 :

['xmlNextChar', 'xmlSaturatedAddSizeT', 'xmlSaturatedAdd', 'xmlPopInput', 'xmlParserEntityCheck', 'xmlParsePEReference']

5033 9055 xmlSkipBlankChars call site: 00982 /src/libxml2/parser.c:1942
5033 9055 6 :

['xmlNextChar', 'xmlSaturatedAddSizeT', 'xmlSaturatedAdd', 'xmlPopInput', 'xmlParserEntityCheck', 'xmlParsePEReference']

5033 9055 xmlSkipBlankChars call site: 00990 /src/libxml2/parser.c:1949
3920 6274 3 :

['xmlHasNsProp', 'xmlFreeProp', 'xmlUnlinkNode']

3920 6274 xmlAddChild call site: 00421 /src/libxml2/tree.c:3487
3827 8572 4 :

['xmlErrMemory', 'xmlSAX2EntityDecl', 'xmlNewDtd', 'xmlNewDoc']

3827 19431 xmlParseEntityDecl call site: 01490 /src/libxml2/parser.c:5265
3820 14012 4 :

['xmlCopyCharMultiByte', 'xmlErrMemory', 'xmlNextChar', 'xmlCurrentChar']

3820 17834 xmlParseSystemLiteral call site: 01455 /src/libxml2/parser.c:3985
3812 3821 2 :

['__xmlRegisterNodeDefaultValue', 'xmlStrdup']

13996 42833 xmlSAX2StartElementNs call site: 00223 /src/libxml2/SAX2.c:2262
3812 3821 2 :

['__xmlRegisterNodeDefaultValue', 'xmlStrdup']

5931 24714 xmlSAX2AttributeNs call site: 00555 /src/libxml2/SAX2.c:2006

Runtime coverage analysis

Covered functions
758
Functions that are reachable but not covered
515
Reachable functions
1183
Percentage of reachable functions covered
56.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
libxslt/tests/fuzz/xpath.c 1
libxslt/tests/fuzz/fuzz.c 7
libxml2/hash.c 24
libxml2/parser.c 117
libxml2/threads.c 14
libxml2/error.c 12
libxml2/globals.c 20
libxml2/xmlmemory.c 1
libxml2/dict.c 13
libxml2/encoding.c 12
libxml2/xmlIO.c 14
libxml2/xpath.c 196
libxml2/parserInternals.c 28
libxml2/SAX2.c 37
libxml2/xmlstring.c 22
libxml2/tree.c 102
libxml2/valid.c 48
libxml2/entities.c 19
libxml2/buf.c 21
libxml2/list.c 8
libxml2/chvalid.c 1
libxml2/uri.c 34
libxml2/catalog.c 11
libxml2/HTMLparser.c 2
libxslt/libxslt/transform.c 48
libxslt/libxslt/extensions.c 15
libxslt/libxslt/xsltutils.c 11
libxslt/libxslt/variables.c 23
libxml2/pattern.c 32
libxml2/./timsort.h 12
libxslt/libxslt/extra.c 1
libxml2/debugXML.c 27
libxslt/libxslt/templates.c 6
libxslt/libxslt/keys.c 9
libxslt/libxslt/namespaces.c 3
libxslt/libxslt/imports.c 4
libxslt/libxslt/attributes.c 2
libxslt/libxslt/attrvt.c 1
libxslt/libxslt/functions.c 12
libxslt/libxslt/documents.c 4
libxslt/libxslt/security.c 4
libxml2/xinclude.c 26
libxml2/xpointer.c 10
libxslt/libxslt/xslt.c 2
libxslt/libxslt/numbers.c 15
libxslt/libxslt/pattern.c 10
libxslt/libxslt/xsltlocale.c 4

Fuzzer: xslt

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 2451 31.6%
gold [1:9] 254 3.27%
yellow [10:29] 104 1.34%
greenyellow [30:49] 44 0.56%
lawngreen 50+ 4900 63.2%
All colors 7753 100

Fuzz blockers

The followings are the branches where fuzzer fails to bypass.

Unique non-covered Complexity Unique Reachable Complexities Unique Reachable Functions All non-covered Complexity All Reachable Complexity Function Name Function Callsite Blocked Branch
10198 120551 29 :

['xmlHashAddEntry2', 'xmlStrcasecmp', 'fopen', 'xsltNewStylesheet', 'xmlURIEscapeStr', 'xsltGetHTMLIDs', 'xmlDictReference', 'xmlIsBlankNode', 'xmlStrEqual', 'xmlNewDoc', 'fclose', 'xmlDictQLookup', 'xmlCreateIntSubset', 'xmlHashCreate', 'xsltSaveResultToFile', 'xsltFreeStylesheet', 'htmlNewDoc', 'xmlStrndup', 'xmlStrdup', 'xmlFreeDoc', 'xsltCheckWrite', 'xsltGetQNameURI', 'xmlBuildURI', 'xsltSaveResultToFilename', 'xsltApplySequenceConstructor', 'htmlNewDocNoDtD', 'xsltEvalAttrValueTemplate', 'xmlDocGetRootElement', 'xsltNextImport']

10198 121211 xsltDocumentElem call site: 04268 /src/libxslt/libxslt/transform.c:3442
5915 5915 1 :

['xsltEvalUserParams']

7925 44511 xsltApplyStylesheetInternal call site: 07660 /src/libxslt/libxslt/transform.c:6002
4187 10563 3 :

['xmlXPathCtxtCompile', 'xsltEvalXPathString', 'xmlXPathFreeCompExpr']

14385 149450 xsltDocumentElem call site: 04258 /src/libxslt/libxslt/transform.c:3397
4000 4000 1 :

['xhtmlNodeDumpOutput']

4000 4000 xmlNodeDumpOutput call site: 04935 /src/libxml2/xmlsave.c:2300
3920 6274 3 :

['xmlHasNsProp', 'xmlFreeProp', 'xmlUnlinkNode']

3920 6274 xmlAddChild call site: 00448 /src/libxml2/tree.c:3487
3812 3821 2 :

['__xmlRegisterNodeDefaultValue', 'xmlStrdup']

6546 24714 xmlSAX2AttributeNs call site: 00582 /src/libxml2/SAX2.c:2006
3812 3821 2 :

['__xmlRegisterNodeDefaultValue', 'xmlStrdup']

6362 42833 xmlSAX2StartElementNs call site: 00251 /src/libxml2/SAX2.c:2262
2724 2724 1 :

['xmlStringGetNodeList']

6536 6536 xmlNewDocProp call site: 02651 /src/libxml2/tree.c:2069
2724 2724 1 :

['xmlStringGetNodeList']

2724 2724 xmlNewDocNode call site: 00528 /src/libxml2/tree.c:2360
2724 2724 1 :

['xmlStringGetNodeList']

2724 2724 xmlNewDocNodeEatName call site: 00264 /src/libxml2/tree.c:2393
2656 5033 4 :

['xmlStrcasestr', 'xmlUnlinkNode', 'xmlFreeNode', 'xmlSetProp']

2656 5033 htmlSetMetaEncoding call site: 04733 /src/libxml2/HTMLtree.c:267
2550 2550 1 :

['xmlAddSibling']

2550 25773 xmlSAX2StartElementNs call site: 00551 /src/libxml2/SAX2.c:2358

Runtime coverage analysis

Covered functions
1331
Functions that are reachable but not covered
316
Reachable functions
1436
Percentage of reachable functions covered
77.99%
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
libxslt/tests/fuzz/xslt.c 1
libxslt/tests/fuzz/fuzz.c 11
libxml2/hash.c 24
libxml2/parser.c 117
libxml2/threads.c 14
libxml2/error.c 12
libxml2/globals.c 24
libxml2/xmlmemory.c 1
libxml2/dict.c 13
libxml2/encoding.c 14
libxml2/xmlIO.c 29
libxml2/xpath.c 192
libxml2/xmlstring.c 23
libxml2/parserInternals.c 28
libxml2/SAX2.c 37
libxml2/tree.c 110
libxml2/valid.c 56
libxml2/entities.c 21
libxml2/buf.c 24
libxml2/list.c 8
libxml2/chvalid.c 1
libxml2/uri.c 34
libxml2/catalog.c 11
libxml2/HTMLparser.c 5
libxslt/libxslt/xslt.c 35
libxslt/libxslt/xsltutils.c 21
libxslt/libxslt/extra.c 3
libxslt/libxslt/extensions.c 35
libxml2/debugXML.c 27
libxslt/libxslt/preproc.c 29
libxslt/libxslt/templates.c 8
libxslt/libxslt/transform.c 54
libxml2/pattern.c 32
libxml2/./timsort.h 12
libxslt/libxslt/security.c 7
libxslt/libxslt/imports.c 8
libxslt/libxslt/variables.c 32
libxslt/libxslt/keys.c 16
libxslt/libxslt/namespaces.c 5
libxslt/libxslt/attributes.c 20
libxslt/libxslt/attrvt.c 6
libxml2/HTMLtree.c 9
libxml2/xmlsave.c 26
libxslt/libxslt/pattern.c 31
libxslt/libxslt/documents.c 7
libxslt/libxslt/functions.c 12
libxml2/xinclude.c 26
libxml2/xpointer.c 10
libxslt/libxslt/numbers.c 15
libxslt/libxslt/xsltlocale.c 4

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
LLVMFuzzerInitialize /src/libxslt/tests/fuzz/xpath.c 2 ['int *', 'char ***'] 24 0 18 3 2 1189 0 13729 1970
xmlShell /src/libxml2/debugXML.c 4 ['struct._xmlDoc *', 'char *', 'func_type *', 'struct._IO_FILE *'] 91 0 2131 294 84 1099 0 15527 1610
xmlDefaultExternalEntityLoader /src/libxml2/xmlIO.c 3 ['char *', 'char *', 'struct._xmlParserCtxt *'] 82 0 142 22 9 664 2 9141 411
xmlDOMWrapAdoptNode /src/libxml2/tree.c 6 ['struct._xmlDOMWrapCtxt *', 'struct._xmlDoc *', 'struct._xmlNode *', 'struct._xmlDoc *', 'struct._xmlNode *', 'int '] 54 0 766 145 49 232 0 2451 348
xmlParseSGMLCatalog /src/libxml2/catalog.c 4 ['struct._xmlCatalog *', 'char *', 'char *', 'int '] 85 0 1110 234 79 230 6 2688 256
htmlParseContent /src/libxml2/HTMLparser.c 1 ['struct._xmlParserCtxt *'] 85 0 959 159 60 300 2 3433 148
xmlValidateNMToken /src/libxml2/tree.c 2 ['char *', 'int '] 55 0 1183 272 110 207 0 2067 110

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

Functions statically reachable by fuzzers
78.0%
1754 / 2243
Cyclomatic complexity statically reachable by fuzzers
88.0%
24312 / 27478

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

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
[] []
/src/libxml2/hash.c ['xpath', 'xslt'] ['xpath', 'xslt']
/src/libxslt/libexslt/saxon.c [] []
/src/libxslt/libxslt/imports.c ['xpath', 'xslt'] ['xpath', 'xslt']
/src/libxslt/tests/fuzz/fuzz.c ['xpath', 'xslt'] ['xpath', 'xslt']
/src/libxml2/tree.c ['xpath', 'xslt'] ['xpath', 'xslt']
/src/libxslt/libxslt/pattern.c ['xpath', 'xslt'] ['xslt']
/src/libxslt/libxslt/functions.c ['xpath', 'xslt'] ['xpath', 'xslt']
/src/libxslt/libexslt/strings.c [] []
/src/libxslt/libexslt/exslt.c [] []
/src/libxml2/SAX2.c ['xpath', 'xslt'] ['xpath', 'xslt']
/src/libxml2/debugXML.c ['xpath', 'xslt'] []
/src/libxml2/buf.c ['xpath', 'xslt'] ['xpath', 'xslt']
/src/libxml2/valid.c ['xpath', 'xslt'] ['xpath', 'xslt']
/src/libxml2/xpointer.c ['xpath', 'xslt'] ['xpath', 'xslt']
/src/libxslt/libxslt/xsltutils.c ['xpath', 'xslt'] ['xpath', 'xslt']
/src/libxml2/uri.c ['xpath', 'xslt'] ['xpath', 'xslt']
/src/libxml2/xmlstring.c ['xpath', 'xslt'] ['xpath', 'xslt']
/src/libxslt/libexslt/common.c [] []
/src/libxslt/libxslt/security.c ['xpath', 'xslt'] ['xpath', 'xslt']
/src/libxml2/chvalid.c ['xpath', 'xslt'] ['xpath', 'xslt']
/src/libxml2/HTMLtree.c ['xslt'] ['xslt']
/src/libxslt/libxslt/variables.c ['xpath', 'xslt'] ['xpath', 'xslt']
/src/libxslt/libxslt/keys.c ['xpath', 'xslt'] ['xpath', 'xslt']
/src/libxml2/nanohttp.c [] []
/src/libxslt/libxslt/extra.c ['xpath', 'xslt'] ['xpath', 'xslt']
/src/libxslt/libxslt/templates.c ['xpath', 'xslt'] ['xslt']
/src/libxml2/error.c ['xpath', 'xslt'] ['xpath', 'xslt']
/src/libxml2/catalog.c ['xpath', 'xslt'] ['xpath', 'xslt']
/src/libxml2/xmlsave.c ['xslt'] ['xslt']
/src/libxml2/xpath.c ['xpath', 'xslt'] ['xpath', 'xslt']
/src/libxml2/pattern.c ['xpath', 'xslt'] ['xpath', 'xslt']
/src/libxml2/dict.c ['xpath', 'xslt'] ['xpath', 'xslt']
/src/libxslt/libexslt/dynamic.c [] []
/src/libxml2/list.c ['xpath', 'xslt'] ['xslt']
/src/libxslt/libxslt/preproc.c ['xslt'] ['xslt']
/src/libxslt/libxslt/attrvt.c ['xpath', 'xslt'] ['xslt']
/src/libxml2/parser.c ['xpath', 'xslt'] ['xpath', 'xslt']
/src/libxslt/libexslt/functions.c [] []
/src/libxslt/libexslt/sets.c [] []
/src/libxml2/xmlIO.c ['xpath', 'xslt'] ['xpath', 'xslt']
/src/libxml2/encoding.c ['xpath', 'xslt'] ['xpath', 'xslt']
/src/libxslt/libxslt/attributes.c ['xpath', 'xslt'] ['xslt']
/src/libxslt/libxslt/xslt.c ['xpath', 'xslt'] ['xpath', 'xslt']
/src/libxslt/libexslt/date.c [] []
/src/libxslt/libxslt/transform.c ['xpath', 'xslt'] ['xpath', 'xslt']
/src/libxml2/globals.c ['xpath', 'xslt'] ['xpath', 'xslt']
/src/libxslt/libexslt/crypto.c [] []
/src/libxslt/tests/fuzz/xpath.c ['xpath'] ['xpath']
/src/libxml2/xinclude.c ['xpath', 'xslt'] []
/src/libxml2/threads.c ['xpath', 'xslt'] ['xpath', 'xslt']
/src/libxml2/HTMLparser.c ['xpath', 'xslt'] ['xpath', 'xslt']
/src/libxslt/libxslt/documents.c ['xpath', 'xslt'] ['xpath', 'xslt']
/src/libxslt/tests/fuzz/xslt.c ['xslt'] ['xslt']
/src/libxslt/libxslt/numbers.c ['xpath', 'xslt'] ['xpath', 'xslt']
/src/libxml2/./timsort.h ['xpath', 'xslt'] []
/src/libxml2/xmlmemory.c ['xpath', 'xslt'] ['xpath', 'xslt']
/src/libxslt/libxslt/namespaces.c ['xpath', 'xslt'] ['xslt']
/src/libxml2/entities.c ['xpath', 'xslt'] ['xpath', 'xslt']
/src/libxml2/parserInternals.c ['xpath', 'xslt'] ['xpath', 'xslt']
/src/libxslt/libxslt/extensions.c ['xpath', 'xslt'] ['xpath', 'xslt']
/src/libxslt/libxslt/xsltlocale.c ['xpath', 'xslt'] ['xslt']
/src/libxslt/libexslt/math.c [] []

Directories in report

Directory
/src/libxslt/tests/fuzz/
/src/libxml2/
/src/libxml2/./
/src/libxslt/libexslt/
/src/libxslt/libxslt/