Flawfinder version 2.0.10, (C) 2001-2019 David A. Wheeler. Number of rules (primarily dangerous function names) in C/C++ ruleset: 223 Examining data/bruteforce-wallet-1.5.3/src/bruteforce-wallet.c Examining data/bruteforce-wallet-1.5.3/src/elliptic-curve.c Examining data/bruteforce-wallet-1.5.3/src/elliptic-curve.h Examining data/bruteforce-wallet-1.5.3/src/version.h FINAL RESULTS: data/bruteforce-wallet-1.5.3/src/bruteforce-wallet.c:723:14: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while((c = getopt(argc, argv, "b:e:f:hl:m:s:t:v:w:")) != -1) data/bruteforce-wallet-1.5.3/src/bruteforce-wallet.c:56:10: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char *pubkey, *encrypted_seckey, *encrypted_masterkey, salt[8]; data/bruteforce-wallet-1.5.3/src/bruteforce-wallet.c:64:10: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char last_pass[LAST_PASS_MAX_SHOWN_LENGTH]; data/bruteforce-wallet-1.5.3/src/bruteforce-wallet.c:90:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char datestr[256]; data/bruteforce-wallet-1.5.3/src/bruteforce-wallet.c:156:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char hash1[32]; data/bruteforce-wallet-1.5.3/src/bruteforce-wallet.c:317:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char *pwd, *key, *iv, *masterkey, *seckey, hash[32]; data/bruteforce-wallet-1.5.3/src/bruteforce-wallet.c:393:17: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE *state = fopen(state_file, "w+"); data/bruteforce-wallet-1.5.3/src/bruteforce-wallet.c:435:17: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE *state = fopen(state_file, "r"); data/bruteforce-wallet-1.5.3/src/bruteforce-wallet.c:560:18: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). dictionary = fopen(dictionary_file, "r"); data/bruteforce-wallet-1.5.3/src/bruteforce-wallet.c:599:13: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). ret = db->open(db, NULL, filename, "main", DB_UNKNOWN, DB_RDONLY, 0); data/bruteforce-wallet-1.5.3/src/bruteforce-wallet.c:631:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(encrypted_masterkey, db_data.data + 1, encrypted_masterkey_len); data/bruteforce-wallet-1.5.3/src/bruteforce-wallet.c:632:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(salt, db_data.data + 1 + encrypted_masterkey_len + 1, 8); data/bruteforce-wallet-1.5.3/src/bruteforce-wallet.c:651:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(pubkey, db_key.data + 6, pubkey_len); data/bruteforce-wallet-1.5.3/src/bruteforce-wallet.c:652:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(encrypted_seckey, db_data.data + 1, encrypted_seckey_len); data/bruteforce-wallet-1.5.3/src/bruteforce-wallet.c:760:20: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). dictionary = fopen(dictionary_file, "r"); data/bruteforce-wallet-1.5.3/src/bruteforce-wallet.c:774:32: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). min_len = (unsigned int) atoi(optarg); data/bruteforce-wallet-1.5.3/src/bruteforce-wallet.c:778:32: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). max_len = (unsigned int) atoi(optarg); data/bruteforce-wallet-1.5.3/src/bruteforce-wallet.c:803:35: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). nb_threads = (unsigned int) atoi(optarg); data/bruteforce-wallet-1.5.3/src/bruteforce-wallet.c:809:40: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). status_interval = (unsigned int) atoi(optarg); data/bruteforce-wallet-1.5.3/src/bruteforce-wallet.c:210:3: [1] (buffer) wcsncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). wcsncpy(password, prefix, prefix_len); data/bruteforce-wallet-1.5.3/src/bruteforce-wallet.c:213:3: [1] (buffer) wcsncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). wcsncpy(password + prefix_len + len, suffix, suffix_len); data/bruteforce-wallet-1.5.3/src/bruteforce-wallet.c:268:11: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = fgetc(dictionary); ANALYSIS SUMMARY: Hits = 22 Lines analyzed = 1154 in approximately 0.07 seconds (16468 lines/second) Physical Source Lines of Code (SLOC) = 878 Hits@level = [0] 115 [1] 3 [2] 18 [3] 1 [4] 0 [5] 0 Hits@level+ = [0+] 137 [1+] 22 [2+] 19 [3+] 1 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 156.036 [1+] 25.0569 [2+] 21.6401 [3+] 1.13895 [4+] 0 [5+] 0 Dot directories skipped = 1 (--followdotdir overrides) Minimum risk level = 1 Not every hit is necessarily a security vulnerability. There may be other security vulnerabilities; review your code! See 'Secure Programming HOWTO' (https://dwheeler.com/secure-programs) for more information.