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/drac-1.12/testing.c Examining data/drac-1.12/courier-authdrac.c Examining data/drac-1.12/dracauth.c Examining data/drac-1.12/rpc.dracd.c Examining data/drac-1.12/testing6.c Examining data/drac-1.12/version.h FINAL RESULTS: data/drac-1.12/courier-authdrac.c:88:5: [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(argv[1], argv+1); data/drac-1.12/rpc.dracd.c:329: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(akey, inet_ntoa(requ_ip)); data/drac-1.12/courier-authdrac.c:43:71: [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. syslog(LOG_INFO,"drac_update() called: drachost=%s user=%s",drachost,getenv("TCPREMOTEIP")); data/drac-1.12/courier-authdrac.c:46:25: [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 (inet_pton(AF_INET, getenv("TCPREMOTEIP"), &ip4) == 1) { data/drac-1.12/courier-authdrac.c:49: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. " user %s",err,getenv("TCPREMOTEIP")); data/drac-1.12/courier-authdrac.c:50:33: [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. } else if (inet_pton(AF_INET6, getenv("TCPREMOTEIP"), &ip6) == 1) { data/drac-1.12/courier-authdrac.c:59:20: [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. " user %s",err,getenv("TCPREMOTEIP")); data/drac-1.12/courier-authdrac.c:66:32: [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. " user=%s errno=%i",drachost,getenv("TCPREMOTEIP"),errno); data/drac-1.12/courier-authdrac.c:74:7: [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 (getenv("TCPREMOTEIP") == NULL) data/drac-1.12/courier-authdrac.c:77:7: [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 (getenv("AUTHUSER") && getenv("AUTHARGV0") && getenv("AUTHENTICATED")) { data/drac-1.12/courier-authdrac.c:77:29: [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 (getenv("AUTHUSER") && getenv("AUTHARGV0") && getenv("AUTHENTICATED")) { data/drac-1.12/courier-authdrac.c:77:52: [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 (getenv("AUTHUSER") && getenv("AUTHARGV0") && getenv("AUTHENTICATED")) { data/drac-1.12/courier-authdrac.c:79:9: [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 (getenv("DRACHOST")) { data/drac-1.12/courier-authdrac.c:80:26: [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. drac_update_host(getenv("DRACHOST")); data/drac-1.12/rpc.dracd.c:79:17: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((c = getopt(argc, argv, "ie:")) != EOF) { data/drac-1.12/dracauth.c:140:25: [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 *server; unsigned char userip6[16]; char **errmsg; { data/drac-1.12/dracauth.c:205: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 userip6[16]; char **errmsg; { data/drac-1.12/rpc.dracd.c:85:17: [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). explimit = atoi(optarg) * 60; data/drac-1.12/rpc.dracd.c:115:14: [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). debugf = fopen("/var/tmp/drac.debug", "a+"); data/drac-1.12/rpc.dracd.c:162:18: [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). errno = dbp->open(dbp, NULL, dbfile, NULL, DB_HASH, data/drac-1.12/rpc.dracd.c:166:18: [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). errno = dbp->open(dbp, NULL, dbfile, NULL, DB_BTREE, data/drac-1.12/rpc.dracd.c:178:18: [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). errno = dbp->open(dbp, dbfile, NULL, DB_HASH, data/drac-1.12/rpc.dracd.c:182:18: [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). errno = dbp->open(dbp, dbfile, NULL, DB_BTREE, data/drac-1.12/rpc.dracd.c:210: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(&readfs, &svc_fdset, sizeof(fd_set)); data/drac-1.12/rpc.dracd.c:264: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 akey[32], alimit[32]; data/drac-1.12/rpc.dracd.c:331:2: [2] (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 string. strcat(akey, "/32"); data/drac-1.12/rpc.dracd.c:339:2: [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(alimit, "%lu", time((time_t *)NULL) + explimit); data/drac-1.12/rpc.dracd.c:387: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[INET6_ADDRSTRLEN]; data/drac-1.12/rpc.dracd.c:399: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 akey[INET6_ADDRSTRLEN+4], alimit[32]; data/drac-1.12/rpc.dracd.c:453:2: [2] (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 string. strcat(akey, "/128"); data/drac-1.12/rpc.dracd.c:461:2: [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(alimit, "%lu", time((time_t *)NULL) + explimit); data/drac-1.12/rpc.dracd.c:507: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 alimit[32]; data/drac-1.12/rpc.dracd.c:541: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(alimit, data.data, data.size); data/drac-1.12/rpc.dracd.c:613: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], mask[32], addr[32], hname[128]; data/drac-1.12/rpc.dracd.c:619:18: [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 ( (alfp = fopen(alfile, "r")) != NULL ) { data/drac-1.12/testing6.c:16: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 ip6[16]; data/drac-1.12/rpc.dracd.c:335: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). key.size = strlen(akey) + 1; data/drac-1.12/rpc.dracd.c:337: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). key.size = strlen(akey); data/drac-1.12/rpc.dracd.c:342: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). data.size = strlen(alimit) + 1; data/drac-1.12/rpc.dracd.c:344: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). data.size = strlen(alimit); data/drac-1.12/rpc.dracd.c:457: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). key.size = strlen(akey) + 1; data/drac-1.12/rpc.dracd.c:459: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). key.size = strlen(akey); data/drac-1.12/rpc.dracd.c:464: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). data.size = strlen(alimit) + 1; data/drac-1.12/rpc.dracd.c:466: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). data.size = strlen(alimit); ANALYSIS SUMMARY: Hits = 44 Lines analyzed = 1077 in approximately 0.09 seconds (12126 lines/second) Physical Source Lines of Code (SLOC) = 892 Hits@level = [0] 35 [1] 8 [2] 21 [3] 13 [4] 2 [5] 0 Hits@level+ = [0+] 79 [1+] 44 [2+] 36 [3+] 15 [4+] 2 [5+] 0 Hits/KSLOC@level+ = [0+] 88.565 [1+] 49.3274 [2+] 40.3587 [3+] 16.8161 [4+] 2.24215 [5+] 0 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.