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

Fuzzer details

Fuzzer: wolfmqtt-fuzzer

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 4013 94.9%
gold [1:9] 18 0.42%
yellow [10:29] 17 0.40%
greenyellow [30:49] 6 0.14%
lawngreen 50+ 172 4.07%
All colors 4226 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
9306 9313 3 :

['MqttClient_Auth', 'MqttProps_Add', 'MqttClient_PropsFree']

9306 18600 MqttClient_Connect call site: 03798 /src/wolfmqtt/src/mqtt_client.c:1501
8883 8883 1 :

['wolfSSL_write']

8883 8883 MqttSocket_WriteDo call site: 03800 /src/wolfmqtt/src/mqtt_socket.c:127
8868 8868 1 :

['wolfSSL_read']

8868 8868 MqttSocket_ReadDo call site: 04024 /src/wolfmqtt/src/mqtt_socket.c:233
308 308 1 :

['wolfSSL_free']

411 462 MqttSocket_Disconnect call site: 03760 /src/wolfmqtt/src/mqtt_socket.c:515
103 103 1 :

['wolfSSL_CTX_free']

103 154 MqttSocket_Disconnect call site: 03761 /src/wolfmqtt/src/mqtt_socket.c:519
42 42 6 :

['wc_UnLockRwLock', 'wc_LockMutex', 'wc_UnLockMutex', 'wc_FreeMutex', 'EvictSessionFromCache', 'wolfCrypt_Cleanup']

42 42 wolfSSL_Cleanup call site: 00052 /src/wolfssl/src/ssl.c:14369
30 35 2 :

['MqttEncode_Vbi', 'MqttEncode_Props']

30 62 MqttEncode_Connect call site: 03791 /src/wolfmqtt/src/mqtt_packet.c:772
30 35 2 :

['MqttEncode_Vbi', 'MqttEncode_Props']

30 42 MqttEncode_Subscribe call site: 04161 /src/wolfmqtt/src/mqtt_packet.c:1253
30 35 2 :

['MqttEncode_Vbi', 'MqttEncode_Props']

30 42 MqttEncode_Unsubscribe call site: 04181 /src/wolfmqtt/src/mqtt_packet.c:1396
30 35 2 :

['MqttEncode_Vbi', 'MqttEncode_Props']

30 35 MqttEncode_Publish call site: 04203 /src/wolfmqtt/src/mqtt_packet.c:920
30 35 2 :

['MqttEncode_Vbi', 'MqttEncode_Props']

30 35 MqttEncode_PublishResp call site: 04117 /src/wolfmqtt/src/mqtt_packet.c:1104
7 355 2 :

['MqttSocket_Disconnect', 'wolfSSL_get_error']

7 355 MqttSocket_Connect call site: 00530 /src/wolfmqtt/src/mqtt_socket.c:473

Runtime coverage analysis

