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-salted-openssl-1.4.2/src/bruteforce-salted-openssl.c Examining data/bruteforce-salted-openssl-1.4.2/src/version.h FINAL RESULTS: data/bruteforce-salted-openssl-1.4.2/src/bruteforce-salted-openssl.c:845: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, "1aB:b:c:d:e:f:hL:l:M:m:Nns:t:v:w:p:")) != -1) data/bruteforce-salted-openssl-1.4.2/src/bruteforce-salted-openssl.c:84: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-salted-openssl-1.4.2/src/bruteforce-salted-openssl.c:110: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-salted-openssl-1.4.2/src/bruteforce-salted-openssl.c:516: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-salted-openssl-1.4.2/src/bruteforce-salted-openssl.c:561: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-salted-openssl-1.4.2/src/bruteforce-salted-openssl.c:695: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-salted-openssl-1.4.2/src/bruteforce-salted-openssl.c:912: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(optarg, "r"); data/bruteforce-salted-openssl-1.4.2/src/bruteforce-salted-openssl.c:926:35: [2] (integer) atol: 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). limit = (long unsigned int) atol(optarg); data/bruteforce-salted-openssl-1.4.2/src/bruteforce-salted-openssl.c:930: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-salted-openssl-1.4.2/src/bruteforce-salted-openssl.c:938: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-salted-openssl-1.4.2/src/bruteforce-salted-openssl.c:971: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-salted-openssl-1.4.2/src/bruteforce-salted-openssl.c:977: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-salted-openssl-1.4.2/src/bruteforce-salted-openssl.c:985:36: [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). preview_len = (unsigned int) atoi(optarg); data/bruteforce-salted-openssl-1.4.2/src/bruteforce-salted-openssl.c:1102:8: [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). fd = open(filename, O_RDONLY); data/bruteforce-salted-openssl-1.4.2/src/bruteforce-salted-openssl.c:218: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-salted-openssl-1.4.2/src/bruteforce-salted-openssl.c:221: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-salted-openssl-1.4.2/src/bruteforce-salted-openssl.c:341:11: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = fgetc(dictionary); data/bruteforce-salted-openssl-1.4.2/src/bruteforce-salted-openssl.c:442:48: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). preview_found = !strncmp(out, magic, strlen(magic)); data/bruteforce-salted-openssl-1.4.2/src/bruteforce-salted-openssl.c:462:38: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). found = !strncmp(out, magic, strlen(magic)); data/bruteforce-salted-openssl-1.4.2/src/bruteforce-salted-openssl.c:588:21: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). charset_len = strlen(binary_charset); data/bruteforce-salted-openssl-1.4.2/src/bruteforce-salted-openssl.c:1067:21: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). charset_len = strlen(binary_charset); data/bruteforce-salted-openssl-1.4.2/src/bruteforce-salted-openssl.c:1111:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read(fd, salt, 8); data/bruteforce-salted-openssl-1.4.2/src/bruteforce-salted-openssl.c:1120:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read(fd, salt, 8); data/bruteforce-salted-openssl-1.4.2/src/bruteforce-salted-openssl.c:1142:21: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). preview_len = strlen(magic) + EVP_CIPHER_block_size(cipher); data/bruteforce-salted-openssl-1.4.2/src/bruteforce-salted-openssl.c:1158:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read(fd, data + i, data_len - i); ANALYSIS SUMMARY: Hits = 25 Lines analyzed = 1274 in approximately 0.06 seconds (20991 lines/second) Physical Source Lines of Code (SLOC) = 1040 Hits@level = [0] 146 [1] 11 [2] 13 [3] 1 [4] 0 [5] 0 Hits@level+ = [0+] 171 [1+] 25 [2+] 14 [3+] 1 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 164.423 [1+] 24.0385 [2+] 13.4615 [3+] 0.961538 [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.