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

Project functions overview

The following table shows data about each function in the project. The functions included in this table correspond to all functions that exist in the executables of the fuzzers. As such, there may be functions that are from third-party libraries.

For further technical details on the meaning of columns in the below table, please see the Glossary .

Func name Functions filename Args Function call depth Reached by Fuzzers Runtime reached by Fuzzers Combined 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

Fuzzer details

Fuzzer: ssh2_client_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 450 56.9%
gold [1:9] 8 1.01%
yellow [10:29] 10 1.26%
greenyellow [30:49] 1 0.12%
lawngreen 50+ 321 40.6%
All colors 790 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
34 666 session_free call site: 00666 ssh2_channel_free
29 743 session_free call site: 00743 SSH2_FREE
24 355 ssh2_channel_locate call site: 00355 ssh2_channel_receive_window_adjust
22 437 packet_queue_listener call site: 00437 ssh2_transport_send
21 173 ssh2_hash call site: 00173 ssh2_err
20 275 transport_fullpacket call site: 00275 transport_decrypt
20 524 packet_authagent_open call site: 00524 ssh2_transport_send
18 701 session_free call site: 00701 ssh2_channel_forward_cancel
16 490 packet_x11_open call site: 00490 ssh2_transport_send
14 122 ssh2_transport_send call site: 00122 ssh2_snprintf
14 238 ssh2_store_u32 call site: 00238 transport_decrypt
13 729 session_free call site: 00729 SSH2_FREE

Runtime coverage analysis

Covered functions
134
Functions that are reachable but not covered
94
Reachable functions
152
Percentage of reachable functions covered
38.16%
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
tests/ossfuzz/ssh2_client_fuzzer.cc 14
src/global.c 2
src/session.c 38
src/misc.c 29
src/kex.c 35
src/libgcrypt.c 9
src/wincng.c 2
src/transport.c 39
src/packet.c 43
example/scp_nonblock.c 1
src/channel.c 20
src/mac.c 1

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
hostkey_method_ssh_ed25519_initPEM /src/libssh2/src/hostkey.c 6 ['LIBSSH2_SESSION*', 'char*', 'char*', 'size_t', 'char*', 'void**'] 10 0 9 3 2 195 0 672 643
test_auth_pubkey /src/libssh2/tests/session_fixture.c 6 ['LIBSSH2_SESSION*', 'int', 'char*', 'char*', 'char*', 'char*'] 12 0 42 11 11 208 0 1055 359
libssh2_scp_recv /src/libssh2/src/scp.c 3 ['LIBSSH2_SESSION*', 'char*', 'struct stat*'] 14 0 12 2 1 133 0 919 289
kex_method_mlkem768x25519_key_exchange /src/libssh2/src/kex.c 2 ['LIBSSH2_SESSION*', 'struct key_exchange_state_low*'] 14 0 58 13 16 174 0 797 213
test_knownhost_ipv6_case /src/libssh2/tests/test_simple.c 5 ['LIBSSH2_SESSION*', 'char*', 'char*', 'int', 'int'] 6 0 21 5 4 60 1 209 165
sftp_readdir /src/libssh2/src/sftp.c 6 ['LIBSSH2_SFTP_HANDLE*', 'char*', 'size_t', 'char*', 'size_t', 'LIBSSH2_SFTP_ATTRIBUTES*'] 14 0 146 26 36 120 2 764 150
kex_method_diffie_hellman_group_exchange_sha1_key_exchange /src/libssh2/src/kex.c 2 ['LIBSSH2_SESSION*', 'struct key_exchange_state_low*'] 13 0 78 16 24 177 0 821 124
start_session_fixture /src/libssh2/tests/session_fixture.c 2 ['int*', 'int*'] 12 0 78 20 24 185 0 775 120
x11_send_receive /src/libssh2/example/x11.c 2 ['LIBSSH2_CHANNEL*', 'libssh2_socket_t'] 11 0 51 11 14 126 0 690 113
libssh2_publickey_list_fetch /src/libssh2/src/publickey.c 3 ['LIBSSH2_PUBLICKEY*', 'unsigned long*', 'libssh2_publickey_list**'] 12 0 320 52 88 111 0 726 111

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

Functions statically reachable by fuzzers
41.0%
349 / 852
Cyclomatic complexity statically reachable by fuzzers
54.0%
3016 / 5582

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 Runtime reached by Fuzzers Combined 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 driver synthesis

New fuzzers

The below fuzzers are templates and suggestions for how to target the set of optimal functions above

hostkey.c

Target file: /src/libssh2/src/hostkey.c
Target functions: hostkey_method_ssh_ed25519_initPEM
#include "ada_fuzz_header.h"

