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/backdoor-factory-3.4.2+dfsg/osslsigncode/osslsigncode.c FINAL RESULTS: data/backdoor-factory-3.4.2+dfsg/osslsigncode/osslsigncode.c:868:27: [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. #define DO_EXIT_1(x, y) { fprintf(stderr, x, y); goto err_cleanup; } data/backdoor-factory-3.4.2+dfsg/osslsigncode/osslsigncode.c:869:30: [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. #define DO_EXIT_2(x, y, z) { fprintf(stderr, x, y, z); goto err_cleanup; } data/backdoor-factory-3.4.2+dfsg/osslsigncode/osslsigncode.c:2382:9: [4] (misc) getpass: This function is obsolete and not portable. It was in SUSv2 but removed by POSIX.2. What it does exactly varies considerably between systems, particularly in where its prompt is displayed and where it gets its data (e.g., /dev/tty, stdin, stderr, etc.). In addition, some implementations overflow buffers. (CWE-676, CWE-120, CWE-20). Make the specific calls to do exactly what you want. If you continue to use it, or write your own, be sure to zero the password as soon as possible to avoid leaving the cleartext password visible in the process' address space. return getpass(prompt); data/backdoor-factory-3.4.2+dfsg/osslsigncode/osslsigncode.c:2583:4: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf(PACKAGE_STRING ", using:\n\t%s\n\t%s\n", data/backdoor-factory-3.4.2+dfsg/osslsigncode/osslsigncode.c:2591:4: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf( data/backdoor-factory-3.4.2+dfsg/osslsigncode/osslsigncode.c:3417:3: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf(ret ? "Failed\n" : "Succeeded\n"); data/backdoor-factory-3.4.2+dfsg/osslsigncode/osslsigncode.c:479:3: [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((char*)b+i*2, "%02X", v[i]); data/backdoor-factory-3.4.2+dfsg/osslsigncode/osslsigncode.c:494:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(p, prefix, sizeof(prefix)); data/backdoor-factory-3.4.2+dfsg/osslsigncode/osslsigncode.c:495:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(p+len-sizeof(postfix), postfix, sizeof(postfix)); data/backdoor-factory-3.4.2+dfsg/osslsigncode/osslsigncode.c:611:12: [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. unsigned char mdbuf[EVP_MAX_MD_SIZE]; data/backdoor-factory-3.4.2+dfsg/osslsigncode/osslsigncode.c:1116: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 buf[4]; data/backdoor-factory-3.4.2+dfsg/osslsigncode/osslsigncode.c:1185:11: [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. unsigned char mdbuf[EVP_MAX_MD_SIZE]; data/backdoor-factory-3.4.2+dfsg/osslsigncode/osslsigncode.c:1186:11: [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. unsigned char cmdbuf[EVP_MAX_MD_SIZE]; data/backdoor-factory-3.4.2+dfsg/osslsigncode/osslsigncode.c:1536:11: [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. unsigned char mdbuf[EVP_MAX_MD_SIZE]; data/backdoor-factory-3.4.2+dfsg/osslsigncode/osslsigncode.c:1537:11: [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. unsigned char cmdbuf[EVP_MAX_MD_SIZE]; data/backdoor-factory-3.4.2+dfsg/osslsigncode/osslsigncode.c:1539:11: [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. unsigned char cexmdbuf[EVP_MAX_MD_SIZE]; data/backdoor-factory-3.4.2+dfsg/osslsigncode/osslsigncode.c:1541:11: [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. unsigned char hexbuf[EVP_MAX_MD_SIZE*2+1]; data/backdoor-factory-3.4.2+dfsg/osslsigncode/osslsigncode.c:1552:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(mdbuf, idc->messageDigest->digest->data, idc->messageDigest->digest->length); data/backdoor-factory-3.4.2+dfsg/osslsigncode/osslsigncode.c:1821:11: [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. unsigned char hexbuf[EVP_MAX_MD_SIZE*2+1]; data/backdoor-factory-3.4.2+dfsg/osslsigncode/osslsigncode.c:1925:18: [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. static unsigned char bfb[16*1024*1024]; data/backdoor-factory-3.4.2+dfsg/osslsigncode/osslsigncode.c:1987: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 buf[128]; data/backdoor-factory-3.4.2+dfsg/osslsigncode/osslsigncode.c:2007:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(*ph, obj->value->value.sequence->data + l, *phlen); data/backdoor-factory-3.4.2+dfsg/osslsigncode/osslsigncode.c:2069:11: [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. unsigned char mdbuf[EVP_MAX_MD_SIZE]; data/backdoor-factory-3.4.2+dfsg/osslsigncode/osslsigncode.c:2070:11: [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. unsigned char cmdbuf[EVP_MAX_MD_SIZE]; data/backdoor-factory-3.4.2+dfsg/osslsigncode/osslsigncode.c:2071:11: [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. unsigned char hexbuf[EVP_MAX_MD_SIZE*2+1]; data/backdoor-factory-3.4.2+dfsg/osslsigncode/osslsigncode.c:2087:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(mdbuf, idc->messageDigest->digest->data, idc->messageDigest->digest->length); data/backdoor-factory-3.4.2+dfsg/osslsigncode/osslsigncode.c:2338:11: [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(infile, O_RDONLY); data/backdoor-factory-3.4.2+dfsg/osslsigncode/osslsigncode.c:2353: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 *p, passbuf[1024]; data/backdoor-factory-3.4.2+dfsg/osslsigncode/osslsigncode.c:2400: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. static char buf[64*1024]; data/backdoor-factory-3.4.2+dfsg/osslsigncode/osslsigncode.c:2408: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 *turl[MAX_TS_SERVERS], *proxy = NULL, *tsurl[MAX_TS_SERVERS]; data/backdoor-factory-3.4.2+dfsg/osslsigncode/osslsigncode.c:2649: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 passbuf[4096]; data/backdoor-factory-3.4.2+dfsg/osslsigncode/osslsigncode.c:2650:16: [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 passfd = open(readpass, O_RDONLY); data/backdoor-factory-3.4.2+dfsg/osslsigncode/osslsigncode.c:2669:13: [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. unsigned char magic[4]; data/backdoor-factory-3.4.2+dfsg/osslsigncode/osslsigncode.c:2670:13: [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. unsigned char pvkhdr[4] = { 0x1e, 0xf1, 0xb5, 0xb0 }; data/backdoor-factory-3.4.2+dfsg/osslsigncode/osslsigncode.c:2988:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buf+4, indata+20, 14); data/backdoor-factory-3.4.2+dfsg/osslsigncode/osslsigncode.c:2994:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(cabsigned+8, buf, 4); data/backdoor-factory-3.4.2+dfsg/osslsigncode/osslsigncode.c:3248:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buf, p, len); data/backdoor-factory-3.4.2+dfsg/osslsigncode/osslsigncode.c:3250:11: [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. unsigned char mdbuf[EVP_MAX_MD_SIZE]; data/backdoor-factory-3.4.2+dfsg/osslsigncode/osslsigncode.c:3252:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buf+len, mdbuf, mdlen); data/backdoor-factory-3.4.2+dfsg/osslsigncode/osslsigncode.c:455:35: [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). (const unsigned char*)desc, strlen(desc)); data/backdoor-factory-3.4.2+dfsg/osslsigncode/osslsigncode.c:463: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). (const unsigned char*)url, strlen(url)); data/backdoor-factory-3.4.2+dfsg/osslsigncode/osslsigncode.c:1172:25: [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). unsigned long actual = strlen(hash); data/backdoor-factory-3.4.2+dfsg/osslsigncode/osslsigncode.c:2377:10: [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). passbuf[strlen(passbuf)-1] = 0x00; data/backdoor-factory-3.4.2+dfsg/osslsigncode/osslsigncode.c:2522:21: [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). memset(*argv, 0, strlen(*argv)); data/backdoor-factory-3.4.2+dfsg/osslsigncode/osslsigncode.c:2653:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int passlen = read(passfd, passbuf, sizeof(passbuf)-1); data/backdoor-factory-3.4.2+dfsg/osslsigncode/osslsigncode.c:2770:21: [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). memset (pass, 0, strlen(pass)); data/backdoor-factory-3.4.2+dfsg/osslsigncode/osslsigncode.c:3424:20: [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). memset (pass, 0, strlen(pass)); ANALYSIS SUMMARY: Hits = 47 Lines analyzed = 3457 in approximately 0.11 seconds (31380 lines/second) Physical Source Lines of Code (SLOC) = 2703 Hits@level = [0] 75 [1] 8 [2] 33 [3] 0 [4] 6 [5] 0 Hits@level+ = [0+] 122 [1+] 47 [2+] 39 [3+] 6 [4+] 6 [5+] 0 Hits/KSLOC@level+ = [0+] 45.135 [1+] 17.3881 [2+] 14.4284 [3+] 2.21976 [4+] 2.21976 [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.