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/proftpd-mod-statsd-0.1/metric.c Examining data/proftpd-mod-statsd-0.1/metric.h Examining data/proftpd-mod-statsd-0.1/mod_statsd.c Examining data/proftpd-mod-statsd-0.1/statsd.c Examining data/proftpd-mod-statsd-0.1/statsd.h Examining data/proftpd-mod-statsd-0.1/t/api/metric.c Examining data/proftpd-mod-statsd-0.1/t/api/statsd.c Examining data/proftpd-mod-statsd-0.1/t/api/stubs.c Examining data/proftpd-mod-statsd-0.1/t/api/tests.c Examining data/proftpd-mod-statsd-0.1/t/api/tests.h FINAL RESULTS: data/proftpd-mod-statsd-0.1/t/api/stubs.c:81: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, msg); data/proftpd-mod-statsd-0.1/t/api/stubs.c:95: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, msg); data/proftpd-mod-statsd-0.1/t/api/stubs.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, fmt, msg); data/proftpd-mod-statsd-0.1/t/api/stubs.c:138: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, msg); data/proftpd-mod-statsd-0.1/mod_statsd.c:121:16: [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. p = ((float) random() / RAND_MAX); data/proftpd-mod-statsd-0.1/mod_statsd.c:705:3: [3] (random) srandom: 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. srandom((unsigned int) (time(NULL) ^ getpid())); data/proftpd-mod-statsd-0.1/mod_statsd.c:707:3: [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) ^ getpid())); data/proftpd-mod-statsd-0.1/t/api/metric.c:38:7: [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 (getenv("TEST_VERBOSE") != NULL) { data/proftpd-mod-statsd-0.1/t/api/metric.c:44:7: [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 (getenv("TEST_VERBOSE") != NULL) { data/proftpd-mod-statsd-0.1/t/api/statsd.c:39:7: [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 (getenv("TEST_VERBOSE") != NULL) { data/proftpd-mod-statsd-0.1/t/api/statsd.c:45:7: [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 (getenv("TEST_VERBOSE") != NULL) { data/proftpd-mod-statsd-0.1/t/api/stubs.c:75:7: [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 (getenv("TEST_VERBOSE") != NULL) { data/proftpd-mod-statsd-0.1/t/api/stubs.c:89:7: [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 (getenv("TEST_VERBOSE") != NULL) { data/proftpd-mod-statsd-0.1/t/api/stubs.c:118:7: [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 (getenv("TEST_VERBOSE") != NULL) { data/proftpd-mod-statsd-0.1/t/api/stubs.c:132:7: [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 (getenv("TEST_VERBOSE") != NULL) { data/proftpd-mod-statsd-0.1/t/api/tests.c:65:15: [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. requested = getenv("STATSD_TEST_SUITE"); data/proftpd-mod-statsd-0.1/t/api/tests.c:96:15: [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. requested = getenv("STATSD_TEST_NOFORK"); data/proftpd-mod-statsd-0.1/t/api/tests.c:100:17: [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. requested = getenv("CK_DEFAULT_TIMEOUT"); data/proftpd-mod-statsd-0.1/mod_statsd.c:179: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 errstr[256] = {'\0'}; data/proftpd-mod-statsd-0.1/mod_statsd.c:270:16: [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). port = atoi(ptr + 1); data/proftpd-mod-statsd-0.1/mod_statsd.c:280: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). port = atoi(ptr + 1); data/proftpd-mod-statsd-0.1/mod_statsd.c:256:16: [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). server_len = strlen(server); ANALYSIS SUMMARY: Hits = 22 Lines analyzed = 2386 in approximately 0.07 seconds (34105 lines/second) Physical Source Lines of Code (SLOC) = 1546 Hits@level = [0] 18 [1] 1 [2] 3 [3] 14 [4] 4 [5] 0 Hits@level+ = [0+] 40 [1+] 22 [2+] 21 [3+] 18 [4+] 4 [5+] 0 Hits/KSLOC@level+ = [0+] 25.8732 [1+] 14.2303 [2+] 13.5834 [3+] 11.6429 [4+] 2.58732 [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.