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

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
21 21 4 :

['ssh_threads_finalize', 'ssh_dh_finalize', 'ssh_crypto_finalize', 'ssh_socket_cleanup']

21 33 _ssh_finalize call site: 00405 /src/libssh/src/init.c:165
10 10 1 :

['ssh_pki_key_ecdsa_name']

10 138 pki_import_pubkey_buffer call site: 00307 /src/libssh/src/pki.c:1466
10 10 1 :

['ssh_dh_finalize']

10 10 ssh_dh_init call site: 00050 /src/libssh/src/dh.c:260
7 42 3 :

['__errno_location', '_ssh_log', 'ssh_strerror']

7 42 ssh_known_hosts_read_entries call site: 00064 /src/libssh/src/knownhosts.c:236
6 6 1 :

['buffer_shift']

6 19 ssh_buffer_add_data call site: 00106 /src/libssh/src/buffer.c:318
6 6 1 :

['buffer_shift']

6 19 ssh_buffer_allocate_size call site: 00092 /src/libssh/src/buffer.c:347
6 6 2 :

['EC_KEY_get0_private_key', 'BN_cmp']

6 6 pki_key_compare call site: 00386 /src/libssh/src/pki_crypto.c:1025
4 39 3 :

['OpenSSL_version_num', '_ssh_log', 'OpenSSL_version']

4 39 ssh_crypto_init call site: 00017 /src/libssh/src/libcrypto.c:1349
4 39 3 :

['ERR_get_error', '_ssh_log', 'ERR_error_string']

4 39 pki_pubkey_build_ed25519 call site: 00325 /src/libssh/src/pki_crypto.c:474
4 4 1 :

['ssh_key_is_private']

8 92 ssh_key_cmp call site: 00365 /src/libssh/src/pki.c:667
4 4 2 :

['RSA_free', 'EVP_PKEY_free']

4 4 pki_pubkey_build_rsa call site: 00268 /src/libssh/src/pki_crypto.c:1491
2 12 3 :

['memcmp', 'ssh_buffer_get_len', 'ssh_buffer_get']

2 12 ssh_key_cmp call site: 00371 /src/libssh/src/pki.c:683

Fuzzer calltree