Covered functions
100
Functions that are reachable but not covered
1008
Reachable functions
1139
Percentage of reachable functions covered
11.5%
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
/src/wolfmqtt-fuzzers/fuzzer.cpp 32
/src/fuzzing-headers/include/fuzzing/datasource/datasource.hpp 10
/src/wolfmqtt/src/mqtt_socket.c 9
/src/wolfmqtt/src/mqtt_client.c 20
/src/wolfssl/src/ssl.c 46
/src/wolfssl/wolfcrypt/src/wc_port.c 13
/src/wolfssl/./wolfcrypt/src/misc.c 36
/src/wolfssl/wolfcrypt/src/memory.c 2
/src/wolfssl/src/tls.c 111
/src/wolfssl/src/internal.c 176
/src/wolfssl/src/wolfio.c 6
/src/wolfssl/wolfcrypt/src/md5.c 10
/src/wolfssl/wolfcrypt/src/sha.c 11
/src/wolfssl/wolfcrypt/src/random.c 17
/src/wolfssl/wolfcrypt/src/sha256.c 19
/src/wolfssl/wolfcrypt/src/asn.c 99
/src/wolfssl/wolfcrypt/src/dh.c 18
/src/wolfssl/wolfcrypt/src/sp_int.c 98
/src/wolfssl/wolfcrypt/src/ecc.c 50
/src/wolfssl/wolfcrypt/src/sha512.c 35
/src/wolfssl/wolfcrypt/src/aes.c 29
/src/wolfssl/wolfcrypt/src/rsa.c 34
/src/wolfssl/wolfcrypt/src/hash.c 20
/src/wolfssl/src/tls13.c 69
/src/wolfssl/wolfcrypt/src/chacha.c 5
/src/wolfssl/wolfcrypt/src/poly1305.c 11
/src/wolfssl/wolfcrypt/src/wolfmath.c 3
/src/wolfssl/src/keys.c 11
/src/wolfssl/wolfcrypt/src/hmac.c 10
/src/wolfssl/wolfcrypt/src/sha3.c 26
/src/wolfssl/wolfcrypt/src/kdf.c 5
/src/wolfmqtt/src/mqtt_packet.c 32

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
wolfSSL_CertManagerLoadCA /src/wolfssl/src/ssl.c 3 ['struct.WOLFSSL_CERT_MANAGER.140 *', 'char *', 'char *'] 14 0 76 12 4 479 0 4177 418
wc_CreateEncryptedPKCS8Key /src/wolfssl/wolfcrypt/src/asn.c 14 ['char *', 'int ', 'char *', 'int *', 'char *', 'int ', 'int ', 'int ', 'int ', 'char *', 'int ', 'int ', 'struct.WC_RNG *', 'char *'] 9 0 68 3 2 213 0 1466 210
wolfSSL_ERR_error_string_n /src/wolfssl/src/ssl.c 3 ['size_t ', 'char *', 'size_t '] 3 0 61 11 4 5 0 199 197
wolfSSL_CTX_check_private_key /src/wolfssl/src/ssl.c 1 ['struct.WOLFSSL_CTX.141 *'] 12 0 53 6 3 413 0 3620 181
wc_Asn1_PrintAll /src/wolfssl/wolfcrypt/src/asn.c 4 ['struct.Asn1 *', 'struct.Asn1PrintOptions *', 'char *', 'int '] 4 0 191 33 13 39 0 391 136
wolfSSL_SetTmpDH_file /src/wolfssl/src/ssl.c 3 ['struct.WOLFSSL.126 *', 'char *', 'int '] 11 0 42 6 3 150 0 1500 82
wc_EccKeyToPKCS8 /src/wolfssl/wolfcrypt/src/asn.c 3 ['struct.ecc_key *', 'char *', 'int *'] 7 0 24 3 2 54 0 599 59
wolfSSL_SetServerID /src/wolfssl/src/ssl.c 4 ['struct.WOLFSSL.126 *', 'char *', 'int ', 'int '] 6 0 151 32 11 37 0 186 46
wolfSSL_set_groups /src/wolfssl/src/tls13.c 3 ['struct.WOLFSSL.208 *', 'int *', 'int '] 4 0 133 19 8 25 0 139 43
Base64_Encode_NoNl /src/wolfssl/wolfcrypt/src/coding.c 4 ['char *', 'int ', 'char *', 'int *'] 1 0 28 3 2 2 0 43 43

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

