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/netplan.io-0.99/src/dbus.c Examining data/netplan.io-0.99/src/error.c Examining data/netplan.io-0.99/src/error.h Examining data/netplan.io-0.99/src/generate.c Examining data/netplan.io-0.99/src/networkd.h Examining data/netplan.io-0.99/src/nm.c Examining data/netplan.io-0.99/src/nm.h Examining data/netplan.io-0.99/src/parse.c Examining data/netplan.io-0.99/src/parse.h Examining data/netplan.io-0.99/src/util.c Examining data/netplan.io-0.99/src/util.h Examining data/netplan.io-0.99/src/validation.c Examining data/netplan.io-0.99/src/validation.h Examining data/netplan.io-0.99/src/networkd.c FINAL RESULTS: data/netplan.io-0.99/src/dbus.c:30:26: [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 (getuid() != 0 && getenv("DBUS_TEST_NETPLAN_CMD") != 0) { data/netplan.io-0.99/src/dbus.c:31:18: [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. argv[0] = getenv("DBUS_TEST_NETPLAN_CMD"); data/netplan.io-0.99/src/generate.c:280:19: [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). FILE* f = fopen(generator_run_stamp, "w"); data/netplan.io-0.99/src/nm.c:439: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 uuidstr[37]; data/netplan.io-0.99/src/networkd.c:185:18: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). orig_umask = umask(022); data/netplan.io-0.99/src/networkd.c:187:5: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(orig_umask); data/netplan.io-0.99/src/networkd.c:356:18: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). orig_umask = umask(022); data/netplan.io-0.99/src/networkd.c:358:5: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(orig_umask); data/netplan.io-0.99/src/networkd.c:669:22: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). orig_umask = umask(022); data/netplan.io-0.99/src/networkd.c:671:9: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(orig_umask); data/netplan.io-0.99/src/networkd.c:714:18: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). orig_umask = umask(022); data/netplan.io-0.99/src/networkd.c:716:5: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(orig_umask); data/netplan.io-0.99/src/networkd.c:765:26: [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_t len = strlen(auth->password); data/netplan.io-0.99/src/networkd.c:921:18: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). orig_umask = umask(077); data/netplan.io-0.99/src/networkd.c:923:5: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(orig_umask); data/netplan.io-0.99/src/nm.c:726:18: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). orig_umask = umask(077); data/netplan.io-0.99/src/nm.c:728:5: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(orig_umask); ANALYSIS SUMMARY: Hits = 17 Lines analyzed = 5463 in approximately 0.17 seconds (31283 lines/second) Physical Source Lines of Code (SLOC) = 3912 Hits@level = [0] 5 [1] 13 [2] 2 [3] 2 [4] 0 [5] 0 Hits@level+ = [0+] 22 [1+] 17 [2+] 4 [3+] 2 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 5.62372 [1+] 4.3456 [2+] 1.02249 [3+] 0.511247 [4+] 0 [5+] 0 Dot directories skipped = 2 (--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.