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/weborf-0.16/embedded_auth.h Examining data/weborf-0.16/base64.c Examining data/weborf-0.16/auth.c Examining data/weborf-0.16/cachedir.h Examining data/weborf-0.16/webdav.c Examining data/weborf-0.16/configuration.c Examining data/weborf-0.16/cachedir.c Examining data/weborf-0.16/auth.h Examining data/weborf-0.16/myio.h Examining data/weborf-0.16/utils.h Examining data/weborf-0.16/cgi.h Examining data/weborf-0.16/cgi.c Examining data/weborf-0.16/instance.h Examining data/weborf-0.16/buffered_reader.c Examining data/weborf-0.16/listener.h Examining data/weborf-0.16/types.h Examining data/weborf-0.16/mynet.h Examining data/weborf-0.16/mynet.c Examining data/weborf-0.16/configuration.h Examining data/weborf-0.16/queue.h Examining data/weborf-0.16/listener.c Examining data/weborf-0.16/utils.c Examining data/weborf-0.16/queue.c Examining data/weborf-0.16/mime.h Examining data/weborf-0.16/mystring.c Examining data/weborf-0.16/buffered_reader.h Examining data/weborf-0.16/examples/weborf_auth_dav.c Examining data/weborf-0.16/examples/weborf_auth.c Examining data/weborf-0.16/mystring.h Examining data/weborf-0.16/webdav.h Examining data/weborf-0.16/mime.c Examining data/weborf-0.16/instance.c Examining data/weborf-0.16/myio.c Examining data/weborf-0.16/base64.h FINAL RESULTS: data/weborf-0.16/auth.c:122:9: [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(remote.sun_path, weborf_conf.authsock); data/weborf-0.16/cachedir.c:216:9: [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. if (access(dir,W_OK|R_OK)!=0) { data/weborf-0.16/cgi.c:239:5: [4] (shell) execl: 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. execl(executor, executor, (char *)0); data/weborf-0.16/examples/weborf_auth.c:45:5: [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(local.sun_path, SOCK_PATH); data/weborf-0.16/examples/weborf_auth_dav.c:58:5: [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(local.sun_path, SOCK_PATH); data/weborf-0.16/instance.c:819:9: [4] (shell) execlp: 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. execlp("gzip","gzip","-c",connection_prop->strfile,(char *)0); data/weborf-0.16/instance.c:1267:9: [4] (shell) execlp: 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. execlp("tar","tar","-cz",connection_prop->strfile,(char *)0); data/weborf-0.16/myio.c:101:12: [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. return access(file, R_OK) == 0; data/weborf-0.16/utils.c:92:17: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. rlen += sprintf(dest + rlen, format, origin[i]); data/weborf-0.16/utils.c:140:9: [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(dest + len, code); data/weborf-0.16/cgi.c:145:27: [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. setenv("SERVER_NAME", getenv("HTTP_HOST"),true); //TODO for older http version this header might not exist data/weborf-0.16/cgi.c:178: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. char *content_l=getenv("HTTP_CONTENT_LENGTH"); data/weborf-0.16/cgi.c:181:31: [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. setenv("CONTENT_TYPE",getenv("HTTP_CONTENT_TYPE"),true); data/weborf-0.16/configuration.c:260:13: [3] (buffer) getopt_long: 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. c = getopt_long( data/weborf-0.16/instance.c:1095: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. result=getenv(h); data/weborf-0.16/auth.c:76:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char username[PWDLIMIT*2]; data/weborf-0.16/auth.c:86: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 a[PWDLIMIT*2]; data/weborf-0.16/auth.c:89:13: [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(&a,auth,auth_end-auth); //Copies the base64 encoded string to a temp buffer data/weborf-0.16/buffered_reader.c:105:13: [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(b, buf->start, needed); data/weborf-0.16/buffered_reader.c:110: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(b, buf->start, available); data/weborf-0.16/cachedir.c:106:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char fname[PATH_LEN]; data/weborf-0.16/cachedir.c:111: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). int fd=open(fname,O_RDONLY); data/weborf-0.16/cachedir.c:134:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char fname[PATH_LEN]; data/weborf-0.16/cachedir.c:139: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). int fd = open(fname,O_RDWR| O_CREAT,S_IRUSR|S_IWUSR); data/weborf-0.16/cachedir.c:163:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char fname[PATH_LEN]; data/weborf-0.16/cachedir.c:166: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). int fd=open(fname, O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR); data/weborf-0.16/cgi.c:63:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char hparam[200]; data/weborf-0.16/cgi.c:101:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char loc_addr[INET6_ADDRSTRLEN]; data/weborf-0.16/cgi.c:108:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char loc_addr[INET_ADDRSTRLEN]; data/weborf-0.16/examples/weborf_auth.c:37:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char str[SIZE]; data/weborf-0.16/examples/weborf_auth_dav.c:47:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char str[SIZE]; data/weborf-0.16/instance.c:114:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char a[12];//Gets the value data/weborf-0.16/instance.c:387:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char a[NBUFFER]; //Buffer for field's value data/weborf-0.16/instance.c:408: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). int fd=open(connection_prop->strfile,O_WRONLY|O_CREAT,S_IRUSR|S_IWUSR); data/weborf-0.16/instance.c:558:38: [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 ((connection_prop->strfile_fd=open(connection_prop->strfile,O_RDONLY | O_LARGEFILE))<0) { data/weborf-0.16/instance.c:594:13: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char head[URI_LEN+12];//12 is the size for the location header data/weborf-0.16/instance.c:607:21: [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 head[URI_LEN+12];//12 is the size for the location header data/weborf-0.16/instance.c:693: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 a[RBUFFER+MIMETYPELEN+16]; //Buffer for if-none-match from header data/weborf-0.16/instance.c:857: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 b[RBUFFER]; //Buffer for If-Range data/weborf-0.16/instance.c:942:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char a[RBUFFER+MIMETYPELEN+16]; //Buffer for Range, Content-Range headers, and reading if-none-match from header data/weborf-0.16/instance.c:1063:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char a[NBUFFER]; data/weborf-0.16/mime.c:80: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[64]; data/weborf-0.16/myio.c:184:16: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((fd_to=open(dest,O_WRONLY|O_CREAT,S_IRUSR|S_IWUSR))<0) { data/weborf-0.16/myio.c:189:18: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((fd_from=open(source,O_RDONLY | O_LARGEFILE))<0) { data/weborf-0.16/mynet.c:104: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(r, addr, len + 1); data/weborf-0.16/mynet.c:108: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(r, prefix, strlen(prefix)); data/weborf-0.16/mynet.c:109: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(r + strlen(prefix), addr, len + 1); data/weborf-0.16/mynet.c:182: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 temp_buffer[INET_ADDRSTRLEN]; data/weborf-0.16/mystring.c:68:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char e_seq[3]; data/weborf-0.16/types.h:56:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *data[MAXINDEXCOUNT]; //Array containing pointers data/weborf-0.16/types.h:79:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char ip_addr[INET6_ADDRSTRLEN]; //ip address in string format data/weborf-0.16/types.h:81:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char ip_addr[INET_ADDRSTRLEN]; data/weborf-0.16/types.h:129:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *indexes[MAXINDEXCOUNT];//List of pointers to index files data/weborf-0.16/utils.c:107:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char ni[2] = "X"; data/weborf-0.16/utils.c:168:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char path[INBUFFER]; //Buffer to contain element's absolute path data/weborf-0.16/utils.c:189:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char last_modified[URI_LEN]; data/weborf-0.16/utils.c:471: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(buf, val, field_end - val); data/weborf-0.16/webdav.c:87:13: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(dest,"%%%02x",source[i]); data/weborf-0.16/webdav.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 a[4]; //Buffer for field's value data/weborf-0.16/webdav.c:124:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *sprops[MAXPROPCOUNT]; //List of pointers to properties data/weborf-0.16/webdav.c:209:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char escaped_filename[URI_LEN]; data/weborf-0.16/webdav.c:210:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char escaped_page[URI_LEN]; data/weborf-0.16/webdav.c:212:19: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). int file_fd = open(file, O_RDONLY); data/weborf-0.16/webdav.c:271: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 prop_buffer[URI_LEN]; data/weborf-0.16/webdav.c:322:13: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char head[URI_LEN+12];//12 is the size for the location header data/weborf-0.16/webdav.c:376: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 file[URI_LEN]; data/weborf-0.16/auth.c:123: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(remote.sun_path) + sizeof(remote.sun_family); data/weborf-0.16/auth.c:136:57: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (write(s,auth_str,auth_str_l)==auth_str_l && read(s,auth_str,1)==0) {//All data written and no output, ok data/weborf-0.16/cgi.c:227: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). if (strlen(executor) == 0) { data/weborf-0.16/cgi.c:229:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(executor, connection_prop->strfile, connection_prop->strfile_len); data/weborf-0.16/cgi.c:289:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int e_reads=read(wpipe[0],header_buf,MAXSCRIPTOUT+HEADBUF); data/weborf-0.16/cgi.c:338:25: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). e_reads=read(wpipe[0],header_buf,MAXSCRIPTOUT+HEADBUF); data/weborf-0.16/configuration.c:103: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). weborf_conf.cgi_paths.data_l[0] = strlen(".php"); data/weborf-0.16/configuration.c:104: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). weborf_conf.cgi_paths.data_l[1] = strlen(CGI_PHP); data/weborf-0.16/configuration.c:105: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). weborf_conf.cgi_paths.data_l[2] = strlen(".py"); data/weborf-0.16/configuration.c:106: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). weborf_conf.cgi_paths.data_l[3] = strlen(CGI_PY); data/weborf-0.16/configuration.c:118: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 (!optarg || strlen(optarg) == 0) { data/weborf-0.16/configuration.c:145: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). weborf_conf.cgi_paths.data_l[i]=strlen(weborf_conf.cgi_paths.data[i]); data/weborf-0.16/embedded_auth.h:42: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). if (strncmp(username,user,strlen(user))==0 && strncmp(password,pass,strlen(pass))==0) data/weborf-0.16/embedded_auth.h:42:73: [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(username,user,strlen(user))==0 && strncmp(password,pass,strlen(pass))==0) data/weborf-0.16/embedded_auth.h:70: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). if (strncmp(allowed_prefix,ip_addr,strlen(allowed_prefix))==0) return 0; data/weborf-0.16/embedded_auth.h:73: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 ((strncmp(method,"PROPFIND",strlen("PROPFIND"))==0) || (strncmp(method,"OPTIONS",strlen("OPTIONS"))==0)) data/weborf-0.16/embedded_auth.h:73:89: [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(method,"PROPFIND",strlen("PROPFIND"))==0) || (strncmp(method,"OPTIONS",strlen("OPTIONS"))==0)) data/weborf-0.16/embedded_auth.h:77:37: [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). else if (!(strncmp(method,"GET",strlen("GET"))==0 || strncmp(method,"POST",strlen("POST"))==0)) { data/weborf-0.16/embedded_auth.h:77:80: [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). else if (!(strncmp(method,"GET",strlen("GET"))==0 || strncmp(method,"POST",strlen("POST"))==0)) { data/weborf-0.16/embedded_auth.h:82: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). if (strncmp(foto,page,strlen(foto))==0) data/weborf-0.16/examples/weborf_auth.c:47: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). len = strlen(local.sun_path) + sizeof(local.sun_family); data/weborf-0.16/examples/weborf_auth_dav.c:60: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). len = strlen(local.sun_path) + sizeof(local.sun_family); data/weborf-0.16/instance.c:86:77: [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 (get_param_value(connection_prop->http_param,if_none_match,a,RBUFFER,strlen(if_none_match))) { data/weborf-0.16/instance.c:116:91: [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). bool connection=get_param_value(connection_prop->http_param,"Connection", a,sizeof(a),strlen("Connection")); data/weborf-0.16/instance.c:175: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). if (strncmp(buf,"GET",strlen("GET"))==0) connection_prop->method_id=GET; data/weborf-0.16/instance.c:176:37: [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). else if (strncmp(buf,"POST",strlen("POST"))==0) connection_prop->method_id=POST; data/weborf-0.16/instance.c:177: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). else if (strncmp(buf,"PUT",strlen("PUT"))==0) connection_prop->method_id=PUT; data/weborf-0.16/instance.c:178: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). else if (strncmp(buf,"DELETE",strlen("DELETE"))==0) connection_prop->method_id=DELETE; data/weborf-0.16/instance.c:179: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). else if (strncmp(buf,"OPTIONS",strlen("OPTIONS"))==0) connection_prop->method_id=OPTIONS; data/weborf-0.16/instance.c:181: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). else if (strncmp(buf,"PROPFIND",strlen("PROPFIND"))==0) connection_prop->method_id=PROPFIND; data/weborf-0.16/instance.c:182: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). else if (strncmp(buf,"MKCOL",strlen("MKCOL"))==0) connection_prop->method_id=MKCOL; data/weborf-0.16/instance.c:183:37: [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). else if (strncmp(buf,"COPY",strlen("COPY"))==0) connection_prop->method_id=COPY; data/weborf-0.16/instance.c:184:37: [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). else if (strncmp(buf,"MOVE",strlen("MOVE"))==0) connection_prop->method_id=MOVE; data/weborf-0.16/instance.c:392:84: [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). bool r=get_param_value(connection_prop->http_param,"Content-Length", a,NBUFFER,strlen("Content-Length"));//14 is content-length's len data/weborf-0.16/instance.c:711: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). size_t basedir_len=strlen(real_basedir); data/weborf-0.16/instance.c:852:83: [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). bool range_header=get_param_value(connection_prop->http_param,range,a,RBUFFER,strlen(range)); data/weborf-0.16/instance.c:858:82: [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 (get_param_value(connection_prop->http_param,if_range,&b[0],sizeof(b),strlen(if_range))) { data/weborf-0.16/instance.c:1068:82: [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 (get_param_value(connection_prop->http_param, content_length, a, NBUFFER, strlen(content_length))) { data/weborf-0.16/mime.c:89:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int r=read(fd,&buf,64); data/weborf-0.16/myio.c:58:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return read(fd.fd, buf, count); data/weborf-0.16/myio.c:200:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((read_=read(fd_from,buf,FILEBUF))>0) { data/weborf-0.16/myio.h:38:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). #define myio_read read data/weborf-0.16/mynet.c:100:18: [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(addr); data/weborf-0.16/mynet.c:107: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). r = malloc(len + strlen(prefix) + 1); data/weborf-0.16/mynet.c:108: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). memcpy(r, prefix, strlen(prefix)); data/weborf-0.16/mynet.c:109: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). memcpy(r + strlen(prefix), addr, len + 1); data/weborf-0.16/mystring.c:49: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). connection_prop->page_len=strlen(connection_prop->page); data/weborf-0.16/mystring.c:94: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). int substrlen = strlen(substr); data/weborf-0.16/mystring.c:110: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). size_t l = strlen(string + pos); data/weborf-0.16/utils.c:53:18: [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(origin); data/weborf-0.16/utils.c:108: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). size_t origin_len = strlen(origin); data/weborf-0.16/utils.c:115: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). codesize = strlen("&"); data/weborf-0.16/utils.c:119: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). codesize = strlen("<"); data/weborf-0.16/utils.c:123: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). codesize = strlen(">"); data/weborf-0.16/utils.c:127: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). codesize = strlen(" "); data/weborf-0.16/utils.c:131: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). codesize = strlen("""); data/weborf-0.16/webdav.c:116:81: [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). bool r=get_param_value(connection_prop->http_param,"Depth", a,sizeof(a),strlen("Depth")); data/weborf-0.16/webdav.c:476:82: [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). bool host_b=get_param_value(connection_prop->http_param,"Host",host,PATH_LEN,strlen("Host")); data/weborf-0.16/webdav.c:477:89: [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). bool dest_b=get_param_value(connection_prop->http_param,"Destination",dest,PATH_LEN,strlen("Destination")); data/weborf-0.16/webdav.c:478:97: [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). bool overwrite_b=get_param_value(connection_prop->http_param,"Overwrite",overwrite,PATH_LEN,strlen("Overwrite")); data/weborf-0.16/webdav.c:497: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). dest+=strlen(host); ANALYSIS SUMMARY: Hits = 127 Lines analyzed = 5942 in approximately 0.19 seconds (31379 lines/second) Physical Source Lines of Code (SLOC) = 3488 Hits@level = [0] 134 [1] 61 [2] 51 [3] 5 [4] 10 [5] 0 Hits@level+ = [0+] 261 [1+] 127 [2+] 66 [3+] 15 [4+] 10 [5+] 0 Hits/KSLOC@level+ = [0+] 74.828 [1+] 36.4106 [2+] 18.922 [3+] 4.30046 [4+] 2.86697 [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.