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-md5-1.2+git+1+8d87fee/src/compat-5.2.c Examining data/lua-md5-1.2+git+1+8d87fee/src/compat-5.2.h Examining data/lua-md5-1.2+git+1+8d87fee/src/des56.c Examining data/lua-md5-1.2+git+1+8d87fee/src/des56.h Examining data/lua-md5-1.2+git+1+8d87fee/src/ldes56.c Examining data/lua-md5-1.2+git+1+8d87fee/src/ldes56.h Examining data/lua-md5-1.2+git+1+8d87fee/src/md5.c Examining data/lua-md5-1.2+git+1+8d87fee/src/md5.h Examining data/lua-md5-1.2+git+1+8d87fee/src/md5lib.c Examining data/lua-md5-1.2+git+1+8d87fee/tests/DES56/fdemo.c Examining data/lua-md5-1.2+git+1+8d87fee/tests/DES56/ftest.c FINAL RESULTS: data/lua-md5-1.2+git+1+8d87fee/src/md5lib.c:123:12: [4] (crypto) crypt: The crypt functions use a poor one-way hashing algorithm; since they only accept passwords of 8 characters or fewer and only a two-byte salt, they are excessively vulnerable to dictionary attacks given today's faster computing equipment (CWE-327). Use a different algorithm, such as SHA-256, with a larger, non-repeating salt. static int crypt (lua_State *L) { data/lua-md5-1.2+git+1+8d87fee/src/md5lib.c:189:13: [4] (crypto) crypt: The crypt functions use a poor one-way hashing algorithm; since they only accept passwords of 8 characters or fewer and only a two-byte salt, they are excessively vulnerable to dictionary attacks given today's faster computing equipment (CWE-327). Use a different algorithm, such as SHA-256, with a larger, non-repeating salt. {"crypt", crypt}, data/lua-md5-1.2+git+1+8d87fee/tests/DES56/ftest.c:129:2: [4] (crypto) crypt: The crypt functions use a poor one-way hashing algorithm; since they only accept passwords of 8 characters or fewer and only a two-byte salt, they are excessively vulnerable to dictionary attacks given today's faster computing equipment (CWE-327). Use a different algorithm, such as SHA-256, with a larger, non-repeating salt. crypt((char *)bdata, ".."); /* Key, no salt */ data/lua-md5-1.2+git+1+8d87fee/src/des56.c:402:14: [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. void fsetkey(char key[8], keysched *ks) data/lua-md5-1.2+git+1+8d87fee/src/des56.c:455: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. fencrypt(char block[8], int decrypt, keysched *ks) data/lua-md5-1.2+git+1+8d87fee/src/des56.h:73:21: [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. extern void fsetkey(char key[8], keysched *ks); data/lua-md5-1.2+git+1+8d87fee/src/des56.h:75:22: [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. extern void fencrypt(char block[8], int decrypt, keysched *ks); data/lua-md5-1.2+git+1+8d87fee/src/ldes56.c:37:5: [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 k[8]; data/lua-md5-1.2+git+1+8d87fee/src/ldes56.c:86:5: [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 k[8]; data/lua-md5-1.2+git+1+8d87fee/src/md5.c:178: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 buff[64]; data/lua-md5-1.2+git+1+8d87fee/src/md5.c:180:5: [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(buff, pt, num); /* to avoid changing original string */ data/lua-md5-1.2+git+1+8d87fee/src/md5lib.c:25: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 buff[16]; data/lua-md5-1.2+git+1+8d87fee/src/md5lib.c:73:3: [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(block, seed, lseed); data/lua-md5-1.2+git+1+8d87fee/src/md5lib.c:74:3: [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(block+BLOCKSIZE, key, lkey); data/lua-md5-1.2+git+1+8d87fee/src/md5lib.c:84:5: [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 code[BLOCKSIZE]; data/lua-md5-1.2+git+1+8d87fee/src/md5lib.c:90:5: [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(block, code, i); /* update seed */ data/lua-md5-1.2+git+1+8d87fee/src/md5lib.c:101:5: [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 code[BLOCKSIZE]; data/lua-md5-1.2+git+1+8d87fee/src/md5lib.c:107:5: [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(block, cypher-i, i); data/lua-md5-1.2+git+1+8d87fee/src/md5lib.c:129: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 block[BLOCKSIZE+MAXKEY]; data/lua-md5-1.2+git+1+8d87fee/src/md5lib.c:136:3: [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(block+1, seed, lseed); data/lua-md5-1.2+git+1+8d87fee/src/md5lib.c:159: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 block[BLOCKSIZE+MAXKEY]; data/lua-md5-1.2+git+1+8d87fee/tests/DES56/fdemo.c:13: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 b[8]; data/lua-md5-1.2+git+1+8d87fee/tests/DES56/fdemo.c:18:9: [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. static char s[18]; data/lua-md5-1.2+git+1+8d87fee/tests/DES56/fdemo.c:24:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(p, "%02x", v->b[i] & 0xff); data/lua-md5-1.2+git+1+8d87fee/tests/DES56/fdemo.c:140:11: [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). count = atoi(op); data/lua-md5-1.2+git+1+8d87fee/tests/DES56/ftest.c:21: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 b[8]; data/lua-md5-1.2+git+1+8d87fee/tests/DES56/ftest.c:37:1: [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 * data/lua-md5-1.2+git+1+8d87fee/tests/DES56/ftest.c:38:8: [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. bprint(char b[64]) data/lua-md5-1.2+git+1+8d87fee/tests/DES56/ftest.c:40:9: [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. static char s[17]; data/lua-md5-1.2+git+1+8d87fee/tests/DES56/ftest.c:44:6: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(&s[i/4], "%1x", b[i]<<3 | b[i+1]<<2 | b[i+2]<<1 | b[i+3]); data/lua-md5-1.2+git+1+8d87fee/tests/DES56/ftest.c:51:9: [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. static char s[17]; data/lua-md5-1.2+git+1+8d87fee/tests/DES56/ftest.c:55:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(&s[2*i], "%02x", v->b[i] & 0xff); data/lua-md5-1.2+git+1+8d87fee/tests/DES56/ftest.c:82:23: [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. void expand(chunk *v, char bits[64]) data/lua-md5-1.2+git+1+8d87fee/tests/DES56/ftest.c:96: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 bkey[64], bdata[64]; data/lua-md5-1.2+git+1+8d87fee/tests/DES56/ftest.c:146:11: [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). count = atoi(op); data/lua-md5-1.2+git+1+8d87fee/src/ldes56.c:35:14: [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). if (key && strlen(key) >= 8) data/lua-md5-1.2+git+1+8d87fee/src/ldes56.c:84:14: [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). if (key && strlen(key) >= 8) ANALYSIS SUMMARY: Hits = 37 Lines analyzed = 1637 in approximately 0.07 seconds (22052 lines/second) Physical Source Lines of Code (SLOC) = 1066 Hits@level = [0] 22 [1] 2 [2] 32 [3] 0 [4] 3 [5] 0 Hits@level+ = [0+] 59 [1+] 37 [2+] 35 [3+] 3 [4+] 3 [5+] 0 Hits/KSLOC@level+ = [0+] 55.3471 [1+] 34.7092 [2+] 32.833 [3+] 2.81426 [4+] 2.81426 [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.