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/sbox-dtc-1.11.7/env.c Examining data/sbox-dtc-1.11.7/sbox.c Examining data/sbox-dtc-1.11.7/sbox.h FINAL RESULTS: data/sbox-dtc-1.11.7/sbox.c:302: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(sbox_config.web_user,cmd->data.str); data/sbox-dtc-1.11.7/sbox.c:307: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(sbox_config.web_group,cmd->data.str); data/sbox-dtc-1.11.7/sbox.c:356: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(sbox_config.safe_path,cmd->data.str); data/sbox-dtc-1.11.7/sbox.c:365: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(sbox_config.log_file,cmd->data.str); data/sbox-dtc-1.11.7/sbox.c:370: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(sbox_config.root,cmd->data.str); data/sbox-dtc-1.11.7/sbox.c:375: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(sbox_config.cgi_bin,cmd->data.str); data/sbox-dtc-1.11.7/sbox.c:453: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(sbox_config.php_path,cmd->data.str); data/sbox-dtc-1.11.7/sbox.c:458: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(sbox_config.python_path,cmd->data.str); data/sbox-dtc-1.11.7/sbox.c:463: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(sbox_config.perl_path,cmd->data.str); data/sbox-dtc-1.11.7/sbox.c:468: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(sbox_config.ruby_path,cmd->data.str); data/sbox-dtc-1.11.7/sbox.c:645: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(http_host_config_file_path,HOST_CONF_FILE_FOLDER); data/sbox-dtc-1.11.7/sbox.c:646: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(http_host_config_file_path,my_http_host); data/sbox-dtc-1.11.7/sbox.c:917:2: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(log, fmt, ap); data/sbox-dtc-1.11.7/sbox.c:942:3: [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(stdout,webmaster ? "%s (<a href=\"mailto:%s\">%s</a>).": "%s", data/sbox-dtc-1.11.7/sbox.c:945:3: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vprintf(fmt, ap); data/sbox-dtc-1.11.7/sbox.c:1351:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(path_translated,"%s%s",shave(newroot,target),path_info); data/sbox-dtc-1.11.7/sbox.c:1361:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(s,"%s%s", shave(root,target),path_info); data/sbox-dtc-1.11.7/sbox.c:1409:6: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. if (sprintf(*var,"%s=%s",name,value) <= 0) data/sbox-dtc-1.11.7/sbox.c:1465:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(pathbuf, "PATH=%s", sbox_config.safe_path); data/sbox-dtc-1.11.7/sbox.c:82:9: [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. #ifndef chroot data/sbox-dtc-1.11.7/sbox.c:83:12: [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. extern int chroot (const char *path); data/sbox-dtc-1.11.7/sbox.c:648:6: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. if(!realpath(http_host_config_file_path,realpath_path)){ data/sbox-dtc-1.11.7/sbox.c:749: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(newroot) < 0) data/sbox-dtc-1.11.7/sbox.c:939:22: [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. webmaster = (char*)getenv("SERVER_ADMIN"); data/sbox-dtc-1.11.7/sbox.c:986:28: [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. path_translated = (char*) getenv("PATH_TRANSLATED"); data/sbox-dtc-1.11.7/sbox.c:989:17: [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. escape((char*)getenv("SCRIPT_NAME"))); data/sbox-dtc-1.11.7/sbox.c:993:22: [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. path_info = (char*) getenv("PATH_INFO"); data/sbox-dtc-1.11.7/sbox.c:996:18: [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. escape((char*)getenv("SCRIPT_NAME"))); data/sbox-dtc-1.11.7/sbox.c:1041:28: [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. path_translated = (char*) getenv("PATH_TRANSLATED"); data/sbox-dtc-1.11.7/sbox.c:1042:22: [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. path_info = (char*) getenv("PATH_INFO"); data/sbox-dtc-1.11.7/sbox.c:1324:14: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. s = (char*) getenv("PATH_INFO"); data/sbox-dtc-1.11.7/sbox.c:1343: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. path_translated = (char*) getenv("PATH_TRANSLATED"); data/sbox-dtc-1.11.7/env.c:14:8: [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 nm[MAXENV]; data/sbox-dtc-1.11.7/env.c:15:8: [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 wd[MAXPATH+1]; data/sbox-dtc-1.11.7/env.c:19: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 timestr[1024]; data/sbox-dtc-1.11.7/sbox.c:490: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 envvar_name[MAXENV+2]; // Stores the current env var name, make sure it's big enough by adding 2 safety chars data/sbox-dtc-1.11.7/sbox.c:512: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 nm[MAXENV+2]; data/sbox-dtc-1.11.7/sbox.c:543: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 nm[MAXENV]; data/sbox-dtc-1.11.7/sbox.c:555:72: [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( strcmp(nm,"SBOX_DTC_CONF_uid_min") == 0) sbox_config.uid_min = atoi(delimiter); data/sbox-dtc-1.11.7/sbox.c:556:72: [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( strcmp(nm,"SBOX_DTC_CONF_uid_max") == 0) sbox_config.uid_max = atoi(delimiter); data/sbox-dtc-1.11.7/sbox.c:557:72: [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( strcmp(nm,"SBOX_DTC_CONF_gid_min") == 0) sbox_config.gid_min = atoi(delimiter); data/sbox-dtc-1.11.7/sbox.c:558:72: [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( strcmp(nm,"SBOX_DTC_CONF_gid_max") == 0) sbox_config.gid_max = atoi(delimiter); data/sbox-dtc-1.11.7/sbox.c:571:74: [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( strcmp(nm,"SBOX_DTC_CONF_priority") == 0) sbox_config.priority = atoi(delimiter); data/sbox-dtc-1.11.7/sbox.c:572:85: [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). if( strcmp(nm,"SBOX_DTC_CONF_limit_cpu_hard") == 0) sbox_config.limit_cpu_hard = atol(delimiter); data/sbox-dtc-1.11.7/sbox.c:573:85: [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). if( strcmp(nm,"SBOX_DTC_CONF_limit_cpu_soft") == 0) sbox_config.limit_cpu_soft = atol(delimiter); data/sbox-dtc-1.11.7/sbox.c:574:94: [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). if( strcmp(nm,"SBOX_DTC_CONF_limit_fsize_hard") == 0) sbox_config.limit_fsize_hard = 1024*atol(delimiter); data/sbox-dtc-1.11.7/sbox.c:575:94: [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). if( strcmp(nm,"SBOX_DTC_CONF_limit_fsize_soft") == 0) sbox_config.limit_fsize_soft = 1024*atol(delimiter); data/sbox-dtc-1.11.7/sbox.c:576:92: [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). if( strcmp(nm,"SBOX_DTC_CONF_limit_data_hard") == 0) sbox_config.limit_data_hard = 1024*atol(delimiter); data/sbox-dtc-1.11.7/sbox.c:577:92: [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). if( strcmp(nm,"SBOX_DTC_CONF_limit_data_soft") == 0) sbox_config.limit_data_soft = 1024*atol(delimiter); data/sbox-dtc-1.11.7/sbox.c:578:89: [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). if( strcmp(nm,"SBOX_DTC_CONF_stack_hard") == 0) sbox_config.limit_stack_hard = 1024*atol(delimiter); data/sbox-dtc-1.11.7/sbox.c:579:94: [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). if( strcmp(nm,"SBOX_DTC_CONF_limit_stack_soft") == 0) sbox_config.limit_stack_soft = 1024*atol(delimiter); data/sbox-dtc-1.11.7/sbox.c:580:92: [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). if( strcmp(nm,"SBOX_DTC_CONF_limit_core_hard") == 0) sbox_config.limit_core_hard = 1024*atol(delimiter); data/sbox-dtc-1.11.7/sbox.c:581:92: [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). if( strcmp(nm,"SBOX_DTC_CONF_limit_core_soft") == 0) sbox_config.limit_core_soft = 1024*atol(delimiter); data/sbox-dtc-1.11.7/sbox.c:582:90: [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). if( strcmp(nm,"SBOX_DTC_CONF_limit_rss_hard") == 0) sbox_config.limit_rss_hard = 1024*atol(delimiter); data/sbox-dtc-1.11.7/sbox.c:583:90: [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). if( strcmp(nm,"SBOX_DTC_CONF_limit_rss_soft") == 0) sbox_config.limit_rss_soft = 1024*atol(delimiter); data/sbox-dtc-1.11.7/sbox.c:584:89: [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). if( strcmp(nm,"SBOX_DTC_CONF_limit_nproc_hard") == 0) sbox_config.limit_nproc_hard = atol(delimiter); data/sbox-dtc-1.11.7/sbox.c:585:89: [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). if( strcmp(nm,"SBOX_DTC_CONF_limit_nproc_soft") == 0) sbox_config.limit_nproc_soft = atol(delimiter); data/sbox-dtc-1.11.7/sbox.c:586:91: [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). if( strcmp(nm,"SBOX_DTC_CONF_limit_nofile_hard") == 0) sbox_config.limit_nofile_hard = atol(delimiter); data/sbox-dtc-1.11.7/sbox.c:587:91: [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). if( strcmp(nm,"SBOX_DTC_CONF_limit_nofile_soft") == 0) sbox_config.limit_nofile_soft = atol(delimiter); data/sbox-dtc-1.11.7/sbox.c:615: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 realpath_path[MAXPATHLEN+2]; data/sbox-dtc-1.11.7/sbox.c:667:8: [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). fp = fopen(realpath_path,"r"); data/sbox-dtc-1.11.7/sbox.c:896: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). if ((log = fopen(sbox_config.log_file, "a")) == NULL) { data/sbox-dtc-1.11.7/sbox.c:1034: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 *raw,*shaved,target[MAXPATHLEN+1],directory[MAXPATHLEN+1]; data/sbox-dtc-1.11.7/sbox.c:1094: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((void*)sdir,(void*)starg,sizeof(struct stat)); data/sbox-dtc-1.11.7/sbox.c:1258: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 newd[MAXPATHLEN+1],*newroot; data/sbox-dtc-1.11.7/sbox.c:1418: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 pathbuf[NAME_MAX]; data/sbox-dtc-1.11.7/sbox.c:1493:5: [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(s,"<"); data/sbox-dtc-1.11.7/sbox.c:1496:5: [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(s,">"); data/sbox-dtc-1.11.7/sbox.c:1499:5: [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(s,"&"); data/sbox-dtc-1.11.7/env.c:49:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(nm,name,delimiter-name); data/sbox-dtc-1.11.7/sbox.c:301: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). sbox_config.web_user = (char*)malloc(strlen(cmd->data.str)+1); data/sbox-dtc-1.11.7/sbox.c:306:40: [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). sbox_config.web_group = (char*)malloc(strlen(cmd->data.str)+1); data/sbox-dtc-1.11.7/sbox.c:355:40: [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). sbox_config.safe_path = (char*)malloc(strlen(cmd->data.str)+1); data/sbox-dtc-1.11.7/sbox.c:364: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). sbox_config.log_file = (char*)malloc(strlen(cmd->data.str)+1); data/sbox-dtc-1.11.7/sbox.c:369: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). sbox_config.root = (char*)malloc(strlen(cmd->data.str)+1); data/sbox-dtc-1.11.7/sbox.c:374:38: [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). sbox_config.cgi_bin = (char*)malloc(strlen(cmd->data.str)+1); data/sbox-dtc-1.11.7/sbox.c:452: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). sbox_config.php_path = (char*)malloc(strlen(cmd->data.str)+1); data/sbox-dtc-1.11.7/sbox.c:457: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). sbox_config.python_path = (char*)malloc(strlen(cmd->data.str)+1); data/sbox-dtc-1.11.7/sbox.c:462:40: [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). sbox_config.perl_path = (char*)malloc(strlen(cmd->data.str)+1); data/sbox-dtc-1.11.7/sbox.c:467:40: [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). sbox_config.ruby_path = (char*)malloc(strlen(cmd->data.str)+1); data/sbox-dtc-1.11.7/sbox.c:495: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(delimiter) > MAXENV) continue; data/sbox-dtc-1.11.7/sbox.c:496:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(envvar_name,name,delimiter-name); // Copy the envvar name in a buffer, to check for it later data/sbox-dtc-1.11.7/sbox.c:517: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(delimiter) > MAXENV) continue; data/sbox-dtc-1.11.7/sbox.c:518:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(nm,name,delimiter-name); data/sbox-dtc-1.11.7/sbox.c:548: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(delimiter) > MAXENV) continue; data/sbox-dtc-1.11.7/sbox.c:549:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(nm,name,delimiter-name); data/sbox-dtc-1.11.7/sbox.c:596:8: [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(file); data/sbox-dtc-1.11.7/sbox.c:631:5: [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(my_http_host) > 1024){ data/sbox-dtc-1.11.7/sbox.c:637: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). conf_file_path_string_size = strlen(HOST_CONF_FILE_FOLDER) + strlen(my_http_host) + 2; data/sbox-dtc-1.11.7/sbox.c:637:63: [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). conf_file_path_string_size = strlen(HOST_CONF_FILE_FOLDER) + strlen(my_http_host) + 2; data/sbox-dtc-1.11.7/sbox.c:658:3: [1] (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 character. strcat(dirname_path2,"/"); data/sbox-dtc-1.11.7/sbox.c:815: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(sbox_config.log_file) > 0){ data/sbox-dtc-1.11.7/sbox.c:838:5: [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(sbox_config.log_file) > 0 && ext == 0){ data/sbox-dtc-1.11.7/sbox.c:895: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(sbox_config.log_file) > 0) { data/sbox-dtc-1.11.7/sbox.c:914: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). timestr[strlen(timestr)-1]='\0'; data/sbox-dtc-1.11.7/sbox.c:972:12: [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). pathlen = strlen(USE_ABSOLUTE_ROOT); data/sbox-dtc-1.11.7/sbox.c:973:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(document_root,USE_ABSOLUTE_ROOT, pathlen+1); data/sbox-dtc-1.11.7/sbox.c:999:16: [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). for (common=p=strlen(path_translated),v=strlen(path_info); data/sbox-dtc-1.11.7/sbox.c:999: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). for (common=p=strlen(path_translated),v=strlen(path_info); data/sbox-dtc-1.11.7/sbox.c:1019:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(document_root,path_translated,common+1); data/sbox-dtc-1.11.7/sbox.c:1059: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(root)+1+strlen(sbox_config.cgi_bin) > MAXPATHLEN) data/sbox-dtc-1.11.7/sbox.c:1059: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). if (strlen(root)+1+strlen(sbox_config.cgi_bin) > MAXPATHLEN) data/sbox-dtc-1.11.7/sbox.c:1061:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(directory,root,MAXPATHLEN); data/sbox-dtc-1.11.7/sbox.c:1063:2: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant character. strncat(directory,"/",1); data/sbox-dtc-1.11.7/sbox.c:1064:2: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(directory,sbox_config.cgi_bin,strlen(sbox_config.cgi_bin)); data/sbox-dtc-1.11.7/sbox.c:1064:40: [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). strncat(directory,sbox_config.cgi_bin,strlen(sbox_config.cgi_bin)); data/sbox-dtc-1.11.7/sbox.c:1069:8: [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). max = strlen(directory) + strlen(shaved) + 1; data/sbox-dtc-1.11.7/sbox.c:1069: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). max = strlen(directory) + strlen(shaved) + 1; data/sbox-dtc-1.11.7/sbox.c:1072:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(raw,directory,max); data/sbox-dtc-1.11.7/sbox.c:1073:2: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(raw,shaved,strlen(shaved)); data/sbox-dtc-1.11.7/sbox.c:1073: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). strncat(raw,shaved,strlen(shaved)); data/sbox-dtc-1.11.7/sbox.c:1082:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(target,raw,p-raw); data/sbox-dtc-1.11.7/sbox.c:1110: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). p = raw + strlen(raw); data/sbox-dtc-1.11.7/sbox.c:1111:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(target,raw,MAXPATHLEN); data/sbox-dtc-1.11.7/sbox.c:1116: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). additional_length = strlen(raw) - strlen(target); data/sbox-dtc-1.11.7/sbox.c:1116:36: [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). additional_length = strlen(raw) - strlen(target); data/sbox-dtc-1.11.7/sbox.c:1120:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(*additional,raw+strlen(target),additional_length); data/sbox-dtc-1.11.7/sbox.c:1120:26: [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). strncpy(*additional,raw+strlen(target),additional_length); data/sbox-dtc-1.11.7/sbox.c:1125:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(directory,target,dir-raw); data/sbox-dtc-1.11.7/sbox.c:1130:8: [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). max = strlen(directory)+(p-dir)+1; data/sbox-dtc-1.11.7/sbox.c:1134:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(path,directory,max); data/sbox-dtc-1.11.7/sbox.c:1135:2: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(path,dir,p-dir); data/sbox-dtc-1.11.7/sbox.c:1261:8: [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). max = strlen(docroot) + 1 + strlen(sbox_config.root); data/sbox-dtc-1.11.7/sbox.c:1261:30: [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). max = strlen(docroot) + 1 + strlen(sbox_config.root); data/sbox-dtc-1.11.7/sbox.c:1265:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(newd,docroot,max); data/sbox-dtc-1.11.7/sbox.c:1266:2: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant character. strncat(newd,"/",1); data/sbox-dtc-1.11.7/sbox.c:1267:2: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(newd,sbox_config.root,strlen(sbox_config.root)); /* tack on the new root component */ data/sbox-dtc-1.11.7/sbox.c:1267: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). strncat(newd,sbox_config.root,strlen(sbox_config.root)); /* tack on the new root component */ data/sbox-dtc-1.11.7/sbox.c:1338:6: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(path_info)) { data/sbox-dtc-1.11.7/sbox.c:1347:9: [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). max = strlen( shave(newroot,target) ) + strlen(path_info) + 1; data/sbox-dtc-1.11.7/sbox.c:1347:43: [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). max = strlen( shave(newroot,target) ) + strlen(path_info) + 1; data/sbox-dtc-1.11.7/sbox.c:1358:9: [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). max = strlen( shave(root,target) ) + strlen(path_info) + 1; data/sbox-dtc-1.11.7/sbox.c:1358:40: [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). max = strlen( shave(root,target) ) + strlen(path_info) + 1; data/sbox-dtc-1.11.7/sbox.c:1387:12: [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 ((int)strlen(name) != abs(d-*var)) continue; data/sbox-dtc-1.11.7/sbox.c:1405: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 ( (*var = (char*)calloc(strlen(name)+1+strlen(value)+1,sizeof(char))) == NULL) data/sbox-dtc-1.11.7/sbox.c:1405:44: [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 ( (*var = (char*)calloc(strlen(name)+1+strlen(value)+1,sizeof(char))) == NULL) data/sbox-dtc-1.11.7/sbox.c:1440: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(delimiter) > MAXENV) { data/sbox-dtc-1.11.7/sbox.c:1453: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). if (!strncmp(*ep, safe_env_lst[idx], strlen(safe_env_lst[idx]))) { data/sbox-dtc-1.11.7/sbox.c:1462: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(sbox_config.safe_path)+strlen("PATH=")+1 > NAME_MAX) data/sbox-dtc-1.11.7/sbox.c:1462:36: [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(sbox_config.safe_path)+strlen("PATH=")+1 > NAME_MAX) data/sbox-dtc-1.11.7/sbox.c:1479: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). count = strlen(str); ANALYSIS SUMMARY: Hits = 141 Lines analyzed = 1714 in approximately 0.08 seconds (22541 lines/second) Physical Source Lines of Code (SLOC) = 1290 Hits@level = [0] 52 [1] 72 [2] 37 [3] 13 [4] 19 [5] 0 Hits@level+ = [0+] 193 [1+] 141 [2+] 69 [3+] 32 [4+] 19 [5+] 0 Hits/KSLOC@level+ = [0+] 149.612 [1+] 109.302 [2+] 53.4884 [3+] 24.8062 [4+] 14.7287 [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.