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/libnss-unknown-0.0.2/src/nss-unknown.c FINAL RESULTS: data/libnss-unknown-0.0.2/src/nss-unknown.c:55:7: [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 (name, UNKNOWN_FORMAT, &uid) != 1) data/libnss-unknown-0.0.2/src/nss-unknown.c:84:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf (buffer, buflen, UNKNOWN_FORMAT, uid); data/libnss-unknown-0.0.2/src/nss-unknown.c:34:10: [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. home = getenv ("NSS_UNKNOWN_HOME"); data/libnss-unknown-0.0.2/src/nss-unknown.c:37:12: [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. home = getenv ("HOME"); data/libnss-unknown-0.0.2/src/nss-unknown.c:42:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (buffer, home, buflen); data/libnss-unknown-0.0.2/src/nss-unknown.c:58:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (buffer, name, buflen); data/libnss-unknown-0.0.2/src/nss-unknown.c:62:7: [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). n = strlen (name) + 1; data/libnss-unknown-0.0.2/src/nss-unknown.c:88:7: [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). n = strlen (buffer) + 1; ANALYSIS SUMMARY: Hits = 8 Lines analyzed = 100 in approximately 0.01 seconds (8703 lines/second) Physical Source Lines of Code (SLOC) = 70 Hits@level = [0] 0 [1] 4 [2] 0 [3] 2 [4] 2 [5] 0 Hits@level+ = [0+] 8 [1+] 8 [2+] 4 [3+] 4 [4+] 2 [5+] 0 Hits/KSLOC@level+ = [0+] 114.286 [1+] 114.286 [2+] 57.1429 [3+] 57.1429 [4+] 28.5714 [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.