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/cmatrix-2.0/cmatrix.c FINAL RESULTS: data/cmatrix-2.0/cmatrix.c:82:5: [4] (format) vsnprintf: 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. vsnprintf(buf, sizeof(buf), str, ap); data/cmatrix-2.0/cmatrix.c:84: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. return system(buf); data/cmatrix-2.0/cmatrix.c:124: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, msg, ap); data/cmatrix-2.0/cmatrix.c:291:5: [3] (random) srand: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srand((unsigned) time(NULL)); data/cmatrix-2.0/cmatrix.c:296:22: [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 ((optchr = getopt(argc, argv, "abBcfhlLnrosmxVu:C:")) != EOF) { data/cmatrix-2.0/cmatrix.c:375:34: [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. if (force && strcmp("linux", getenv("TERM"))) { data/cmatrix-2.0/cmatrix.c:594:32: [3] (random) random: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. } else if (random > highnum && matrix[1][j].val != 1) { data/cmatrix-2.0/cmatrix.c:79: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[133]; data/cmatrix-2.0/cmatrix.c:236:10: [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(tty, O_RDWR); data/cmatrix-2.0/cmatrix.c:358:22: [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). update = atoi(optarg); data/cmatrix-2.0/cmatrix.c:763:34: [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 msg_y = COLS/2 - strlen(msg)/2; data/cmatrix-2.0/cmatrix.c:768:28: [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(i = 0; i < strlen(msg)+4; i++) data/cmatrix-2.0/cmatrix.c:781:28: [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(i = 0; i < strlen(msg)+4; i++) ANALYSIS SUMMARY: Hits = 13 Lines analyzed = 789 in approximately 0.08 seconds (10508 lines/second) Physical Source Lines of Code (SLOC) = 656 Hits@level = [0] 21 [1] 3 [2] 3 [3] 4 [4] 3 [5] 0 Hits@level+ = [0+] 34 [1+] 13 [2+] 10 [3+] 7 [4+] 3 [5+] 0 Hits/KSLOC@level+ = [0+] 51.8293 [1+] 19.8171 [2+] 15.2439 [3+] 10.6707 [4+] 4.57317 [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.