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/netplug-1.2.9.2/config.c Examining data/netplug-1.2.9.2/netlink.c Examining data/netplug-1.2.9.2/if_info.c Examining data/netplug-1.2.9.2/lib.c Examining data/netplug-1.2.9.2/main.c Examining data/netplug-1.2.9.2/netplug.h FINAL RESULTS: data/netplug-1.2.9.2/if_info.c:85:19: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. cp += sprintf(cp, "%s,", flags[i].name); data/netplug-1.2.9.2/if_info.c:466:5: [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(i->name, RTA_DATA(attrs[IFLA_IFNAME])); data/netplug-1.2.9.2/lib.c:79:9: [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(fp, fmt, ap); data/netplug-1.2.9.2/lib.c:115:5: [4] (shell) execl: 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. execl(script_file, script_file, ifname, action, NULL); data/netplug-1.2.9.2/netplug.h:95:29: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. __attribute__ ((format (printf, 2, 3))); data/netplug-1.2.9.2/main.c:224:17: [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, "DFPc:s:hi:p:")) != EOF) { data/netplug-1.2.9.2/config.c:78: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(pat->pat, name, len + 1); data/netplug-1.2.9.2/config.c:94:22: [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). } else if ((fp = fopen(filename, "r")) == NULL) { data/netplug-1.2.9.2/config.c:99: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[8192]; data/netplug-1.2.9.2/config.c:180:17: [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(z + m, "%d", i); data/netplug-1.2.9.2/if_info.c:90:15: [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. cp += sprintf(cp, "%x,", fl); data/netplug-1.2.9.2/if_info.c:174: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 buf1[512], buf2[512]; data/netplug-1.2.9.2/if_info.c:460:9: [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(i->addr, RTA_DATA(attrs[IFLA_ADDRESS]), alen); data/netplug-1.2.9.2/main.c:121: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). if ((fp = fopen(pid_file, "w")) == NULL) { data/netplug-1.2.9.2/netlink.c:119: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[8192]; data/netplug-1.2.9.2/netlink.c:193: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[8192]; data/netplug-1.2.9.2/netplug.h:60: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. unsigned char addr[8]; data/netplug-1.2.9.2/netplug.h:61: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 name[16]; data/netplug-1.2.9.2/config.c:63: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 len = strlen(name); data/netplug-1.2.9.2/config.c:177:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(z, p->pat, m); data/netplug-1.2.9.2/main.c:391:23: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read(child_handler_pipe[0], &ce, sizeof(ce)); ANALYSIS SUMMARY: Hits = 21 Lines analyzed = 1732 in approximately 0.05 seconds (36473 lines/second) Physical Source Lines of Code (SLOC) = 1207 Hits@level = [0] 13 [1] 3 [2] 12 [3] 1 [4] 5 [5] 0 Hits@level+ = [0+] 34 [1+] 21 [2+] 18 [3+] 6 [4+] 5 [5+] 0 Hits/KSLOC@level+ = [0+] 28.169 [1+] 17.3985 [2+] 14.913 [3+] 4.971 [4+] 4.1425 [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.