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/libpam-script-1.1.9/pam_script.c FINAL RESULTS: data/libpam-script-1.1.9/pam_script.c:89:2: [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, format, args); data/libpam-script-1.1.9/pam_script.c:97: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 buffer[BUFSIZE], data/libpam-script-1.1.9/pam_script.c:191: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 cmd[BUFSIZE] = { '\0' }; data/libpam-script-1.1.9/pam_script.c:275:20: [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. newargv[1+i] = (char *) argv[i]; data/libpam-script-1.1.9/pam_script.c:445:9: [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 new_pass1[BUFSIZE]; data/libpam-script-1.1.9/pam_script.c:446:9: [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 new_pass2[BUFSIZE]; data/libpam-script-1.1.9/pam_script.c:221:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(cmd, PAM_SCRIPT_DIR, BUFSIZE - 1); data/libpam-script-1.1.9/pam_script.c:226:19: [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 curlen = strlen(cmd); data/libpam-script-1.1.9/pam_script.c:238:2: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat(cmd,"/"); data/libpam-script-1.1.9/pam_script.c:240:6: [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(script) > (BUFSIZE - strlen(cmd) - 1)) { data/libpam-script-1.1.9/pam_script.c:240:34: [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(script) > (BUFSIZE - strlen(cmd) - 1)) { data/libpam-script-1.1.9/pam_script.c:244:2: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(cmd,script,BUFSIZE-strlen(cmd)-1); data/libpam-script-1.1.9/pam_script.c:244:29: [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). strncat(cmd,script,BUFSIZE-strlen(cmd)-1); ANALYSIS SUMMARY: Hits = 13 Lines analyzed = 553 in approximately 0.04 seconds (15640 lines/second) Physical Source Lines of Code (SLOC) = 374 Hits@level = [0] 4 [1] 7 [2] 5 [3] 0 [4] 1 [5] 0 Hits@level+ = [0+] 17 [1+] 13 [2+] 6 [3+] 1 [4+] 1 [5+] 0 Hits/KSLOC@level+ = [0+] 45.4545 [1+] 34.7594 [2+] 16.0428 [3+] 2.6738 [4+] 2.6738 [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.