Functions statically reachable by fuzzers
71.0%
1209 / 1702
Cyclomatic complexity statically reachable by fuzzers
84.0%
11443 / 13671

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/wolfssl/wolfcrypt/src/error.c [] []
/src/wolfssl/wolfcrypt/src/asn.c ['wolfmqtt-fuzzer'] []
/src/wolfssl/wolfcrypt/src/coding.c [] []
/src/wolfssl/wolfcrypt/src/hmac.c ['wolfmqtt-fuzzer'] []
/src/wolfssl/wolfcrypt/src/hash.c ['wolfmqtt-fuzzer'] []
/src/wolfssl/wolfcrypt/src/memory.c ['wolfmqtt-fuzzer'] []
/src/wolfssl/wolfcrypt/src/poly1305.c ['wolfmqtt-fuzzer'] []
/src/wolfssl/src/internal.c ['wolfmqtt-fuzzer'] []
/src/wolfssl/wolfcrypt/src/dh.c ['wolfmqtt-fuzzer'] []
/src/wolfssl/wolfcrypt/src/ecc.c ['wolfmqtt-fuzzer'] []
/src/wolfssl/./wolfcrypt/src/misc.c ['wolfmqtt-fuzzer'] []
/usr/local/bin/../include/c++/v1/exception [] []
/src/wolfmqtt-fuzzers/fuzzer.cpp ['wolfmqtt-fuzzer'] ['wolfmqtt-fuzzer']
/src/wolfssl/wolfcrypt/src/chacha.c ['wolfmqtt-fuzzer'] []
/src/wolfmqtt/src/mqtt_client.c ['wolfmqtt-fuzzer'] ['wolfmqtt-fuzzer']
/src/wolfssl/wolfcrypt/src/sha256.c ['wolfmqtt-fuzzer'] []
/src/wolfssl/./src/x509.c [] []
/src/wolfssl/src/wolfio.c ['wolfmqtt-fuzzer'] []
/src/fuzzing-headers/include/fuzzing/datasource/datasource.hpp ['wolfmqtt-fuzzer'] ['wolfmqtt-fuzzer']
/src/wolfssl/src/keys.c ['wolfmqtt-fuzzer'] []
/usr/local/bin/../include/c++/v1/stdexcept [] []
/src/wolfssl/wolfcrypt/src/sp_int.c ['wolfmqtt-fuzzer'] []
/src/wolfssl/wolfcrypt/src/sha512.c ['wolfmqtt-fuzzer'] []
/src/fuzzing-headers/include/fuzzing/exception.hpp [] []
/src/wolfssl/wolfcrypt/src/md5.c ['wolfmqtt-fuzzer'] []
/src/fuzzing-headers/include/fuzzing/memory.hpp [] []
/src/fuzzing-headers/include/fuzzing/types.hpp [] []
/src/wolfssl/wolfcrypt/src/random.c ['wolfmqtt-fuzzer'] []
/src/wolfssl/wolfcrypt/src/sha.c ['wolfmqtt-fuzzer'] []
/src/wolfmqtt/src/mqtt_socket.c ['wolfmqtt-fuzzer'] ['wolfmqtt-fuzzer']
/src/wolfssl/wolfcrypt/src/pwdbased.c [] []
/src/wolfssl/wolfcrypt/src/wc_port.c ['wolfmqtt-fuzzer'] []
/src/wolfssl/wolfcrypt/src/kdf.c ['wolfmqtt-fuzzer'] []
/src/wolfssl/wolfcrypt/src/wc_encrypt.c [] []
/src/wolfssl/wolfcrypt/src/sha3.c ['wolfmqtt-fuzzer'] []
/src/wolfssl/src/tls.c ['wolfmqtt-fuzzer'] []
/src/wolfssl/wolfcrypt/src/wolfmath.c ['wolfmqtt-fuzzer'] []
/src/wolfssl/wolfcrypt/src/aes.c ['wolfmqtt-fuzzer'] []
/src/wolfssl/src/ssl.c ['wolfmqtt-fuzzer'] ['wolfmqtt-fuzzer']
/src/wolfssl/src/tls13.c ['wolfmqtt-fuzzer'] []
/src/wolfmqtt/src/mqtt_packet.c ['wolfmqtt-fuzzer'] ['wolfmqtt-fuzzer']
/src/wolfssl/wolfcrypt/src/rsa.c ['wolfmqtt-fuzzer'] []

Directories in report

Directory
/usr/local/bin/../include/c++/v1/
/src/wolfssl/src/
/src/wolfmqtt-fuzzers/
/src/wolfssl/./wolfcrypt/src/
/src/wolfmqtt/src/
/src/fuzzing-headers/include/fuzzing/datasource/
/src/wolfssl/wolfcrypt/src/
/src/fuzzing-headers/include/fuzzing/
/src/wolfssl/./src/