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/lua-scrypt-1.1/base64.c Examining data/lua-scrypt-1.1/base64.h Examining data/lua-scrypt-1.1/luascrypt.c FINAL RESULTS: data/lua-scrypt-1.1/luascrypt.c:128:2: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(crypted_copy, crypted); data/lua-scrypt-1.1/luascrypt.c:38:7: [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("/dev/urandom", O_RDONLY); data/lua-scrypt-1.1/luascrypt.c:51:2: [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 buffer[256]; /* This value is nasty here, but */ data/lua-scrypt-1.1/luascrypt.c:52:2: [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 salt[16]; /* while I am not normally into magic */ data/lua-scrypt-1.1/luascrypt.c:54:2: [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 saltbuf[256]; /* libscrypt_hash() source. */ data/lua-scrypt-1.1/luascrypt.c:55:2: [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 outbuf[256]; /* Icky, I know, but what can I do? */ data/lua-scrypt-1.1/luascrypt.c:40:3: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read(fd, salt, saltlen); /* Ignore errors in these two calls */ data/lua-scrypt-1.1/luascrypt.c:104:15: [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). int oblen = strlen(outbuf); data/lua-scrypt-1.1/luascrypt.c:105:15: [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). int bulen = strlen(buffer); data/lua-scrypt-1.1/luascrypt.c:109:4: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat(buffer, "="); data/lua-scrypt-1.1/luascrypt.c:127:50: [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). char *crypted_copy = (char *)lua_newuserdata(L, strlen(crypted)+1); ANALYSIS SUMMARY: Hits = 11 Lines analyzed = 342 in approximately 0.02 seconds (16114 lines/second) Physical Source Lines of Code (SLOC) = 185 Hits@level = [0] 0 [1] 5 [2] 5 [3] 0 [4] 1 [5] 0 Hits@level+ = [0+] 11 [1+] 11 [2+] 6 [3+] 1 [4+] 1 [5+] 0 Hits/KSLOC@level+ = [0+] 59.4595 [1+] 59.4595 [2+] 32.4324 [3+] 5.40541 [4+] 5.40541 [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.