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/isatapd-0.9.7/src/tunnel.h Examining data/isatapd-0.9.7/src/rdisc.c Examining data/isatapd-0.9.7/src/isatap.h Examining data/isatapd-0.9.7/src/main.h Examining data/isatapd-0.9.7/src/rdisc.h Examining data/isatapd-0.9.7/src/main.c Examining data/isatapd-0.9.7/src/isatap.c Examining data/isatapd-0.9.7/src/tunnel.c FINAL RESULTS: data/isatapd-0.9.7/src/main.c:118:2: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stderr, PACKAGE "-" VERSION "\n\n"); data/isatapd-0.9.7/src/isatap.c:363:2: [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 int)time(NULL)); data/isatapd-0.9.7/src/main.c:167:7: [3] (buffer) getopt_long: 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. c = getopt_long(argc, argv, short_options, long_options, &long_index); data/isatapd-0.9.7/src/isatap.c:468:6: [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 addrstr[INET6_ADDRSTRLEN]; data/isatapd-0.9.7/src/main.c:217: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). mtu = atoi(optarg); data/isatapd-0.9.7/src/main.c:228: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). ttl = atoi(optarg); data/isatapd-0.9.7/src/main.c:479: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 s[32]; data/isatapd-0.9.7/src/main.c:482: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). pf = open(pid_file, O_WRONLY | O_CREAT, 0644); data/isatapd-0.9.7/src/rdisc.c:120: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 cbuf[CMSG_SPACE (sizeof (int))]; data/isatapd-0.9.7/src/rdisc.c:209:7: [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 str[INET6_ADDRSTRLEN]; data/isatapd-0.9.7/src/rdisc.c:242: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 str[INET6_ADDRSTRLEN]; data/isatapd-0.9.7/src/rdisc.c:249: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 (dst.s6_addr, ptr + 8, (optlen - 1) << 3); data/isatapd-0.9.7/src/rdisc.c:299: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 str[INET6_ADDRSTRLEN]; data/isatapd-0.9.7/src/main.c:504:19: [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 (write(pf, s, strlen(s)) < strlen(s)) data/isatapd-0.9.7/src/main.c:504:32: [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 (write(pf, s, strlen(s)) < strlen(s)) data/isatapd-0.9.7/src/tunnel.c:47:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ifr.ifr_name, dev, IFNAMSIZ); data/isatapd-0.9.7/src/tunnel.c:85:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(p.name, dev, IFNAMSIZ); data/isatapd-0.9.7/src/tunnel.c:92:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(ifr.ifr_name, "sit0", IFNAMSIZ); data/isatapd-0.9.7/src/tunnel.c:115:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ifr.ifr_name, dev, IFNAMSIZ); data/isatapd-0.9.7/src/tunnel.c:142:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ifr.ifr_name, dev, IFNAMSIZ); data/isatapd-0.9.7/src/tunnel.c:176:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(p.name, dev, IFNAMSIZ); data/isatapd-0.9.7/src/tunnel.c:178:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ifr.ifr_name, dev, IFNAMSIZ); data/isatapd-0.9.7/src/tunnel.c:207:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ifr.ifr_name, dev, IFNAMSIZ); data/isatapd-0.9.7/src/tunnel.c:234:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ifr.ifr_name, dev, IFNAMSIZ); data/isatapd-0.9.7/src/tunnel.c:260:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ifr.ifr_name, dev, IFNAMSIZ); ANALYSIS SUMMARY: Hits = 25 Lines analyzed = 1919 in approximately 0.12 seconds (15748 lines/second) Physical Source Lines of Code (SLOC) = 1342 Hits@level = [0] 105 [1] 12 [2] 10 [3] 2 [4] 1 [5] 0 Hits@level+ = [0+] 130 [1+] 25 [2+] 13 [3+] 3 [4+] 1 [5+] 0 Hits/KSLOC@level+ = [0+] 96.8703 [1+] 18.6289 [2+] 9.68703 [3+] 2.23547 [4+] 0.745156 [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.