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/tinyproxy-1.10.0/src/base64.h Examining data/tinyproxy-1.10.0/src/basicauth.c Examining data/tinyproxy-1.10.0/src/child.h Examining data/tinyproxy-1.10.0/src/reverse-proxy.c Examining data/tinyproxy-1.10.0/src/transparent-proxy.c Examining data/tinyproxy-1.10.0/src/log.c Examining data/tinyproxy-1.10.0/src/daemon.c Examining data/tinyproxy-1.10.0/src/reqs.c Examining data/tinyproxy-1.10.0/src/base64.c Examining data/tinyproxy-1.10.0/src/stats.h Examining data/tinyproxy-1.10.0/src/upstream.h Examining data/tinyproxy-1.10.0/src/conns.h Examining data/tinyproxy-1.10.0/src/utils.c Examining data/tinyproxy-1.10.0/src/html-error.c Examining data/tinyproxy-1.10.0/src/conns.c Examining data/tinyproxy-1.10.0/src/anonymous.c Examining data/tinyproxy-1.10.0/src/http-message.h Examining data/tinyproxy-1.10.0/src/daemon.h Examining data/tinyproxy-1.10.0/src/heap.c Examining data/tinyproxy-1.10.0/src/hashmap.c Examining data/tinyproxy-1.10.0/src/network.h Examining data/tinyproxy-1.10.0/src/filter.h Examining data/tinyproxy-1.10.0/src/anonymous.h Examining data/tinyproxy-1.10.0/src/acl.h Examining data/tinyproxy-1.10.0/src/http-message.c Examining data/tinyproxy-1.10.0/src/buffer.c Examining data/tinyproxy-1.10.0/src/conf.c Examining data/tinyproxy-1.10.0/src/sock.c Examining data/tinyproxy-1.10.0/src/reqs.h Examining data/tinyproxy-1.10.0/src/connect-ports.h Examining data/tinyproxy-1.10.0/src/sock.h Examining data/tinyproxy-1.10.0/src/connect-ports.c Examining data/tinyproxy-1.10.0/src/common.h Examining data/tinyproxy-1.10.0/src/html-error.h Examining data/tinyproxy-1.10.0/src/vector.h Examining data/tinyproxy-1.10.0/src/conf.h Examining data/tinyproxy-1.10.0/src/basicauth.h Examining data/tinyproxy-1.10.0/src/heap.h Examining data/tinyproxy-1.10.0/src/vector.c Examining data/tinyproxy-1.10.0/src/log.h Examining data/tinyproxy-1.10.0/src/hashmap.h Examining data/tinyproxy-1.10.0/src/text.c Examining data/tinyproxy-1.10.0/src/main.h Examining data/tinyproxy-1.10.0/src/stats.c Examining data/tinyproxy-1.10.0/src/transparent-proxy.h Examining data/tinyproxy-1.10.0/src/reverse-proxy.h Examining data/tinyproxy-1.10.0/src/buffer.h Examining data/tinyproxy-1.10.0/src/upstream.c Examining data/tinyproxy-1.10.0/src/text.h Examining data/tinyproxy-1.10.0/src/utils.h Examining data/tinyproxy-1.10.0/src/acl.c Examining data/tinyproxy-1.10.0/src/network.c Examining data/tinyproxy-1.10.0/src/child.c Examining data/tinyproxy-1.10.0/src/filter.c Examining data/tinyproxy-1.10.0/src/main.c FINAL RESULTS: data/tinyproxy-1.10.0/src/acl.c:49:22: [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. acl_access_t access; data/tinyproxy-1.10.0/src/conf.c:456:34: [4] (format) syslog: If syslog's format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant format string for syslog. conf->syslog = defaults->syslog; data/tinyproxy-1.10.0/src/conf.c:572:17: [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 (stderr, PACKAGE ": You MUST set a Port in the " data/tinyproxy-1.10.0/src/conf.c:778:37: [4] (format) syslog: If syslog's format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant format string for syslog. return set_bool_arg (&conf->syslog, line, &match[2]); data/tinyproxy-1.10.0/src/conf.h:43:22: [4] (format) syslog: If syslog's format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant format string for syslog. unsigned int syslog; /* boolean */ data/tinyproxy-1.10.0/src/log.c:132:20: [4] (format) syslog: If syslog's format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant format string for syslog. if (config.syslog && level == LOG_CONN) data/tinyproxy-1.10.0/src/log.c:150:17: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. vsnprintf (str, STRING_LENGTH, fmt, args); data/tinyproxy-1.10.0/src/log.c:156:17: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (entry_buffer, "%d %s", level, str); data/tinyproxy-1.10.0/src/log.c:164:20: [4] (format) syslog: If syslog's format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant format string for syslog. if(!config.syslog && log_file_fd == -1) data/tinyproxy-1.10.0/src/log.c:167:20: [4] (format) syslog: If syslog's format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant format string for syslog. if (config.syslog) { data/tinyproxy-1.10.0/src/log.c:171:17: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. vsnprintf (str, STRING_LENGTH, fmt, args); data/tinyproxy-1.10.0/src/log.c:191:17: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. vsnprintf (p, STRING_LENGTH - strlen(str) - 1, fmt, args); data/tinyproxy-1.10.0/src/log.c:267:21: [4] (format) syslog: If syslog's format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant format string for syslog. if (!config.syslog) { data/tinyproxy-1.10.0/src/log.c:283:20: [4] (format) syslog: If syslog's format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant format string for syslog. if (config.syslog) { data/tinyproxy-1.10.0/src/log.c:305:20: [4] (format) syslog: If syslog's format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant format string for syslog. if (config.syslog) { data/tinyproxy-1.10.0/src/main.c:298:17: [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 (stderr, PACKAGE ": Could not allocate memory.\n"); data/tinyproxy-1.10.0/src/main.c:370:29: [4] (format) syslog: If syslog's format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant format string for syslog. if (!config.syslog && config.logf_name == NULL) data/tinyproxy-1.10.0/src/network.c:100:21: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. n = vsnprintf (buf, size, fmt, ap); data/tinyproxy-1.10.0/src/reverse-proxy.c:130:25: [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 (rewrite_url, reverse->url); data/tinyproxy-1.10.0/src/reverse-proxy.c:131:25: [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 (rewrite_url, url + strlen (reverse->path)); data/tinyproxy-1.10.0/src/reverse-proxy.c:149:33: [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 (rewrite_url, reverse->url); data/tinyproxy-1.10.0/src/reverse-proxy.c:150:33: [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 (rewrite_url, url + 1); data/tinyproxy-1.10.0/src/child.c:204:9: [3] (random) srand: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srand(time(NULL)); data/tinyproxy-1.10.0/src/child.c:294:21: [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 ("TINYPROXY_DEBUG")) { data/tinyproxy-1.10.0/src/main.c:182:23: [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 ((opt = getopt (argc, argv, "c:vdh")) != EOF) { data/tinyproxy-1.10.0/src/acl.c:54:34: [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 network[IPV6_LEN]; data/tinyproxy-1.10.0/src/acl.c:55:34: [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 mask[IPV6_LEN]; data/tinyproxy-1.10.0/src/acl.c:142: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 *p, ip_dst[IPV6_LEN]; data/tinyproxy-1.10.0/src/acl.c:162: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. memcpy (acl.address.ip.network, ip_dst, IPV6_LEN); data/tinyproxy-1.10.0/src/acl.c:173: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 dst[sizeof(struct in6_addr)]; data/tinyproxy-1.10.0/src/acl.c:230: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 ipbuf[512]; data/tinyproxy-1.10.0/src/base64.c:21:14: [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 const char base64_tbl[64] = data/tinyproxy-1.10.0/src/basicauth.c:38: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[256+2]; data/tinyproxy-1.10.0/src/basicauth.c:54: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 b[BASE64ENC_BYTES((256+2)-1) + 1]; data/tinyproxy-1.10.0/src/buffer.c:76:9: [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 (newline->string, data, length); data/tinyproxy-1.10.0/src/child.c:86:19: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). lock_fd = mkstemp (lock_file); data/tinyproxy-1.10.0/src/conf.c:401: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 buffer[1024]; /* 1KB lines should be plenty */ data/tinyproxy-1.10.0/src/conf.c:422:23: [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). config_file = fopen (config_fname, "r"); data/tinyproxy-1.10.0/src/conf.c:614:9: [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, line + match->rm_so, len); data/tinyproxy-1.10.0/src/filter.c:54: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[FILTER_BUFFER_LEN]; data/tinyproxy-1.10.0/src/filter.c:62: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). fd = fopen (config.filter, "r"); data/tinyproxy-1.10.0/src/hashmap.c:222:9: [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 (data_copy, data, len); data/tinyproxy-1.10.0/src/heap.c:91:9: [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 (ptr, s, len); data/tinyproxy-1.10.0/src/heap.c:112: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 buffer[32]; data/tinyproxy-1.10.0/src/heap.c:125:19: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). if ((fd = mkstemp (buffer)) == -1) data/tinyproxy-1.10.0/src/html-error.c:42: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 errornbuf[ERRORNUM_BUFSIZE]; data/tinyproxy-1.10.0/src/html-error.c:63: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 errornbuf[ERRORNUM_BUFSIZE]; data/tinyproxy-1.10.0/src/html-error.c:205:24: [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 (!(infile = fopen (error_file, "r"))) { data/tinyproxy-1.10.0/src/html-error.c:251: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 errnobuf[16]; data/tinyproxy-1.10.0/src/html-error.c:252: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 timebuf[30]; data/tinyproxy-1.10.0/src/http-message.c:232: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 timebuf[30]; data/tinyproxy-1.10.0/src/log.c:113: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 time_string[TIME_LENGTH]; data/tinyproxy-1.10.0/src/log.c:114: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 str[STRING_LENGTH]; data/tinyproxy-1.10.0/src/log.c:237:25: [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). level = atoi (string); data/tinyproxy-1.10.0/src/main.c:167:16: [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). return atoi (str); data/tinyproxy-1.10.0/src/network.c:145: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 buffer[SEGMENT_LEN]; data/tinyproxy-1.10.0/src/network.c:228: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. memcpy (*whole_buffer + whole_buffer_len, line_ptr->data, data/tinyproxy-1.10.0/src/network.c:297: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[24], tmp[24]; /* IPv4->IPv6 = ::FFFF:xxx.xxx.xxx.xxx\0 */ data/tinyproxy-1.10.0/src/reqs.c:210: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. memcpy (request->host, url, len); data/tinyproxy-1.10.0/src/reqs.c:255: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 portbuff[7]; data/tinyproxy-1.10.0/src/reqs.c:256: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 dst[sizeof(struct in6_addr)]; data/tinyproxy-1.10.0/src/reqs.c:703: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. memcpy (header + len, line, linelen); data/tinyproxy-1.10.0/src/reqs.c:785:34: [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). content_length = atol (data); data/tinyproxy-1.10.0/src/reqs.c:802: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 hostname[512]; data/tinyproxy-1.10.0/src/reqs.c:1286: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 buff[512]; /* won't use more than 7 + 255 */ data/tinyproxy-1.10.0/src/reqs.c:1306: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(&buff[2], &port, 2); /* dest port */ data/tinyproxy-1.10.0/src/reqs.c:1308: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(&buff[4], host->h_addr_list[0], 4); /* dest ip */ data/tinyproxy-1.10.0/src/reqs.c:1334:4: [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 in[2]; data/tinyproxy-1.10.0/src/reqs.c:1335:4: [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 out[515]; data/tinyproxy-1.10.0/src/reqs.c:1341: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(cur, cur_upstream->ua.user, c); data/tinyproxy-1.10.0/src/reqs.c:1345: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(cur, cur_upstream->pass, c); data/tinyproxy-1.10.0/src/reqs.c:1366: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(&buff[5], request->host, len); /* dest ip */ data/tinyproxy-1.10.0/src/reqs.c:1368: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(&buff[5+len], &port, 2); /* dest port */ data/tinyproxy-1.10.0/src/reqs.c:1543: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 sock_ipaddr[IP_LENGTH]; data/tinyproxy-1.10.0/src/reqs.c:1544: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 peer_ipaddr[IP_LENGTH]; data/tinyproxy-1.10.0/src/reqs.c:1545: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 peer_string[HOSTNAME_LENGTH]; data/tinyproxy-1.10.0/src/sock.c:82: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 portstr[6]; data/tinyproxy-1.10.0/src/sock.c:183: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 numerichost[NI_MAXHOST]; data/tinyproxy-1.10.0/src/sock.c:257: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 portstr[6]; data/tinyproxy-1.10.0/src/stats.c:66: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 opens[16], reqs[16], badconns[16], denied[16], refused[16]; data/tinyproxy-1.10.0/src/stats.c:75:47: [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 (!config.statpage || (!(statfile = fopen (config.statpage, "r")))) { data/tinyproxy-1.10.0/src/text.c:43:9: [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 (dst, src, len); data/tinyproxy-1.10.0/src/text.c:66: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. memcpy (dst + len1, src, len2); data/tinyproxy-1.10.0/src/upstream.c:68: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 b[BASE64ENC_BYTES((256+2)-1) + 1]; data/tinyproxy-1.10.0/src/upstream.c:117:59: [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). ~((1 << (32 - atoi (ptr))) - 1); data/tinyproxy-1.10.0/src/utils.c:92:22: [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). open (filename, O_RDWR | O_CREAT | O_EXCL, 0600)) < 0) { data/tinyproxy-1.10.0/src/utils.c:108:31: [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 ((fildes = open (filename, flags)) < 0) { data/tinyproxy-1.10.0/src/utils.c:169:22: [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). open (filename, O_RDWR | O_CREAT | O_TRUNC, 0600)) < 0) { data/tinyproxy-1.10.0/src/vector.c:136:9: [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 (entry->data, data, len); data/tinyproxy-1.10.0/src/acl.c:233:31: [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). assert (ip_address && strlen (ip_address) > 0); data/tinyproxy-1.10.0/src/acl.c:234: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). assert (string_address && strlen (string_address) > 0); data/tinyproxy-1.10.0/src/acl.c:270:23: [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). test_length = strlen (string_address); data/tinyproxy-1.10.0/src/acl.c:271:24: [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). match_length = strlen (acl->address.string); data/tinyproxy-1.10.0/src/acl.c:307:23: [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). assert (ip && strlen (ip) > 0); data/tinyproxy-1.10.0/src/buffer.c:231:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bytesin = read (fd, buffer, READ_BUFFER_SIZE); data/tinyproxy-1.10.0/src/child.c:84:9: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask (0177); data/tinyproxy-1.10.0/src/conf.c:906:49: [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). vector_append (conf->listen_addrs, arg, strlen(arg) + 1); data/tinyproxy-1.10.0/src/daemon.c:49:9: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask (0177); data/tinyproxy-1.10.0/src/heap.c:87:15: [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). len = strlen (s) + 1; data/tinyproxy-1.10.0/src/heap.c:123:9: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask (0177); data/tinyproxy-1.10.0/src/html-error.c:51:39: [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). filepath, strlen (filepath) + 1) < 0) data/tinyproxy-1.10.0/src/html-error.c:235:32: [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). strlen (val) + 1); data/tinyproxy-1.10.0/src/http-message.c:152: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 (strlen (response_string) == 0) data/tinyproxy-1.10.0/src/log.c:152:53: [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). entry_buffer = (char *) safemalloc (strlen (str) + 6); data/tinyproxy-1.10.0/src/log.c:158:32: [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). strlen (entry_buffer) + 1); data/tinyproxy-1.10.0/src/log.c:190:27: [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). p = str + strlen(str); data/tinyproxy-1.10.0/src/log.c:191:47: [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). vsnprintf (p, STRING_LENGTH - strlen(str) - 1, fmt, args); data/tinyproxy-1.10.0/src/log.c:193:27: [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). p = str + strlen(str); data/tinyproxy-1.10.0/src/log.c:199:48: [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). ret = write (log_file_fd, str, strlen (str)); data/tinyproxy-1.10.0/src/main.c:227:29: [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 (config.group && strlen (config.group) > 0) { data/tinyproxy-1.10.0/src/main.c:264:28: [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 (config.user && strlen (config.user) > 0) { data/tinyproxy-1.10.0/src/main.c:341:9: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask (0177); data/tinyproxy-1.10.0/src/network.c:76:23: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). len = read (fd, buffer, count); data/tinyproxy-1.10.0/src/network.c:300:31: [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). assert (ip != NULL && strlen (ip) != 0); data/tinyproxy-1.10.0/src/reqs.c:151:17: [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). assert (strlen (host) > 0); data/tinyproxy-1.10.0/src/reqs.c:232: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). strlen(request->host) - 2); data/tinyproxy-1.10.0/src/reqs.c:330:23: [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). request_len = strlen (connptr->request_line) + 1; data/tinyproxy-1.10.0/src/reqs.c:562:30: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bytes_read = read (connptr->client_fd, buffer, 2); data/tinyproxy-1.10.0/src/reqs.c:759:32: [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). ptr += strlen (ptr) + 1; data/tinyproxy-1.10.0/src/reqs.c:1092:57: [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). strlen (reverse-> data/tinyproxy-1.10.0/src/reqs.c:1293:33: [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). ulen = cur_upstream->ua.user ? strlen(cur_upstream->ua.user) : 0; data/tinyproxy-1.10.0/src/reqs.c:1294:33: [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). passlen = cur_upstream->pass ? strlen(cur_upstream->pass) : 0; data/tinyproxy-1.10.0/src/reqs.c:1362: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). len=strlen(request->host); data/tinyproxy-1.10.0/src/reqs.c:1455:23: [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). len = strlen (request->host) + 7; data/tinyproxy-1.10.0/src/reqs.c:1465:23: [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). len = strlen (request->host) + strlen (request->path) + 14; data/tinyproxy-1.10.0/src/reqs.c:1465:48: [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). len = strlen (request->host) + strlen (request->path) + 14; data/tinyproxy-1.10.0/src/reqs.c:1653:48: [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). header->value, strlen (header->value) + 1); data/tinyproxy-1.10.0/src/reverse-proxy.c:128:41: [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). safemalloc (strlen (url) + strlen (reverse->url) + data/tinyproxy-1.10.0/src/reverse-proxy.c:128:56: [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). safemalloc (strlen (url) + strlen (reverse->url) + data/tinyproxy-1.10.0/src/reverse-proxy.c:131:52: [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). strcat (rewrite_url, url + strlen (reverse->path)); data/tinyproxy-1.10.0/src/reverse-proxy.c:141:50: [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). strlen (REVERSE_COOKIE) + 1, data/tinyproxy-1.10.0/src/reverse-proxy.c:146:42: [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). (strlen (url) + data/tinyproxy-1.10.0/src/reverse-proxy.c:147:42: [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). strlen (reverse->url) + data/tinyproxy-1.10.0/src/sock.c:48:33: [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). assert (addr != NULL && strlen (addr) != 0); data/tinyproxy-1.10.0/src/text.c:37:22: [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). size_t len = strlen (src); data/tinyproxy-1.10.0/src/text.c:59:23: [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). size_t len1 = strlen (dst); data/tinyproxy-1.10.0/src/text.c:60:23: [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). size_t len2 = strlen (src); data/tinyproxy-1.10.0/src/transparent-proxy.c:47:15: [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). len = strlen (host) + strlen (path) + 14; data/tinyproxy-1.10.0/src/transparent-proxy.c:47:31: [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). len = strlen (host) + strlen (path) + 14; data/tinyproxy-1.10.0/src/transparent-proxy.c:62:23: [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). size_t ulen = strlen (*url); data/tinyproxy-1.10.0/src/utils.c:54:46: [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). http_message_set_body (msg, message, strlen (message)); ANALYSIS SUMMARY: Hits = 141 Lines analyzed = 10585 in approximately 0.30 seconds (35801 lines/second) Physical Source Lines of Code (SLOC) = 6107 Hits@level = [0] 73 [1] 52 [2] 64 [3] 3 [4] 22 [5] 0 Hits@level+ = [0+] 214 [1+] 141 [2+] 89 [3+] 25 [4+] 22 [5+] 0 Hits/KSLOC@level+ = [0+] 35.0418 [1+] 23.0883 [2+] 14.5734 [3+] 4.09366 [4+] 3.60242 [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.