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/wmail-2.3/src/wmail.c Examining data/wmail-2.3/src/config.h Examining data/wmail-2.3/src/config.c Examining data/wmail-2.3/src/common.c Examining data/wmail-2.3/src/common.h FINAL RESULTS: data/wmail-2.3/src/common.c:51:5: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf( stderr, fmt, args ); data/wmail-2.3/src/common.c:62:5: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf( stderr, fmt, args ); data/wmail-2.3/src/common.c:74:5: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf( stderr, fmt, args ); data/wmail-2.3/src/common.c:102:2: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf( fullName, len, fmt, dir, file ); data/wmail-2.3/src/wmail.c:729:13: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. int ret = system( config.cmdOnMail ); data/wmail-2.3/src/wmail.c:1366:6: [4] (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). strcat(fullName, comment); data/wmail-2.3/src/wmail.c:1371:6: [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(addressName, fullName); data/wmail-2.3/src/wmail.c:1372:6: [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(fullName, comment); data/wmail-2.3/src/wmail.c:1389:6: [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( addressName, fullName ); data/wmail-2.3/src/wmail.c:1627:12: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. int ret = system( config.runCmd ); data/wmail-2.3/src/config.c:257:18: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. char *envMBox = getenv( "MAIL" ); data/wmail-2.3/src/wmail.c:360:23: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. char *usersHome = getenv( "HOME" ); data/wmail-2.3/src/wmail.c:1698:19: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. config.mailBox = getenv( "MAIL" ); data/wmail-2.3/src/config.c:269:15: [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 *f = fopen( configFile, "r" ); data/wmail-2.3/src/config.c:272: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 buf[1024]; data/wmail-2.3/src/wmail.c:741:15: [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 *f = fopen( config.checksumFileName, "rb" ); data/wmail-2.3/src/wmail.c:762:14: [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). if(( f = fopen( config.checksumFileName, "wb" )) != NULL ) data/wmail-2.3/src/wmail.c:1091: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 buf[1024]; data/wmail-2.3/src/wmail.c:1094:15: [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 *f = fopen( config.mailBox, "r" ); data/wmail-2.3/src/wmail.c:1165: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 buf[1024]; data/wmail-2.3/src/wmail.c:1167:15: [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 *f = fopen( fileName, "r" ); data/wmail-2.3/src/wmail.c:1643:2: [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( xpmLine, "%02X%02X%02X", color.red>>8, color.green>>8, data/wmail-2.3/src/wmail.c:1669:6: [2] (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). Risk is low because the source is a constant string. strcpy( newLine, " \tc #" ); data/wmail-2.3/src/common.c:81:23: [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). size_t dir_len = strlen( dir ); data/wmail-2.3/src/common.c:82:23: [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). size_t file_len = strlen( file ); data/wmail-2.3/src/config.c:123:13: [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(( len = strlen( token1 )) != 0 && token1[0] != '#' ) data/wmail-2.3/src/config.c:284:17: [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). for( len = strlen( buf ); len > 0 && IsWhiteSpace(buf + (--len)); ) data/wmail-2.3/src/wmail.c:786:18: [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). size_t i, len = strlen( buf ); data/wmail-2.3/src/wmail.c:1217: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). size_t maxLen = strlen( buf ) + 1; data/wmail-2.3/src/wmail.c:1365:6: [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(fullName, "("); data/wmail-2.3/src/wmail.c:1367:6: [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(fullName, ")"); data/wmail-2.3/src/wmail.c:1406:18: [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). size_t len = strlen( address ); data/wmail-2.3/src/wmail.c:1513:25: [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). curTickerName->name, strlen( curTickerName->name )); data/wmail-2.3/src/wmail.c:1518:5: [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). strlen( curTickerName->name )) + 6 ) data/wmail-2.3/src/wmail.c:1584:23: [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( takeItFrom/14 >= strlen( curTickerName->name )) data/wmail-2.3/src/wmail.c:1660:29: [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). strcasecmp( &(*colorLine)[ strlen( *colorLine ) - 4 ], "none" ) == 0 ) ANALYSIS SUMMARY: Hits = 36 Lines analyzed = 2700 in approximately 0.07 seconds (40667 lines/second) Physical Source Lines of Code (SLOC) = 2009 Hits@level = [0] 3 [1] 13 [2] 10 [3] 3 [4] 10 [5] 0 Hits@level+ = [0+] 39 [1+] 36 [2+] 23 [3+] 13 [4+] 10 [5+] 0 Hits/KSLOC@level+ = [0+] 19.4126 [1+] 17.9194 [2+] 11.4485 [3+] 6.47088 [4+] 4.9776 [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.