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/ukui-biometric-auth-1.2.1/bioauth-bin/src/keywatcher.cpp Examining data/ukui-biometric-auth-1.2.1/bioauth-bin/src/keywatcher.h Examining data/ukui-biometric-auth-1.2.1/bioauth-bin/src/main.cpp Examining data/ukui-biometric-auth-1.2.1/pam-biometric/logger.c Examining data/ukui-biometric-auth-1.2.1/pam-biometric/biotest.c Examining data/ukui-biometric-auth-1.2.1/pam-biometric/pam_biometric.c Examining data/ukui-biometric-auth-1.2.1/polkit-agent/src/mainwindow.h Examining data/ukui-biometric-auth-1.2.1/polkit-agent/src/PolkitListener.cpp Examining data/ukui-biometric-auth-1.2.1/polkit-agent/src/sessionmanager.h Examining data/ukui-biometric-auth-1.2.1/polkit-agent/src/PolkitAgent.cpp Examining data/ukui-biometric-auth-1.2.1/polkit-agent/src/mainwindow.cpp Examining data/ukui-biometric-auth-1.2.1/polkit-agent/src/PolkitListener.h Examining data/ukui-biometric-auth-1.2.1/polkit-agent/src/sessionmanager.cpp Examining data/ukui-biometric-auth-1.2.1/bioauth/src/bioauth.cpp Examining data/ukui-biometric-auth-1.2.1/bioauth/src/biotypes.cpp Examining data/ukui-biometric-auth-1.2.1/bioauth/src/biodevices.cpp Examining data/ukui-biometric-auth-1.2.1/bioauth/src/bioauthwidget.cpp Examining data/ukui-biometric-auth-1.2.1/bioauth/src/biodeviceswidget.cpp Examining data/ukui-biometric-auth-1.2.1/bioauth/include/bioauth.h Examining data/ukui-biometric-auth-1.2.1/bioauth/include/biodeviceswidget.h Examining data/ukui-biometric-auth-1.2.1/bioauth/include/biotypes.h Examining data/ukui-biometric-auth-1.2.1/bioauth/include/bioauthwidget.h Examining data/ukui-biometric-auth-1.2.1/bioauth/include/biodevices.h Examining data/ukui-biometric-auth-1.2.1/bioauth/include/biometric.h Examining data/ukui-biometric-auth-1.2.1/common/generic.h Examining data/ukui-biometric-auth-1.2.1/common/generic.cpp FINAL RESULTS: data/ukui-biometric-auth-1.2.1/bioauth-bin/src/main.cpp:74:9: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stdout, START_COLOR "=== %s ===\n", text); data/ukui-biometric-auth-1.2.1/bioauth-bin/src/main.cpp:77:9: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stdout, PROMPT_COLOR "%s\n", text); data/ukui-biometric-auth-1.2.1/bioauth-bin/src/main.cpp:80:9: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stdout, NOTIFY_COLOR "%s\n", text); data/ukui-biometric-auth-1.2.1/bioauth-bin/src/main.cpp:83:9: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stdout, QUESTION_COLOR "%s", text); data/ukui-biometric-auth-1.2.1/bioauth-bin/src/main.cpp:86:9: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stdout, RESULT_COLOR "=== %s ===\n", text); data/ukui-biometric-auth-1.2.1/bioauth-bin/src/main.cpp:92:5: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stdout, RESET_COLOR); data/ukui-biometric-auth-1.2.1/bioauth-bin/src/main.cpp:199:31: [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. QString locale = QLocale::system().name(); data/ukui-biometric-auth-1.2.1/pam-biometric/logger.c:44: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/ukui-biometric-auth-1.2.1/pam-biometric/pam_biometric.c:54:16: [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. int ret = system("/bin/chmod -f a+wr /tmp/bio.log"); data/ukui-biometric-auth-1.2.1/pam-biometric/pam_biometric.c:103:13: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(resp, response->resp); data/ukui-biometric-auth-1.2.1/pam-biometric/pam_biometric.c:121:5: [4] (shell) execl: 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. execl(gui, "bioauth", data/ukui-biometric-auth-1.2.1/pam-biometric/pam_biometric.c:268:8: [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(fifo_name, F_OK) == -1) { data/ukui-biometric-auth-1.2.1/pam-biometric/pam_biometric.c:326:14: [4] (shell) popen: 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. stream = popen(cmd, "r"); data/ukui-biometric-auth-1.2.1/pam-biometric/pam_biometric.c:333:14: [4] (shell) popen: 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. stream = popen(cmd1, "r"); data/ukui-biometric-auth-1.2.1/pam-biometric/pam_biometric.c:376:13: [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. i = sscanf(line, "EnableAuth=%s\n", is_enable); data/ukui-biometric-auth-1.2.1/polkit-agent/src/PolkitAgent.cpp:43:31: [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. QString locale = QLocale::system().name(); data/ukui-biometric-auth-1.2.1/pam-biometric/pam_biometric.c:159:19: [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. char *lang = getenv("LANG"); data/ukui-biometric-auth-1.2.1/pam-biometric/pam_biometric.c:215: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. *xdisp=getenv("DISPLAY"); data/ukui-biometric-auth-1.2.1/pam-biometric/pam_biometric.c:216: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. *xauth=getenv("XAUTHORITY"); data/ukui-biometric-auth-1.2.1/pam-biometric/pam_biometric.c:226: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. *xdisp=getenv("DISPLAY"); data/ukui-biometric-auth-1.2.1/pam-biometric/pam_biometric.c:227: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. *xauth=getenv("XAUTHORITY"); data/ukui-biometric-auth-1.2.1/polkit-agent/src/PolkitListener.cpp:68:24: [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. QString username = getenv("USER"); data/ukui-biometric-auth-1.2.1/bioauth-bin/src/main.cpp:116: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 line[1024]; data/ukui-biometric-auth-1.2.1/bioauth-bin/src/main.cpp:161: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 line[1024]; data/ukui-biometric-auth-1.2.1/pam-biometric/logger.c:39: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 timestr[32] = {0}; data/ukui-biometric-auth-1.2.1/pam-biometric/pam_biometric.c:118:14: [2] (misc) open: 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). int fd = open("/dev/null", O_WRONLY); data/ukui-biometric-auth-1.2.1/pam-biometric/pam_biometric.c:275:19: [2] (misc) open: 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). int fifo_rd = open(fifo_name, O_RDONLY); data/ukui-biometric-auth-1.2.1/pam-biometric/pam_biometric.c:279: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 buffer[8] = {0}; data/ukui-biometric-auth-1.2.1/pam-biometric/pam_biometric.c:308: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 resp[96] = {0}; data/ukui-biometric-auth-1.2.1/pam-biometric/pam_biometric.c:336:13: [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). int i = atoi(buf); data/ukui-biometric-auth-1.2.1/pam-biometric/pam_biometric.c:338:9: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "ukui-greeter"); data/ukui-biometric-auth-1.2.1/pam-biometric/pam_biometric.c:346: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 buf[1024]; data/ukui-biometric-auth-1.2.1/pam-biometric/pam_biometric.c:348:17: [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). if( (file = fopen(BIO_COM_FILE, "r")) == NULL) { data/ukui-biometric-auth-1.2.1/pam-biometric/pam_biometric.c:367: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 line[1024], is_enable[16]; data/ukui-biometric-auth-1.2.1/pam-biometric/pam_biometric.c:371:16: [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). if((file = fopen(conf_file, "r")) == NULL){ data/ukui-biometric-auth-1.2.1/pam-biometric/pam_biometric.c:424: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 buf[128]; data/ukui-biometric-auth-1.2.1/polkit-agent/src/PolkitListener.cpp:165: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 buf[128]; data/ukui-biometric-auth-1.2.1/polkit-agent/src/PolkitListener.cpp:168:22: [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). if( (auth_file = fopen("/etc/pam.d/common-auth", "r")) == NULL) data/ukui-biometric-auth-1.2.1/polkit-agent/src/PolkitListener.cpp:240:17: [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). if( (file = fopen(BIO_COM_FILE, "w")) == NULL){ data/ukui-biometric-auth-1.2.1/polkit-agent/src/mainwindow.cpp:89:13: [2] (misc) open: 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). qssFile.open(QIODevice::ReadOnly); data/ukui-biometric-auth-1.2.1/polkit-agent/src/mainwindow.cpp:260:11: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(str,_("Authenticated failed, %d login attempts left"),a); data/ukui-biometric-auth-1.2.1/polkit-agent/src/mainwindow.cpp:263:11: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(str,_("Account locked %d minutes due to %d fail attempts"),a,b); data/ukui-biometric-auth-1.2.1/bioauth-bin/src/keywatcher.cpp:55:22: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if((ch = getchar()) == 'q' || ch == 'Q' || ch == 27){ data/ukui-biometric-auth-1.2.1/bioauth-bin/src/main.cpp:119:13: [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(line[strlen(line) - 1] == '\n') data/ukui-biometric-auth-1.2.1/bioauth-bin/src/main.cpp:120:14: [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). line[strlen(line) - 1] = '\0'; data/ukui-biometric-auth-1.2.1/bioauth-bin/src/main.cpp:164:13: [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(line[strlen(line) - 1] == '\n') data/ukui-biometric-auth-1.2.1/bioauth-bin/src/main.cpp:165:14: [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). line[strlen(line) - 1] = '\0'; data/ukui-biometric-auth-1.2.1/pam-biometric/biotest.c:162:11: [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). password[strlen(password)-1] = '\0'; data/ukui-biometric-auth-1.2.1/pam-biometric/pam_biometric.c:280:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(read(fifo_rd, buffer, 8) == -1) data/ukui-biometric-auth-1.2.1/pam-biometric/pam_biometric.c:329:9: [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). buf[strlen(buf)-1] = '\0'; data/ukui-biometric-auth-1.2.1/pam-biometric/pam_biometric.c:330:8: [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(buf) == 0) { data/ukui-biometric-auth-1.2.1/polkit-agent/src/PolkitListener.cpp:172:12: [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(buf) == 0 || buf[0] == '#') ANALYSIS SUMMARY: Hits = 52 Lines analyzed = 3281 in approximately 0.18 seconds (17951 lines/second) Physical Source Lines of Code (SLOC) = 2227 Hits@level = [0] 27 [1] 10 [2] 20 [3] 6 [4] 16 [5] 0 Hits@level+ = [0+] 79 [1+] 52 [2+] 42 [3+] 22 [4+] 16 [5+] 0 Hits/KSLOC@level+ = [0+] 35.4737 [1+] 23.3498 [2+] 18.8595 [3+] 9.87876 [4+] 7.18455 [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.