int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
  af_safe_gb_init(data, size);

  /* target hostkey_method_ssh_ed25519_initPEM */
  UNKNOWN_TYPE unknown_0;
  char *new_var1 = ada_safe_get_char_p();
  char *new_var2 = ada_safe_get_char_p();
  UNKNOWN_TYPE unknown_3;
  char *new_var4 = ada_safe_get_char_p();
  UNKNOWN_TYPE unknown_5;
  hostkey_method_ssh_ed25519_initPEM(unknown_0, new_var1, new_var2, unknown_3, new_var4, unknown_5);

  af_safe_gb_cleanup();
}

session_fixture.c

Target file: /src/libssh2/tests/session_fixture.c
Target functions: test_auth_pubkey, start_session_fixture
#include "ada_fuzz_header.h"

int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
  af_safe_gb_init(data, size);

  /* target test_auth_pubkey */
  UNKNOWN_TYPE unknown_6;
  int new_var7 = ada_safe_get_int();
  char *new_var8 = ada_safe_get_char_p();
  char *new_var9 = ada_safe_get_char_p();
  char *new_var10 = ada_safe_get_char_p();
  char *new_var11 = ada_safe_get_char_p();
  test_auth_pubkey(unknown_6, new_var7, new_var8, new_var9, new_var10, new_var11);

  /* target start_session_fixture */
  int *new_var30 = af_get_int_p();
  int *new_var31 = af_get_int_p();
  start_session_fixture(new_var30, new_var31);

  af_safe_gb_cleanup();
}

scp.c

Target file: /src/libssh2/src/scp.c
Target functions: libssh2_scp_recv
#include "ada_fuzz_header.h"

int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
  af_safe_gb_init(data, size);

  /* target libssh2_scp_recv */
  UNKNOWN_TYPE unknown_12;
  char *new_var13 = ada_safe_get_char_p();
  structstat* new_var14 = calloc(sizeof(structstat), 1);
  libssh2_scp_recv(unknown_12, new_var13, new_var14);

  af_safe_gb_cleanup();
}

kex.c

Target file: /src/libssh2/src/kex.c
Target functions: kex_method_mlkem768x25519_key_exchange, kex_method_diffie_hellman_group_exchange_sha1_key_exchange
#include "ada_fuzz_header.h"

int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
  af_safe_gb_init(data, size);

  /* target kex_method_mlkem768x25519_key_exchange */
  UNKNOWN_TYPE unknown_15;
  structkey_exchange_state_low* new_var16 = calloc(sizeof(structkey_exchange_state_low), 1);
  kex_method_mlkem768x25519_key_exchange(unknown_15, new_var16);

  /* target kex_method_diffie_hellman_group_exchange_sha1_key_exchange */
  UNKNOWN_TYPE unknown_28;
  structkey_exchange_state_low* new_var29 = calloc(sizeof(structkey_exchange_state_low), 1);
  kex_method_diffie_hellman_group_exchange_sha1_key_exchange(unknown_28, new_var29);

  af_safe_gb_cleanup();
}

test_simple.c

Target file: /src/libssh2/tests/test_simple.c
Target functions: test_knownhost_ipv6_case
#include "ada_fuzz_header.h"

int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
  af_safe_gb_init(data, size);

  /* target test_knownhost_ipv6_case */
  UNKNOWN_TYPE unknown_17;
  char *new_var18 = ada_safe_get_char_p();
  char *new_var19 = ada_safe_get_char_p();
  int new_var20 = ada_safe_get_int();
  int new_var21 = ada_safe_get_int();
  test_knownhost_ipv6_case(unknown_17, new_var18, new_var19, new_var20, new_var21);

  af_safe_gb_cleanup();
}

sftp.c

Target file: /src/libssh2/src/sftp.c
Target functions: sftp_readdir
#include "ada_fuzz_header.h"

int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
  af_safe_gb_init(data, size);

  /* target sftp_readdir */
  UNKNOWN_TYPE unknown_22;
  char *new_var23 = ada_safe_get_char_p();
  UNKNOWN_TYPE unknown_24;
  char *new_var25 = ada_safe_get_char_p();
  UNKNOWN_TYPE unknown_26;
  UNKNOWN_TYPE unknown_27;
  sftp_readdir(unknown_22, new_var23, unknown_24, new_var25, unknown_26, unknown_27);

  af_safe_gb_cleanup();
}

x11.c

Target file: /src/libssh2/example/x11.c
Target functions: x11_send_receive
#include "ada_fuzz_header.h"

int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
  af_safe_gb_init(data, size);

  /* target x11_send_receive */
  UNKNOWN_TYPE unknown_32;
  UNKNOWN_TYPE unknown_33;
  x11_send_receive(unknown_32, unknown_33);

  af_safe_gb_cleanup();
}

