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/ssh-agent-filter-0.5.2/rfc4251.C Examining data/ssh-agent-filter-0.5.2/rfc4251.H Examining data/ssh-agent-filter-0.5.2/rfc4251_gmp.C Examining data/ssh-agent-filter-0.5.2/ssh-agent-filter.C Examining data/ssh-agent-filter-0.5.2/ssh-agent.h Examining data/ssh-agent-filter-0.5.2/version.h FINAL RESULTS: data/ssh-agent-filter-0.5.2/ssh-agent-filter.C:153:2: [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(addr.sun_path, path); data/ssh-agent-filter-0.5.2/ssh-agent-filter.C:180:2: [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(addr.sun_path, path.c_str()); data/ssh-agent-filter-0.5.2/ssh-agent-filter.C:320:3: [4] (shell) execvp: 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. execvp(sap, const_cast<char * const *>(args)); data/ssh-agent-filter-0.5.2/ssh-agent-filter.C:138:15: [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 (!(path = getenv("SSH_AUTH_SOCK"))) data/ssh-agent-filter-0.5.2/ssh-agent-filter.C:307:14: [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 (!(sap = getenv("SSH_ASKPASS"))) data/ssh-agent-filter-0.5.2/rfc4251.H:45: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 buf[1]; data/ssh-agent-filter-0.5.2/rfc4251.H:70: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 buf[1]; data/ssh-agent-filter-0.5.2/rfc4251.H:95: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 buf[4]; data/ssh-agent-filter-0.5.2/rfc4251.H:120: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 buf[8]; data/ssh-agent-filter-0.5.2/ssh-agent-filter.C:113: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 hex[BASE16_ENCODE_LENGTH(MD5_DIGEST_SIZE)]; data/ssh-agent-filter-0.5.2/ssh-agent-filter.C:119: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 b64[BASE64_ENCODE_RAW_LENGTH(s.size())]; data/ssh-agent-filter-0.5.2/ssh-agent-filter.C:318: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 const * args[3] = { sap, question.c_str(), nullptr }; data/ssh-agent-filter-0.5.2/ssh-agent-filter.C:611:17: [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 devnull = open("/dev/null", O_RDWR); data/ssh-agent-filter-0.5.2/rfc4251.H:56:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return is.read(x.buf, sizeof(x.buf)); data/ssh-agent-filter-0.5.2/rfc4251.H:81:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return is.read(x.buf, sizeof(x.buf)); data/ssh-agent-filter-0.5.2/rfc4251.H:106:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return is.read(x.buf, sizeof(x.buf)); data/ssh-agent-filter-0.5.2/rfc4251.H:147:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return is.read(x.buf, sizeof(x.buf)); data/ssh-agent-filter-0.5.2/rfc4251.H:189:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). is.read(s.value.data(), len); data/ssh-agent-filter-0.5.2/ssh-agent-filter.C:150: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(path) >= sizeof(addr.sun_path)) data/ssh-agent-filter-0.5.2/ssh-agent-filter.C:342:13: [1] (buffer) equal: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. if (!std::equal(suffix.begin(), suffix.end(), suffix_start)) ANALYSIS SUMMARY: Hits = 20 Lines analyzed = 1040 in approximately 0.35 seconds (3001 lines/second) Physical Source Lines of Code (SLOC) = 761 Hits@level = [0] 0 [1] 7 [2] 8 [3] 2 [4] 3 [5] 0 Hits@level+ = [0+] 20 [1+] 20 [2+] 13 [3+] 5 [4+] 3 [5+] 0 Hits/KSLOC@level+ = [0+] 26.2812 [1+] 26.2812 [2+] 17.0828 [3+] 6.5703 [4+] 3.94218 [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.