0 LLVMFuzzerTestOneInput [function] [call site] 00000
1 memchr [call site] 00001
1 getpid [call site] 00002
1 snprintf [call site] 00003
1 fopen [call site] 00004
1 fwrite [call site] 00005
1 fclose [call site] 00006
1 ssh_init [function] [call site] 00007
2 _ssh_init [function] [call site] 00008
3 ssh_mutex_lock [function] [call site] 00009
4 exit [call site] 00010
4 pthread_mutex_lock [call site] 00011
4 exit [call site] 00012
3 ssh_threads_init [function] [call site] 00013
4 ssh_threads_get_default [function] [call site] 00014
4 crypto_thread_init [function] [call site] 00015
3 ssh_crypto_init [function] [call site] 00016
4 OpenSSL_version_num [call site] 00017
4 OpenSSL_version_num [call site] 00018
4 OpenSSL_version [call site] 00019
4 _ssh_log [function] [call site] 00020
5 ssh_get_log_level [function] [call site] 00021
5 ssh_vlog [function] [call site] 00022
6 vsnprintf [call site] 00023
6 ssh_log_function [function] [call site] 00024
7 ssh_get_log_callback [function] [call site] 00025
7 ssh_log_custom [function] [call site] 00026
8 snprintf [call site] 00027
8 ssh_get_log_userdata [function] [call site] 00028
7 ssh_log_stderr [function] [call site] 00029
8 current_timestring [function] [call site] 00030
9 gettimeofday [call site] 00031
9 localtime_r [call site] 00032
9 strftime [call site] 00033
9 snprintf [call site] 00034
9 strftime [call site] 00035
9 snprintf [call site] 00036
8 fprintf [call site] 00037
8 fprintf [call site] 00038
8 fprintf [call site] 00039
3 ssh_dh_init [function] [call site] 00040
4 BN_new [call site] 00041
4 BN_set_word [call site] 00042
4 BN_new [call site] 00043
4 BN_bin2bn [call site] 00044
4 BN_new [call site] 00045
4 BN_bin2bn [call site] 00046
4 BN_new [call site] 00047
4 BN_bin2bn [call site] 00048
4 BN_new [call site] 00049
4 BN_bin2bn [call site] 00050
4 ssh_dh_finalize [function] [call site] 00051
5 BN_clear_free [call site] 00052
5 BN_clear_free [call site] 00053
5 BN_clear_free [call site] 00054
5 BN_clear_free [call site] 00055
5 BN_clear_free [call site] 00056
3 ssh_socket_init [function] [call site] 00057
4 ssh_poll_init [function] [call site] 00058
3 ssh_mutex_unlock [function] [call site] 00059
4 exit [call site] 00060
4 pthread_mutex_unlock [call site] 00061
4 exit [call site] 00062
1 ssh_known_hosts_read_entries [function] [call site] 00063
2 fopen [call site] 00064
2 __errno_location [call site] 00065
2 ssh_strerror [function] [call site] 00066
3 __xpg_strerror_r [call site] 00067
2 ssh_list_new [function] [call site] 00069
2 fclose [call site] 00070
2 known_hosts_read_line [function] [call site] 00071
3 fgets [call site] 00072
3 strlen [call site] 00073
3 feof [call site] 00074
3 __errno_location [call site] 00075
2 strcspn [call site] 00076
2 __ctype_b_loc [call site] 00077
2 ssh_known_hosts_parse_line [function] [call site] 00078
3 strdup [call site] 00079
3 strtok_r [call site] 00080
3 calloc [call site] 00081
3 match_hashed_hostname [function] [call site] 00082
4 strncmp [call site] 00083
4 strdup [call site] 00084
4 strchr [call site] 00085
4 base64_to_bin [function] [call site] 00086
5 strdup [call site] 00087
5 get_equals [function] [call site] 00088
6 strchr [call site] 00089
5 ssh_buffer_new [function] [call site] 00090
6 calloc [call site] 00091
6 ssh_buffer_allocate_size [function] [call site] 00092
7 buffer_shift [function] [call site] 00093
8 explicit_bzero [call site] 00094
7 realloc_buffer [function] [call site] 00095
8 explicit_bzero [call site] 00096
8 realloc [call site] 00097
5 ssh_buffer_set_secure [function] [call site] 00098
5 strlen [call site] 00099
5 _base64_to_bin [function] [call site] 00100
6 to_block4 [function] [call site] 00101
7 strchr [call site] 00102
7 strchr [call site] 00103
7 strchr [call site] 00104
7 strchr [call site] 00105
5 ssh_buffer_add_data [function] [call site] 00106
6 buffer_shift [function] [call site] 00107
6 realloc_buffer [function] [call site] 00108
5 _base64_to_bin [function] [call site] 00109
5 ssh_buffer_add_data [function] [call site] 00110
5 _base64_to_bin [function] [call site] 00111
5 ssh_buffer_add_data [function] [call site] 00112
5 _base64_to_bin [function] [call site] 00113
5 ssh_buffer_add_data [function] [call site] 00114
5 ssh_buffer_free [function] [call site] 00115
6 explicit_bzero [call site] 00116
6 explicit_bzero [call site] 00117
4 base64_to_bin [function] [call site] 00118
4 ssh_buffer_get [function] [call site] 00119
4 ssh_buffer_get_len [function] [call site] 00120
4 hash_hostname [function] [call site] 00121
5 hmac_init [function] [call site] 00122
6 EVP_MD_CTX_new [call site] 00123
6 EVP_PKEY_new_mac_key [call site] 00124
6 EVP_sha1 [call site] 00125
6 EVP_DigestSignInit [call site] 00126
6 EVP_sha256 [call site] 00127
6 EVP_DigestSignInit [call site] 00128
6 EVP_sha512 [call site] 00129
6 EVP_DigestSignInit [call site] 00130
6 EVP_md5 [call site] 00131
6 EVP_DigestSignInit [call site] 00132
6 EVP_PKEY_free [call site] 00133
6 EVP_MD_CTX_free [call site] 00134
5 strlen [call site] 00135
5 hmac_update [function] [call site] 00136
6 EVP_DigestUpdate [call site] 00137
5 hmac_final [function] [call site] 00138
6 EVP_DigestSignFinal [call site] 00139
6 EVP_MD_CTX_free [call site] 00140
4 ssh_buffer_get_len [function] [call site] 00141
4 ssh_buffer_get [function] [call site] 00142
4 memcmp [call site] 00143
4 ssh_buffer_free [function] [call site] 00144
4 ssh_buffer_free [function] [call site] 00145
3 strtok_r [call site] 00146
3 ssh_hostport [function] [call site] 00147
4 strlen [call site] 00148
4 snprintf [call site] 00149
3 strlen [call site] 00150
3 match_hostname [function] [call site] 00151
4 match_pattern_list [function] [call site] 00152
5 __ctype_b_loc [call site] 00153
5 tolower [call site] 00154
5 match_pattern [function] [call site] 00155
6 match_pattern [function] [call site] 00156
7 match_pattern [function] [call site] 00157
3 strlen [call site] 00158
3 match_hostname [function] [call site] 00159
3 strtok_r [call site] 00160
3 strdup [call site] 00161
3 strdup [call site] 00162
3 strtok_r [call site] 00163
3 strdup [call site] 00164
3 strtok_r [call site] 00165
3 ssh_key_type_from_name [function] [call site] 00166
4 strcmp [call site] 00167
4 strcmp [call site] 00168
4 strcmp [call site] 00169
4 strcmp [call site] 00170
4 strcmp [call site] 00171
4 strcmp [call site] 00172
4 strcmp [call site] 00173
4 strcmp [call site] 00174
4 strcmp [call site] 00175
4 strcmp [call site] 00176
4 strcmp [call site] 00177
4 strcmp [call site] 00178
4 strcmp [call site] 00179
4 strcmp [call site] 00180
4 strcmp [call site] 00181
4 strcmp [call site] 00182
4 strcmp [call site] 00183
3 strtok_r [call site] 00185
3 ssh_pki_import_pubkey_base64 [function] [call site] 00186
4 base64_to_bin [function] [call site] 00187
4 ssh_buffer_get_ssh_string [function] [call site] 00188
5 ssh_buffer_get_u32 [function] [call site] 00189
6 ssh_buffer_get_data [function] [call site] 00190
7 ssh_buffer_validate_length [function] [call site] 00191
5 ntohl [call site] 00192
5 ssh_buffer_validate_length [function] [call site] 00193
5 ssh_string_new [function] [call site] 00194
6 __errno_location [call site] 00195
6 htonl [call site] 00196
5 ssh_string_data [function] [call site] 00197
5 ssh_buffer_get_data [function] [call site] 00198
4 ssh_buffer_free [function] [call site] 00199
4 ssh_string_free [function] [call site] 00200
4 pki_import_cert_buffer [function] [call site] 00201
5 ssh_buffer_new [function] [call site] 00202
5 ssh_key_type_to_char [function] [call site] 00203
5 ssh_string_from_char [function] [call site] 00204
6 __errno_location [call site] 00205
6 strlen [call site] 00206
6 ssh_string_new [function] [call site] 00207
5 ssh_buffer_add_ssh_string [function] [call site] 00208
6 ssh_string_len [function] [call site] 00209
7 ntohl [call site] 00210
6 ssh_buffer_add_data [function] [call site] 00211
5 ssh_string_free [function] [call site] 00212
5 ssh_buffer_add_buffer [function] [call site] 00213
6 ssh_buffer_get [function] [call site] 00214
6 ssh_buffer_get_len [function] [call site] 00215
6 ssh_buffer_add_data [function] [call site] 00216
5 ssh_buffer_get_ssh_string [function] [call site] 00217
5 ssh_string_free [function] [call site] 00218
5 pki_import_pubkey_buffer [function] [call site] 00219
6 ssh_key_new [function] [call site] 00220
6 ssh_key_type_to_char [function] [call site] 00221
6 _ssh_buffer_unpack [function] [call site] 00222
7 ssh_buffer_unpack_va [function] [call site] 00223
8 ssh_buffer_get_len [function] [call site] 00224
8 ssh_buffer_get_u8 [function] [call site] 00225
9 ssh_buffer_get_data [function] [call site] 00226
8 ssh_buffer_get_data [function] [call site] 00227
8 ntohs [call site] 00228
8 ssh_buffer_get_u32 [function] [call site] 00229
8 ntohl [call site] 00230
8 ssh_buffer_get_u64 [function] [call site] 00231
9 ssh_buffer_get_data [function] [call site] 00232
8 ntohl [call site] 00233
8 ssh_buffer_get_ssh_string [function] [call site] 00234
8 ssh_make_string_bn [function] [call site] 00235
9 ssh_string_len [function] [call site] 00236
9 BN_new [call site] 00237
9 BN_bin2bn [call site] 00238
8 ssh_string_burn [function] [call site] 00239
9 ssh_string_len [function] [call site] 00240
9 explicit_bzero [call site] 00241
8 ssh_string_free [function] [call site] 00242
8 ssh_buffer_get_ssh_string [function] [call site] 00243
8 ssh_buffer_get_u32 [function] [call site] 00244
8 ntohl [call site] 00245
8 ssh_buffer_validate_length [function] [call site] 00246
8 ssh_buffer_get_data [function] [call site] 00247
8 ssh_buffer_validate_length [function] [call site] 00248
8 ssh_buffer_get_data [function] [call site] 00249
8 abort [call site] 00251
8 explicit_bzero [call site] 00252
8 explicit_bzero [call site] 00253
8 explicit_bzero [call site] 00254
8 explicit_bzero [call site] 00255
8 BN_clear_free [call site] 00256
8 ssh_string_burn [function] [call site] 00257
8 strlen [call site] 00258
8 explicit_bzero [call site] 00259
8 explicit_bzero [call site] 00260
6 pki_pubkey_build_rsa [function] [call site] 00262
7 RSA_new [call site] 00263
7 ssh_make_string_bn [function] [call site] 00264
7 ssh_make_string_bn [function] [call site] 00265
7 RSA_set0_key [call site] 00266
7 EVP_PKEY_new [call site] 00267
7 EVP_PKEY_assign [call site] 00268
7 EVP_PKEY_free [call site] 00269
7 RSA_free [call site] 00270
6 ssh_string_burn [function] [call site] 00271
6 ssh_string_free [function] [call site] 00272
6 ssh_string_burn [function] [call site] 00273
6 ssh_string_free [function] [call site] 00274
6 _ssh_buffer_unpack [function] [call site] 00276
6 ssh_string_get_char [function] [call site] 00278
7 ssh_string_len [function] [call site] 00279
6 pki_key_ecdsa_nid_from_name [function] [call site] 00280
7 strcmp [call site] 00281
7 strcmp [call site] 00282
7 strcmp [call site] 00283
6 ssh_string_free [function] [call site] 00284
6 ssh_string_burn [function] [call site] 00285
6 ssh_string_free [function] [call site] 00286
6 pki_pubkey_build_ecdsa [function] [call site] 00287
7 pki_key_ecdsa_nid_to_name [function] [call site] 00288
7 EC_KEY_new_by_curve_name [call site] 00289
7 EC_KEY_get0_group [call site] 00290
7 EC_POINT_new [call site] 00291
7 EC_KEY_free [call site] 00292
7 ssh_string_data [function] [call site] 00293
7 ssh_string_len [function] [call site] 00294
7 EC_POINT_oct2point [call site] 00295
7 EC_KEY_free [call site] 00296
7 EC_POINT_free [call site] 00297
7 EC_KEY_set_public_key [call site] 00298
7 EC_POINT_free [call site] 00299
7 EC_KEY_free [call site] 00300
7 EVP_PKEY_new [call site] 00301
7 EC_KEY_free [call site] 00302
7 EVP_PKEY_assign [call site] 00303
7 EC_KEY_free [call site] 00304
6 ssh_string_burn [function] [call site] 00305
6 ssh_string_free [function] [call site] 00306
6 ssh_pki_key_ecdsa_name [function] [call site] 00308
7 pki_key_ecdsa_nid_to_name [function] [call site] 00309
6 ssh_buffer_get_ssh_string [function] [call site] 00310
6 ssh_key_type_to_char [function] [call site] 00312
6 ssh_buffer_get_ssh_string [function] [call site] 00313
6 ssh_string_len [function] [call site] 00314
6 ssh_string_burn [function] [call site] 00316
6 ssh_string_free [function] [call site] 00317
6 pki_pubkey_build_ed25519 [function] [call site] 00318
7 ssh_string_len [function] [call site] 00319
7 FIPS_mode [call site] 00321
7 ssh_string_data [function] [call site] 00323
7 ssh_string_data [function] [call site] 00324
7 EVP_PKEY_new_raw_public_key [call site] 00325
7 ERR_get_error [call site] 00326
7 ERR_error_string [call site] 00327
6 ssh_string_burn [function] [call site] 00329
6 ssh_string_free [function] [call site] 00330
6 ssh_buffer_get_ssh_string [function] [call site] 00332
6 ssh_key_free [function] [call site] 00335
7 ssh_key_clean [function] [call site] 00336
8 pki_key_clean [function] [call site] 00337
9 EVP_PKEY_free [call site] 00338
8 ssh_buffer_free [function] [call site] 00339
8 ssh_string_burn [function] [call site] 00340
8 ssh_string_free [function] [call site] 00341
5 pki_import_pubkey_buffer [function] [call site] 00342
5 pki_import_pubkey_buffer [function] [call site] 00343
5 pki_import_pubkey_buffer [function] [call site] 00344
5 pki_import_pubkey_buffer [function] [call site] 00345
5 pki_import_pubkey_buffer [function] [call site] 00346
5 pki_import_pubkey_buffer [function] [call site] 00347
5 ssh_key_new [function] [call site] 00348
5 ssh_key_free [function] [call site] 00349
5 ssh_buffer_free [function] [call site] 00350
4 pki_import_pubkey_buffer [function] [call site] 00351
4 ssh_buffer_free [function] [call site] 00352
3 ssh_key_type_to_char [function] [call site] 00353
3 strtok_r [call site] 00355
3 strstr [call site] 00356
3 strdup [call site] 00357
3 ssh_knownhosts_entry_free [function] [call site] 00358
4 ssh_key_free [function] [call site] 00359
2 ssh_list_get_iterator [function] [call site] 00360
2 ssh_known_hosts_entries_compare [function] [call site] 00361
3 strcmp [call site] 00362
3 ssh_key_cmp [function] [call site] 00363
4 ssh_key_type_plain [function] [call site] 00364
4 ssh_key_is_private [function] [call site] 00366
4 ssh_key_is_private [function] [call site] 00367
4 ssh_string_get_char [function] [call site] 00368
4 ssh_string_get_char [function] [call site] 00369
4 ssh_string_len [function] [call site] 00370
4 strncmp [call site] 00371
4 ssh_buffer_get_len [function] [call site] 00372
4 ssh_buffer_get [function] [call site] 00373
4 ssh_buffer_get [function] [call site] 00374
4 ssh_buffer_get_len [function] [call site] 00375
4 memcmp [call site] 00376
4 pki_key_compare [function] [call site] 00377
5 ssh_key_type_plain [function] [call site] 00378
5 EVP_PKEY_get0_EC_KEY [call site] 00379
5 EVP_PKEY_get0_EC_KEY [call site] 00380
5 EC_KEY_get0_public_key [call site] 00381
5 EC_KEY_get0_public_key [call site] 00382
5 EC_KEY_get0_group [call site] 00383
5 EC_KEY_get0_group [call site] 00384
5 EC_GROUP_cmp [call site] 00385
5 EC_POINT_cmp [call site] 00386
5 EC_KEY_get0_private_key [call site] 00387
5 BN_cmp [call site] 00388
5 FIPS_mode [call site] 00389
5 memcmp [call site] 00390
5 EVP_PKEY_cmp [call site] 00391
2 ssh_knownhosts_entry_free [function] [call site] 00392
2 ssh_list_append [function] [call site] 00393
3 ssh_iterator_new [function] [call site] 00394
2 known_hosts_read_line [function] [call site] 00395
2 fclose [call site] 00396
2 fclose [call site] 00397
1 ssh_list_get_iterator [function] [call site] 00398
1 ssh_knownhosts_entry_free [function] [call site] 00399
1 ssh_list_remove [function] [call site] 00400
1 ssh_list_get_iterator [function] [call site] 00401
1 ssh_list_free [function] [call site] 00402
1 ssh_finalize [function] [call site] 00403
2 _ssh_finalize [function] [call site] 00404
3 ssh_mutex_lock [function] [call site] 00405
3 ssh_mutex_unlock [function] [call site] 00406
3 ssh_mutex_unlock [function] [call site] 00407
3 ssh_dh_finalize [function] [call site] 00408
3 ssh_crypto_finalize [function] [call site] 00409
3 ssh_socket_cleanup [function] [call site] 00410
4 ssh_poll_cleanup [function] [call site] 00411
3 ssh_threads_finalize [function] [call site] 00412
4 crypto_thread_finalize [function] [call site] 00413
3 ssh_mutex_unlock [function] [call site] 00414
1 unlink [call site] 00415