publickey.c

Target file: /src/libssh2/src/publickey.c
Target functions: libssh2_publickey_list_fetch
#include "ada_fuzz_header.h"

int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
  af_safe_gb_init(data, size);

  /* target libssh2_publickey_list_fetch */
  UNKNOWN_TYPE unknown_34;
  UNKNOWN_TYPE unknown_35;
  UNKNOWN_TYPE unknown_36;
  libssh2_publickey_list_fetch(unknown_34, unknown_35, unknown_36);

  af_safe_gb_cleanup();
}

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/libssh2/src/misc.c ['ssh2_client_fuzzer'] ['ssh2_client_fuzzer']
/src/libssh2/example/ssh2.c [] []
/src/libssh2/src/kex.c ['ssh2_client_fuzzer'] ['ssh2_client_fuzzer']
/src/libssh2/src/global.c ['ssh2_client_fuzzer'] ['ssh2_client_fuzzer']
/src/libssh2/src/crypto.h [] []
/src/libssh2/os400/include/assert.h [] []
/src/libssh2/src/publickey.c [] []
/src/libssh2/src/blowfish.c [] []
/src/libssh2/os400/os400sys.c [] []
/src/libssh2/src/userauth_kbd_packet.c [] []
/src/libssh2/src/channel.c ['ssh2_client_fuzzer'] ['ssh2_client_fuzzer']
/src/libssh2/src/session.c ['ssh2_client_fuzzer'] ['ssh2_client_fuzzer']
/src/libssh2/vms/man2help.c [] []
/src/libssh2/src/poly1305.c [] []
/src/libssh2/src/hostkey.c [] []
/src/libssh2/src/libgcrypt.h [] []
/src/libssh2/include/libssh2.h [] []
/src/libssh2/src/os400qc3.h [] []
/src/libssh2/src/libssh2_priv.h [] []
/src/libssh2/include/libssh2_publickey.h [] []
/src/libssh2/example/subsystem_netconf.c [] []
/src/libssh2/src/openssl.h [] []
/src/libssh2/src/crypt.c [] []
/src/libssh2/tests/test_hostkey_hash.c [] []
/src/libssh2/src/misc.h [] []
/src/libssh2/tests/test_simple.c [] []
/src/libssh2/tests/test_auth_keyboard_info_request.c [] []
/src/libssh2/src/chacha.c [] []
/src/libssh2/tests/ossfuzz/ssh2_client_fuzzer.cc ['ssh2_client_fuzzer'] ['ssh2_client_fuzzer']
/src/libssh2/src/keepalive.c [] []
/src/libssh2/src/scp.c [] []
/src/libssh2/src/mbedtls.c [] []
/src/libssh2/src/session.h [] []
/src/libssh2/src/pem.c [] []
/src/libssh2/src/wincng.c ['ssh2_client_fuzzer'] []
/src/libssh2/src/comp.c [] []
/src/libssh2/os400/ccsid.c [] []
/src/libssh2/tests/session_fixture.c [] []
/src/libssh2/tests/openssh_fixture.c [] []
/src/libssh2/src/mac.c ['ssh2_client_fuzzer'] ['ssh2_client_fuzzer']
/src/libssh2/src/knownhost.c [] []
/src/libssh2/src/packet.c ['ssh2_client_fuzzer'] ['ssh2_client_fuzzer']
/src/libssh2/src/sftp.c [] []
/src/libssh2/src/cipher-chachapoly.c [] []
/src/libssh2/example/sftp_nonblock.c [] []
/src/libssh2/src/transport.c ['ssh2_client_fuzzer'] ['ssh2_client_fuzzer']
/src/libssh2/os400/include/alloca.h [] []
/src/libssh2/src/openssl.c [] []
/src/libssh2/include/libssh2_sftp.h [] []
/src/libssh2/src/bcrypt_pbkdf.c [] []
/src/libssh2/example/x11.c [] []
/src/libssh2/src/os400qc3.c [] []
/src/libssh2/src/agent.c [] []
/src/libssh2/example/tcpip-forward.c [] []
/src/libssh2/os400/include/sys/socket.h [] []
/src/libssh2/src/version.c [] []
/src/libssh2/src/userauth.c [] []
/src/libssh2/tests/test_auth_password_ok.c [] []
/src/libssh2/src/wincng.h [] []

Directories in report

Directory
/src/libssh2/vms/
/src/libssh2/tests/ossfuzz/
/src/libssh2/os400/
/src/libssh2/src/
/src/libssh2/example/
/src/libssh2/os400/include/
/src/libssh2/tests/
/src/libssh2/include/
/src/libssh2/os400/include/sys/