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

Fuzzer details

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 2636 33.9%
gold [1:9] 277 3.56%
yellow [10:29] 108 1.39%
greenyellow [30:49] 50 0.64%
lawngreen 50+ 4693 60.4%
All colors 7764 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
10178 118440 29 :

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

10178 119100 xsltDocumentElem call site: 04314 /src/libxslt/libxslt/transform.c:3442
9516 14275 5 :

['xmlXPathFreeObject', 'xsltTransformError', 'xmlXPtrEval', 'xmlXPtrNewContext', 'xmlXPathFreeContext']

9516 22773 xsltDocumentFunctionLoadDocument call site: 06896 /src/libxslt/libxslt/functions.c:140
5907 5907 1 :

['xsltEvalUserParams']

7911 44426 xsltApplyStylesheetInternal call site: 07672 /src/libxslt/libxslt/transform.c:6002
4180 10543 3 :

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

14358 147295 xsltDocumentElem call site: 04304 /src/libxslt/libxslt/transform.c:3397
3993 3993 1 :

['xhtmlNodeDumpOutput']

3993 3993 xmlNodeDumpOutput call site: 04941 /src/libxml2/xmlsave.c:2300
3908 6256 3 :

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

3908 6256 xmlAddChild call site: 00445 /src/libxml2/tree.c:3489
3800 3809 2 :

['xmlStrdup', '__xmlRegisterNodeDefaultValue']

6527 20693 xmlSAX2AttributeNs call site: 00587 /src/libxml2/SAX2.c:2010
3800 3809 2 :

['xmlStrdup', '__xmlRegisterNodeDefaultValue']

6343 42301 xmlSAX2StartElementNs call site: 00248 /src/libxml2/SAX2.c:2270
2717 2717 1 :

['xmlStringGetNodeList']

6517 6517 xmlNewDocProp call site: 02697 /src/libxml2/tree.c:2071
2717 2717 1 :

['xmlStringGetNodeList']

2717 2717 xmlNewDocNode call site: 00525 /src/libxml2/tree.c:2362
2717 2717 1 :

['xmlStringGetNodeList']

2717 2717 xmlNewDocNodeEatName call site: 00261 /src/libxml2/tree.c:2395
2649 5020 4 :

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

2649 5020 htmlSetMetaEncoding call site: 04738 /src/libxml2/HTMLtree.c:267

Runtime coverage analysis

Covered functions
1306
Functions that are reachable but not covered
331
Reachable functions
1434
Percentage of reachable functions covered
76.92%
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 23
libxml2/dict.c 13
libxml2/xmlstring.c 23
libxml2/parser.c 118
libxml2/threads.c 14
libxml2/error.c 12
libxml2/globals.c 24
libxml2/xmlmemory.c 1
libxml2/encoding.c 14
libxml2/xmlIO.c 30
libxml2/xpath.c 192
libxml2/SAX2.c 37
libxml2/tree.c 109
libxml2/valid.c 56
libxml2/entities.c 21
libxml2/parserInternals.c 26
libxml2/buf.c 24
libxml2/list.c 8
libxml2/uri.c 34
libxml2/chvalid.c 1
libxml2/catalog.c 11
libxml2/HTMLparser.c 5
libxslt/libxslt/xslt.c 35
libxslt/libxslt/xsltutils.c 20
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

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 4163 70.9%
gold [1:9] 202 3.44%
yellow [10:29] 66 1.12%
greenyellow [30:49] 29 0.49%
lawngreen 50+ 1405 23.9%
All colors 5865 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
54218 74623 14 :

['xmlAddChild', 'xmlStrlen', 'xmlParserEntityCheck', 'xmlDocCopyNode', 'xmlFatalErrMsgStr', 'xmlParseBalancedChunkMemoryInternal', 'xmlDictLookup', 'xmlParseExternalEntityPrivate', 'xmlSetTreeDoc', 'xmlErrMsgStr', 'xmlFatalErr', 'xmlAddChildList', 'xmlHaltParser', 'xmlFreeNodeList']

54218 74623 xmlParseReference call site: 02560 /src/libxml2/parser.c:7092
8440 8816 5 :

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

8440 8840 xmlCompileStepPattern call site: 02954 /src/libxml2/pattern.c:1053
5933 5933 1 :

['xmlXPtrEvalFullXPtr']

5933 5933 xmlXPtrEvalXPointer call site: 04888 /src/libxml2/xpointer.c:1263
5708 7629 3 :

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

5708 18869 xmlSAX2StartElementNs call site: 00555 /src/libxml2/SAX2.c:2389
5339 5339 2 :

['xmlXPathModValues', 'xmlXPathDivValues']

5339 5339 xmlXPathCompOpEval call site: 03328 /src/libxml2/xpath.c:13030
4802 4802 2 :

['xmlNodeAddContent', 'xmlFreeNode']

4802 4802 xmlAddChild call site: 00409 /src/libxml2/tree.c:3482
3980 6256 3 :

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

3980 6256 xmlAddChild call site: 00421 /src/libxml2/tree.c:3489
3800 3809 2 :

['xmlStrdup', '__xmlRegisterNodeDefaultValue']

16324 42301 xmlSAX2StartElementNs call site: 00223 /src/libxml2/SAX2.c:2270
3800 3809 2 :

['xmlStrdup', '__xmlRegisterNodeDefaultValue']

5912 20693 xmlSAX2AttributeNs call site: 00563 /src/libxml2/SAX2.c:2010
2717 2717 1 :

