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/zeek-aux-0.44/rst/rst.c Examining data/zeek-aux-0.44/zeek-cut/zeek-cut.c Examining data/zeek-aux-0.44/adtrace/adtrace.c Examining data/zeek-aux-0.44/adtrace/ip.h Examining data/zeek-aux-0.44/adtrace/ether.h Examining data/zeek-aux-0.44/adtrace/ethertype.h Examining data/zeek-aux-0.44/plugin-support/skeleton/src/Plugin.cc Examining data/zeek-aux-0.44/plugin-support/skeleton/src/Plugin.h FINAL RESULTS: data/zeek-aux-0.44/rst/rst.c:69: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, fmt, arg); data/zeek-aux-0.44/rst/rst.c:207:3: [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(payload, inject); data/zeek-aux-0.44/rst/rst.c:218:4: [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(payload, fill_string); data/zeek-aux-0.44/rst/rst.c:314:16: [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 ( (op = getopt(argc, argv, "RI:i:d:n:r:s:")) != EOF ) data/zeek-aux-0.44/rst/rst.c:316:16: [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 ( (op = getopt(argc, argv, "RI:d:n:r:s:")) != EOF ) data/zeek-aux-0.44/zeek-cut/zeek-cut.c:483:24: [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 *envtimefmt = getenv("ZEEK_CUT_TIMEFMT"); data/zeek-aux-0.44/zeek-cut/zeek-cut.c:485:22: [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. envtimefmt = getenv("BRO_CUT_TIMEFMT"); data/zeek-aux-0.44/zeek-cut/zeek-cut.c:502:17: [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. while ((c = getopt_long(argc, argv, "cCnF:duD:U:h", long_opts, NULL)) != -1) { data/zeek-aux-0.44/adtrace/adtrace.c:67: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 errbuf[PCAP_ERRBUF_SIZE]; data/zeek-aux-0.44/rst/rst.c:293: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 inject[8192]; data/zeek-aux-0.44/rst/rst.c:343:12: [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). delay = atoi(optarg); data/zeek-aux-0.44/rst/rst.c:347:10: [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). num = atoi(optarg); data/zeek-aux-0.44/rst/rst.c:351:17: [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). redundancy = atoi(optarg); data/zeek-aux-0.44/rst/rst.c:355:13: [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). stride = atoi(optarg); data/zeek-aux-0.44/rst/rst.c:383:14: [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). from_port = atoi(argv[optind++]); data/zeek-aux-0.44/rst/rst.c:387:12: [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). to_port = atoi(argv[optind++]); data/zeek-aux-0.44/zeek-cut/zeek-cut.c:35: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 ifs[2]; /* input field separator character */ data/zeek-aux-0.44/zeek-cut/zeek-cut.c:36: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 ofs[2]; /* output field separator character */ data/zeek-aux-0.44/zeek-cut/zeek-cut.c:237:12: [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 tbuf[MAX_TIMESTAMP_LEN]; data/zeek-aux-0.44/rst/rst.c:170:10: [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 = strlen(inject); data/zeek-aux-0.44/rst/rst.c:214:11: [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 n = strlen(fill_string); data/zeek-aux-0.44/rst/rst.c:233:3: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(delay * 1000); data/zeek-aux-0.44/rst/rst.c:377:62: [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 ( setsockopt(s, SOL_SOCKET, SO_BINDTODEVICE, interface, strlen(interface)) < 0 ) data/zeek-aux-0.44/zeek-cut/zeek-cut.c:514: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). if (strlen(optarg) != 1) { data/zeek-aux-0.44/zeek-cut/zeek-cut.c:540:27: [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 (bopts.timeconv && strlen(bopts.timefmt) == 0) { ANALYSIS SUMMARY: Hits = 25 Lines analyzed = 1420 in approximately 0.08 seconds (18707 lines/second) Physical Source Lines of Code (SLOC) = 975 Hits@level = [0] 13 [1] 6 [2] 11 [3] 5 [4] 3 [5] 0 Hits@level+ = [0+] 38 [1+] 25 [2+] 19 [3+] 8 [4+] 3 [5+] 0 Hits/KSLOC@level+ = [0+] 38.9744 [1+] 25.641 [2+] 19.4872 [3+] 8.20513 [4+] 3.07692 [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.