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/libapache-mod-evasive-1.10.1/mod_evasive.c Examining data/libapache-mod-evasive-1.10.1/mod_evasive20.c FINAL RESULTS: data/libapache-mod-evasive-1.10.1/mod_evasive.c:48:71: [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. #define LOG( A, ... ) { openlog("mod_evasive", LOG_PID, LOG_DAEMON); syslog( A, __VA_ARGS__ ); closelog(); } data/libapache-mod-evasive-1.10.1/mod_evasive.c:214:15: [4] (format) snprintf: 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. snprintf(filename, sizeof(filename), MAILER, email_notify); data/libapache-mod-evasive-1.10.1/mod_evasive.c:215:22: [4] (shell) popen: 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. file = popen(filename, "w"); data/libapache-mod-evasive-1.10.1/mod_evasive.c:225:15: [4] (format) snprintf: 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. snprintf(filename, sizeof(filename), sys_command, text_add); data/libapache-mod-evasive-1.10.1/mod_evasive.c:226:15: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. system(filename); data/libapache-mod-evasive-1.10.1/mod_evasive.c:623:11: [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(octet[i], oct); data/libapache-mod-evasive-1.10.1/mod_evasive20.c:57:71: [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. #define LOG( A, ... ) { openlog("mod_evasive", LOG_PID, LOG_DAEMON); syslog( A, __VA_ARGS__ ); closelog(); } data/libapache-mod-evasive-1.10.1/mod_evasive20.c:229:15: [4] (format) snprintf: 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. snprintf(filename, sizeof(filename), MAILER, email_notify); data/libapache-mod-evasive-1.10.1/mod_evasive20.c:230:22: [4] (shell) popen: 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. file = popen(filename, "w"); data/libapache-mod-evasive-1.10.1/mod_evasive20.c:240:15: [4] (format) snprintf: 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. snprintf(filename, sizeof(filename), system_command, CLIENT_IP(r->connection)); data/libapache-mod-evasive-1.10.1/mod_evasive20.c:241:15: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. system(filename); data/libapache-mod-evasive-1.10.1/mod_evasive20.c:281:7: [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(octet[i], oct); data/libapache-mod-evasive-1.10.1/mod_evasive.c:130:7: [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 hash_key[2048]; data/libapache-mod-evasive-1.10.1/mod_evasive.c:201: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 filename[1024]; data/libapache-mod-evasive-1.10.1/mod_evasive.c:207:18: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). file = fopen(filename, "w"); data/libapache-mod-evasive-1.10.1/mod_evasive.c:596: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 entry[128]; data/libapache-mod-evasive-1.10.1/mod_evasive.c:609: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 hashkey[128]; data/libapache-mod-evasive-1.10.1/mod_evasive.c:610: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 octet[4][4]; data/libapache-mod-evasive-1.10.1/mod_evasive20.c:134: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 entry[128]; data/libapache-mod-evasive-1.10.1/mod_evasive20.c:149:7: [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 hash_key[2048]; data/libapache-mod-evasive-1.10.1/mod_evasive20.c:216: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 filename[1024]; data/libapache-mod-evasive-1.10.1/mod_evasive20.c:222:18: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). file = fopen(filename, "w"); data/libapache-mod-evasive-1.10.1/mod_evasive20.c:267: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 hashkey[128]; data/libapache-mod-evasive-1.10.1/mod_evasive20.c:268: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 octet[4][4]; data/libapache-mod-evasive-1.10.1/mod_evasive.c:622: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(oct)<=3) data/libapache-mod-evasive-1.10.1/mod_evasive20.c:280: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(oct)<=3) ANALYSIS SUMMARY: Hits = 26 Lines analyzed = 1437 in approximately 0.08 seconds (17959 lines/second) Physical Source Lines of Code (SLOC) = 1007 Hits@level = [0] 27 [1] 2 [2] 12 [3] 0 [4] 12 [5] 0 Hits@level+ = [0+] 53 [1+] 26 [2+] 24 [3+] 12 [4+] 12 [5+] 0 Hits/KSLOC@level+ = [0+] 52.6316 [1+] 25.8193 [2+] 23.8332 [3+] 11.9166 [4+] 11.9166 [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.