['xmlStringGetNodeList']

2717 2717 xmlNewDocNode call site: 00501 /src/libxml2/tree.c:2362
2717 2717 1 :

['xmlStringGetNodeList']

2717 2717 xmlNewDocNodeEatName call site: 00236 /src/libxml2/tree.c:2395
2686 2686 1 :

['xmlAddNextSibling']

2686 2692 xmlStringLenGetNodeList call site: 00656 /src/libxml2/tree.c:1475

Runtime coverage analysis

Covered functions
646
Functions that are reachable but not covered
607
Reachable functions
1180
Percentage of reachable functions covered
48.56%
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 118
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 17
libxml2/xpath.c 196
libxml2/SAX2.c 37
libxml2/xmlstring.c 22
libxml2/tree.c 101
libxml2/valid.c 48
libxml2/entities.c 19
libxml2/parserInternals.c 26
libxml2/buf.c 21
libxml2/list.c 8
libxml2/uri.c 34
libxml2/chvalid.c 1
libxml2/catalog.c 11
libxml2/HTMLparser.c 2
libxslt/libxslt/transform.c 48
libxslt/libxslt/extensions.c 15
libxslt/libxslt/xsltutils.c 10
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

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/xslt.c 2 ['int *', 'char ***'] 31 0 18 3 2 1196 0 13773 1978
xmlShell /src/libxml2/debugXML.c 4 ['struct._xmlDoc *', 'char *', 'func_type *', 'struct._IO_FILE *'] 92 0 2131 294 84 1098 0 15511 1611
xmlDefaultExternalEntityLoader /src/libxml2/xmlIO.c 3 ['char *', 'char *', 'struct._xmlParserCtxt *'] 83 0 142 22 9 662 2 9035 411
xmlDOMWrapAdoptNode /src/libxml2/tree.c 6 ['struct._xmlDOMWrapCtxt *', 'struct._xmlDoc *', 'struct._xmlNode *', 'struct._xmlDoc *', 'struct._xmlNode *', 'int '] 53 0 766 145 49 232 0 2444 348
xmlParseSGMLCatalog /src/libxml2/catalog.c 4 ['struct._xmlCatalog *', 'char *', 'char *', 'int '] 86 0 1110 234 79 230 6 2681 256
htmlParseContent /src/libxml2/HTMLparser.c 1 ['struct._xmlParserCtxt *'] 86 0 959 159 60 299 2 3412 148
xmlValidateNMToken /src/libxml2/tree.c 2 ['char *', 'int '] 52 0 1183 272 110 207 0 2061 110

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

Functions statically reachable by fuzzers
78.2%
1754/2242
Cyclomatic complexity statically reachable by fuzzers
88.5%
24292 / 27449

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

Runtime coverage analysis

This section shows analysis of runtime coverage data.

For futher technical details on how this section is generated, please see the Glossary .

Complex functions with low coverage

Func name Function total lines Lines covered at runtime percentage covered Reached by fuzzers
xmlBufResize 94 51 54.25% ['xslt', 'xpath']
xmlGetCharEncodingName 53 20 37.73% ['xslt', 'xpath']
xmlGetCharEncodingHandler 108 42 38.88% ['xslt', 'xpath']
xmlEncodeEntitiesInternal 149 69 46.30% ['xslt', 'xpath']
xmlReportError 172 84 48.83% ['xslt', 'xpath']
areBlanks 32 5 15.62% ['xslt', 'xpath']
xmlParseConditionalSections 109 53 48.62% ['xslt', 'xpath']
xmlCtxtUseOptionsInternal 116 55 47.41% ['xslt', 'xpath']
xmlNodeListGetString 55 27 49.09% ['xslt', 'xpath']
xmlNewDocProp 33 17 51.51% ['xslt', 'xpath']
xmlSetTreeDoc 32 17 53.12% ['xslt', 'xpath']
xmlAddPrevSibling 44 24 54.54% ['xslt', 'xpath']
xmlStaticCopyNodeList 40 20 50.0% ['xslt', 'xpath']
xmlNodeSetContent 52 23 44.23% ['xslt', 'xpath']
xmlNodeAddContentLen 55 24 43.63% ['xslt', 'xpath']
xmlBufferResize 88 43 48.86% ['xslt', 'xpath']
xmlFreeAttribute 32 17 53.12% ['xslt', 'xpath']
__xmlIOErr 164 8 4.878% ['xslt', 'xpath']
xsltLoadDocument 39 15 38.46% ['xslt', 'xpath']
xsltSystemPropertyFunction 74 39 52.70% ['xslt', 'xpath']
xsltSortComp 76 38 50.0% ['xslt']
xsltDocumentElem 396 34 8.585% ['xslt']
xsltCallTemplate 55 23 41.81% ['xslt', 'xpath']
xsltParseStylesheetDecimalFormat 97 36 37.11% ['xslt']
xsltGatherNamespaces 58 7 12.06% ['xslt']
xsltMessage 34 13 38.23% ['xslt', 'xpath']
xmlStringLenGetNodeList 171 67 39.18% ['xslt', 'xpath']
xmlXPtrEvalChildSeq 31 16 51.61% ['xslt', 'xpath']
xsltFormatNumberFunction 71 38 53.52% ['xslt', 'xpath']
xsltFormatNumberConversion 329 140 42.55% ['xslt', 'xpath']
xsltFormatNumberPreSuffix 31 17 54.83% ['xslt', 'xpath']

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

Directories in report

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