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/quicktun-2.2.6/src/tweetnacl.h Examining data/quicktun-2.2.6/src/common.c Examining data/quicktun-2.2.6/src/proto.nacl0.c Examining data/quicktun-2.2.6/src/proto.salty.c Examining data/quicktun-2.2.6/src/run.combined.c Examining data/quicktun-2.2.6/src/proto.nacltai.c Examining data/quicktun-2.2.6/src/tweetnacl.c Examining data/quicktun-2.2.6/src/keypair.c Examining data/quicktun-2.2.6/src/randombytes.c Examining data/quicktun-2.2.6/src/proto.raw.c FINAL RESULTS: data/quicktun-2.2.6/src/common.c:232:39: [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). if ((envval = getconf("INTERFACE"))) strcpy(ifr.ifr_name, envval); data/quicktun-2.2.6/src/common.c:263:43: [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. if ((envval = getconf("TUN_UP_SCRIPT"))) system(envval); data/quicktun-2.2.6/src/run.combined.c:41:2: [4] (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). strcat(tmp, name); data/quicktun-2.2.6/src/common.c:100: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. char* (*getconf)(const char*) = getenv; data/quicktun-2.2.6/src/common.c:293:7: [3] (misc) chroot: chroot can be very helpful, but is hard to use correctly (CWE-250, CWE-22). Make sure the program immediately chdir("/"), closes file descriptors, and drops root privileges, and that all necessary files (and no more!) are in the new root. if (chroot(envval)) return errorexitp("chroot"); data/quicktun-2.2.6/src/run.combined.c:36:45: [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 (strcmp(name, "INTERFACE") == 0) return getenv("IFACE"); data/quicktun-2.2.6/src/run.combined.c:42: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. return getenv(tmp); data/quicktun-2.2.6/src/run.combined.c:51: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. getconf = getenv; data/quicktun-2.2.6/src/common.c:192:16: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. if (ai_local) memcpy(&udpaddr, ai_local->ai_addr, ai_local->ai_addrlen); data/quicktun-2.2.6/src/common.c:194:47: [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). if ((envval = getconf("LOCAL_PORT"))) port = atoi(envval); data/quicktun-2.2.6/src/common.c:199:17: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. if (ai_remote) memcpy(&udpaddr, ai_remote->ai_addr, ai_remote->ai_addrlen); data/quicktun-2.2.6/src/common.c:205:49: [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). if ((envval = getconf("REMOTE_PORT"))) port = atoi(envval); data/quicktun-2.2.6/src/common.c:225:48: [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). if ((envval = getconf("TUN_MODE"))) tunmode = atoi(envval); data/quicktun-2.2.6/src/common.c:227:65: [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). if (tunmode && (envval = getconf("USE_PI"))) session->use_pi = atoi(envval); data/quicktun-2.2.6/src/common.c:231: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). if ((ttfd = open("/dev/net/tun", O_RDWR)) < 0) return errorexitp("Could not open tun/tap device file"); data/quicktun-2.2.6/src/common.c:238: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). if ((ttfd = open("/dev/tun", O_RDWR)) < 0) return errorexitp("Could not open tun device file"); data/quicktun-2.2.6/src/common.c:239:15: [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). if ((ip_fd = open("/dev/ip", O_RDWR, 0)) < 0) return errorexitp("Could not open /dev/ip"); data/quicktun-2.2.6/src/common.c:242:9: [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). ppa = atoi(envval); data/quicktun-2.2.6/src/common.c:245:15: [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). if ((if_fd = open("/dev/tun", O_RDWR, 0)) < 0) return errorexitp("Could not open tun device file again"); data/quicktun-2.2.6/src/common.c:251: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). if ((ttfd = open(envval, O_RDWR)) < 0) return errorexitp("Could not open tun device file"); data/quicktun-2.2.6/src/common.c:329: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 protocol_data[p->protocol_data_size]; data/quicktun-2.2.6/src/common.c:347: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_raw_a[p->buffersize_raw + pi_length]; data/quicktun-2.2.6/src/common.c:348: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_enc_a[p->buffersize_enc]; data/quicktun-2.2.6/src/common.c:391:6: [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 epname[INET6_ADDRSTRLEN + 1 + 2 + 1 + 5]; //addr%scope:port data/quicktun-2.2.6/src/keypair.c:35: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 cpublickey[crypto_box_curve25519xsalsa20poly1305_PUBLICKEYBYTES]; data/quicktun-2.2.6/src/keypair.c:36: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 csecretkey[crypto_box_curve25519xsalsa20poly1305_SECRETKEYBYTES]; data/quicktun-2.2.6/src/proto.nacl0.c:30: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 cnonce[crypto_box_curve25519xsalsa20poly1305_NONCEBYTES], cbefore[crypto_box_curve25519xsalsa20poly1305_BEFORENMBYTES]; data/quicktun-2.2.6/src/proto.nacl0.c:60: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 cpublickey[crypto_box_curve25519xsalsa20poly1305_PUBLICKEYBYTES], csecretkey[crypto_box_curve25519xsalsa20poly1305_SECRETKEYBYTES]; data/quicktun-2.2.6/src/proto.nacl0.c:68: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). FILE* pkfile = fopen(envval, "rb"); data/quicktun-2.2.6/src/proto.nacl0.c: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 pktextbuf[crypto_box_curve25519xsalsa20poly1305_SECRETKEYBYTES * 2]; data/quicktun-2.2.6/src/proto.nacl0.c:73:4: [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(csecretkey, pktextbuf, crypto_box_curve25519xsalsa20poly1305_SECRETKEYBYTES); data/quicktun-2.2.6/src/proto.nacltai.c:33: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 buffer[16]; data/quicktun-2.2.6/src/proto.nacltai.c:37: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 cenonce[crypto_box_curve25519xsalsa20poly1305_NONCEBYTES]; data/quicktun-2.2.6/src/proto.nacltai.c:38: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 cdnonce[crypto_box_curve25519xsalsa20poly1305_NONCEBYTES]; data/quicktun-2.2.6/src/proto.nacltai.c:39: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 cbefore[crypto_box_curve25519xsalsa20poly1305_BEFORENMBYTES]; data/quicktun-2.2.6/src/proto.nacltai.c:76: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((void*)(enc + crypto_box_curve25519xsalsa20poly1305_BOXZEROBYTES - noncelength), d->cenonce + nonceoffset, noncelength); data/quicktun-2.2.6/src/proto.nacltai.c:105: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(d->cdnonce + nonceoffset, enc, noncelength); data/quicktun-2.2.6/src/proto.nacltai.c:111: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(taiold, d->cdnonce + nonceoffset, 16); data/quicktun-2.2.6/src/proto.nacltai.c:120: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 cownpublickey[crypto_box_curve25519xsalsa20poly1305_PUBLICKEYBYTES], cpublickey[crypto_box_curve25519xsalsa20poly1305_PUBLICKEYBYTES], csecretkey[crypto_box_curve25519xsalsa20poly1305_SECRETKEYBYTES]; data/quicktun-2.2.6/src/proto.nacltai.c:128: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). FILE* pkfile = fopen(envval, "rb"); data/quicktun-2.2.6/src/proto.nacltai.c:130: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 pktextbuf[crypto_box_curve25519xsalsa20poly1305_SECRETKEYBYTES * 2]; data/quicktun-2.2.6/src/proto.nacltai.c:133:4: [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(csecretkey, pktextbuf, crypto_box_curve25519xsalsa20poly1305_SECRETKEYBYTES); data/quicktun-2.2.6/src/proto.nacltai.c:154:48: [2] (integer) atol: 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). taia_now_packed((unsigned char*)&tailog[0], -atol(envval)); data/quicktun-2.2.6/src/proto.nacltai.c:160:41: [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). if ((envval = getconf("ROLE"))) role = atoi(envval) ? 1 : -1; data/quicktun-2.2.6/src/proto.raw.c:29: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(enc, raw, len); data/quicktun-2.2.6/src/proto.raw.c:34: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(raw, enc, len); data/quicktun-2.2.6/src/proto.salty.c:134: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 remotekey[PUBLICKEYBYTES]; data/quicktun-2.2.6/src/proto.salty.c:135: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 nonce[NONCEBYTES]; data/quicktun-2.2.6/src/proto.salty.c:136: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 sharedkey[BEFORENMBYTES]; data/quicktun-2.2.6/src/proto.salty.c:140: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 privatekey[PRIVATEKEYBYTES]; data/quicktun-2.2.6/src/proto.salty.c:141: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 publickey[PUBLICKEYBYTES]; data/quicktun-2.2.6/src/proto.salty.c:142: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 sharedkey[BEFORENMBYTES]; data/quicktun-2.2.6/src/proto.salty.c:143: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 nonce[NONCEBYTES]; data/quicktun-2.2.6/src/proto.salty.c:147: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 controlkey[BEFORENMBYTES]; data/quicktun-2.2.6/src/proto.salty.c:156: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 dataremotekey[PUBLICKEYBYTES]; data/quicktun-2.2.6/src/proto.salty.c:157: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 dataremotenonce[NONCEBYTES]; data/quicktun-2.2.6/src/proto.salty.c:195:41: [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). if (devurandomfd == -1) devurandomfd = open("/dev/urandom", O_RDONLY); data/quicktun-2.2.6/src/proto.salty.c:207: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(d->remotekey, rkey, PUBLICKEYBYTES); data/quicktun-2.2.6/src/proto.salty.c:208: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(d->nonce, nonce, NONCEBYTES); data/quicktun-2.2.6/src/proto.salty.c:220: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 buffer[32 + (1 + 32 + 24 + 32 + 24 + 8)]; data/quicktun-2.2.6/src/proto.salty.c:224: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(buffer + 32 + 1, d->datalocalkeys[keyid].publickey, 32); data/quicktun-2.2.6/src/proto.salty.c:225: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(buffer + 32 + 1 + 32, d->datalocalkeys[keyid].nonce, 24); data/quicktun-2.2.6/src/proto.salty.c:226: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(buffer + 32 + 1 + 32 + 24, d->dataremotekey, 32); data/quicktun-2.2.6/src/proto.salty.c:227: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(buffer + 32 + 1 + 32 + 24 + 32, d->dataremotenonce, 24); data/quicktun-2.2.6/src/proto.salty.c:231: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 nonce[24]; data/quicktun-2.2.6/src/proto.salty.c:235: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 encbuffer[32 + 1 + 32 + 24 + 32 + 24 + 8]; data/quicktun-2.2.6/src/proto.salty.c:237: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(encbuffer + 16 - 8, nonce + 16, 8); data/quicktun-2.2.6/src/proto.salty.c:274: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 cpublickey[PUBLICKEYBYTES], csecretkey[PRIVATEKEYBYTES]; data/quicktun-2.2.6/src/proto.salty.c:282: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). FILE* pkfile = fopen(envval, "rb"); data/quicktun-2.2.6/src/proto.salty.c:284: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 pktextbuf[PRIVATEKEYBYTES * 2]; data/quicktun-2.2.6/src/proto.salty.c:287:4: [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(csecretkey, pktextbuf, PRIVATEKEYBYTES); data/quicktun-2.2.6/src/proto.salty.c:299: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 cownpublickey[PUBLICKEYBYTES]; data/quicktun-2.2.6/src/proto.salty.c:406: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 cnonce[NONCEBYTES]; data/quicktun-2.2.6/src/proto.salty.c:409: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(cnonce + 16, enc + 13, 8); data/quicktun-2.2.6/src/proto.salty.c:422: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(d->dataremotekey, raw + 32 + 1, 32); data/quicktun-2.2.6/src/proto.salty.c:423: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(d->dataremotenonce, raw + 32 + 1 + 32, 24); data/quicktun-2.2.6/src/randombytes.c:19:12: [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). fd = open("/dev/urandom",O_RDONLY); data/quicktun-2.2.6/src/run.combined.c:35: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 tmp[1024] = "IF_QT_"; data/quicktun-2.2.6/src/common.c:152: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). int i = strlen(str); data/quicktun-2.2.6/src/common.c:156: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). int i = strlen(str); data/quicktun-2.2.6/src/common.c:159:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(str, "Unknown AF", strbuflen); data/quicktun-2.2.6/src/common.c:359:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). len = read(ttfd, buffer_raw + p->offset_raw, p->buffersize_raw + pi_length); data/quicktun-2.2.6/src/common.c:378:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). len = read(sfd, buffer_enc + p->offset_enc, p->buffersize_enc); data/quicktun-2.2.6/src/proto.nacl0.c:62: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(envval) != 2*crypto_box_curve25519xsalsa20poly1305_PUBLICKEYBYTES) return errorexit("PUBLIC_KEY length"); data/quicktun-2.2.6/src/proto.nacl0.c:65:7: [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(envval) != 2*crypto_box_curve25519xsalsa20poly1305_PUBLICKEYBYTES) return errorexit("PRIVATE_KEY length"); data/quicktun-2.2.6/src/proto.nacltai.c:122: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(envval) != 2*crypto_box_curve25519xsalsa20poly1305_PUBLICKEYBYTES) return errorexit("PUBLIC_KEY length"); data/quicktun-2.2.6/src/proto.nacltai.c:125:7: [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(envval) != 2*crypto_box_curve25519xsalsa20poly1305_PUBLICKEYBYTES) return errorexit("PRIVATE_KEY length"); data/quicktun-2.2.6/src/proto.salty.c:198:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int got = read(devurandomfd, buffer, len); data/quicktun-2.2.6/src/proto.salty.c:276: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(envval) != 2*PUBLICKEYBYTES) return errorexit("PUBLIC_KEY length"); data/quicktun-2.2.6/src/proto.salty.c:279:7: [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(envval) != 2 * PUBLICKEYBYTES) return errorexit("PRIVATE_KEY length"); data/quicktun-2.2.6/src/randombytes.c:28:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). i = read(fd,x,i); data/quicktun-2.2.6/src/run.combined.c:37: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(tmp) + strlen(name) >= 1024) { data/quicktun-2.2.6/src/run.combined.c:37: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). if (strlen(tmp) + strlen(name) >= 1024) { ANALYSIS SUMMARY: Hits = 93 Lines analyzed = 2568 in approximately 0.12 seconds (20975 lines/second) Physical Source Lines of Code (SLOC) = 2098 Hits@level = [0] 68 [1] 15 [2] 70 [3] 5 [4] 3 [5] 0 Hits@level+ = [0+] 161 [1+] 93 [2+] 78 [3+] 8 [4+] 3 [5+] 0 Hits/KSLOC@level+ = [0+] 76.7398 [1+] 44.3279 [2+] 37.1783 [3+] 3.81316 [4+] 1.42993 [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.