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/ganglia-modules-linux-1.3.6/example/mod_example.c Examining data/ganglia-modules-linux-1.3.6/multicpu/mod_multicpu.c Examining data/ganglia-modules-linux-1.3.6/io/mod_io.c Examining data/ganglia-modules-linux-1.3.6/fs/mod_fs.c FINAL RESULTS: data/ganglia-modules-linux-1.3.6/fs/mod_fs.c:237:6: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. rc=sscanf(procline, "%s %s %s %s ", device, mount, type, mode); data/ganglia-modules-linux-1.3.6/io/mod_io.c:82:22: [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. unsigned long long system; data/ganglia-modules-linux-1.3.6/io/mod_io.c:199:6: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if(access("/proc/diskstats", R_OK)) { data/ganglia-modules-linux-1.3.6/io/mod_io.c:216:9: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. if (sscanf(buf, scan_fmt, &curr.major, &curr.minor, data/ganglia-modules-linux-1.3.6/io/mod_io.c:311:11: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. items = sscanf(buffer, scan_fmt, data/ganglia-modules-linux-1.3.6/io/mod_io.c:371:14: [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. &new_cpu.system, data/ganglia-modules-linux-1.3.6/example/mod_example.c:58: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(time(NULL)%99); data/ganglia-modules-linux-1.3.6/example/mod_example.c:72:30: [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). random_max = atoi(params[i].value); data/ganglia-modules-linux-1.3.6/example/mod_example.c:75:34: [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). constant_value = atoi(params[i].value); data/ganglia-modules-linux-1.3.6/fs/mod_fs.c:223: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 procline[256]; data/ganglia-modules-linux-1.3.6/fs/mod_fs.c:224: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 mount[128], device[128], type[32], mode[128]; data/ganglia-modules-linux-1.3.6/fs/mod_fs.c:231:11: [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). mounts = fopen(MOUNTS, "r"); data/ganglia-modules-linux-1.3.6/io/mod_io.c:64: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 name[64]; data/ganglia-modules-linux-1.3.6/multicpu/mod_multicpu.c:125: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). for (i=1; strlen(p) > 0;) { data/ganglia-modules-linux-1.3.6/multicpu/mod_multicpu.c:155: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). while (strlen(p) > 0) { ANALYSIS SUMMARY: Hits = 15 Lines analyzed = 1685 in approximately 0.07 seconds (25223 lines/second) Physical Source Lines of Code (SLOC) = 1100 Hits@level = [0] 1 [1] 2 [2] 6 [3] 1 [4] 6 [5] 0 Hits@level+ = [0+] 16 [1+] 15 [2+] 13 [3+] 7 [4+] 6 [5+] 0 Hits/KSLOC@level+ = [0+] 14.5455 [1+] 13.6364 [2+] 11.8182 [3+] 6.36364 [4+] 5.45455 [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.