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/libapache2-mod-auth-mellon-0.17.0/mod_auth_mellon.c Examining data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_cache.c Examining data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_config.c Examining data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_cookie.c Examining data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_diagnostics.c Examining data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_handler.c Examining data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_util.c Examining data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_session.c Examining data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_httpclient.c Examining data/libapache2-mod-auth-mellon-0.17.0/auth_mellon.h Examining data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_compat.h Examining data/libapache2-mod-auth-mellon-0.17.0/lasso_compat.h FINAL RESULTS: data/libapache2-mod-auth-mellon-0.17.0/auth_mellon.h:367:16: [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. apr_time_t access; data/libapache2-mod-auth-mellon-0.17.0/auth_mellon.h:601:27: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. __attribute__((format(printf,4,5))); data/libapache2-mod-auth-mellon-0.17.0/auth_mellon.h:606:27: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. __attribute__((format(printf,4,5))); data/libapache2-mod-auth-mellon-0.17.0/auth_mellon.h:614:27: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. __attribute__((format(printf,4,5))); data/libapache2-mod-auth-mellon-0.17.0/auth_mellon.h:619:27: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. __attribute__((format(printf,4,5))); data/libapache2-mod-auth-mellon-0.17.0/auth_mellon.h:624:27: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. __attribute__((format(printf,4,5))); data/libapache2-mod-auth-mellon-0.17.0/auth_mellon.h:628:27: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. __attribute__((format(printf,2,3))); data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_cache.c:364:16: [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 (e->access < t->access) { data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_cache.c:364:28: [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 (e->access < t->access) { data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_cache.c:373:34: [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. age = (current_time - t->access) / 1000000; data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_cache.c:388: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(t->key, key); data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_diagnostics.c:71:27: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. __attribute__((format(printf,4,5))); data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_diagnostics.c:1141:58: [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. am_diag_time_t_to_8601(r, entry->access)); data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_util.c:302:25: [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. value = getenv(name); data/libapache2-mod-auth-mellon-0.17.0/auth_mellon.h:365: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 key[AM_CACHE_KEYSIZE]; data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_cache.c:88: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 buffer[512]; data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_cache.c:231: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(datastr, string, str_len); data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_cache.c:252:5: [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(datastr, string, str_len); data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_cache.c:305: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 buffer[512]; data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_httpclient.c:115: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(&block->data[block->used], data, num_cpy); data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_httpclient.c:219: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[pos], blk->data, blk->used); data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_httpclient.c:383: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 curl_error[CURL_ERROR_SIZE]; data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_httpclient.c:483: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 curl_error[CURL_ERROR_SIZE]; data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_util.c:1150: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 buffer[512]; data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_util.c:1199: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 buffer[512]; data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_util.c:1260: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 error_buffer[64]; data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_util.c:1353:19: [2] (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). Risk is low because the source is a constant string. (void)strcpy(&output[i], "&"); data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_util.c:1357:19: [2] (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). Risk is low because the source is a constant string. (void)strcpy(&output[i], """); data/libapache2-mod-auth-mellon-0.17.0/mod_auth_mellon.c:55: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 buffer[512]; data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_cache.c:97: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(key) != AM_ID_LENGTH) data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_cache.c:227:19: [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). datalen = strlen(datastr) + 1; data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_cache.c:229: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). str_len = strlen(string) + 1; data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_cache.c:308: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). if(key == NULL || strlen(key) != AM_ID_LENGTH) { data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_cache.c:703: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). srclen = strlen(srcstr); data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_cache.c:767:34: [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). (apr_size_t)strlen(lasso_identity)); data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_cache.c:778:34: [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). (apr_size_t)strlen(lasso_session)); data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_cache.c:789:34: [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). (apr_size_t)strlen(lasso_saml_response)); data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_config.c:707: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). if(strlen(arg) == 0 || arg[strlen(arg) - 1] != '/') { data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_config.c:707: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). if(strlen(arg) == 0 || arg[strlen(arg) - 1] != '/') { data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_config.c:841: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). apr_size_t optlen = strlen(options[i]); data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_config.c:1073: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). if(strlen(arg) == 0) { data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_cookie.c:166: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). if(value[strlen(name)] != '=') { data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_cookie.c:177: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). value += strlen(name) + 1; data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_diagnostics.c:115: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). prefix_len = strlen(prefix); data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_diagnostics.c:154:19: [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). buf_len = strlen(buf); data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_diagnostics.c:157: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). apr_size_t prefix_len = strlen(prefix); data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_diagnostics.c:853: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). buf_len = strlen(buf); data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_handler.c:143: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). sp_cert_file = cp + strlen(begin); data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_handler.c:1263: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(timestamp); data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_handler.c:2078: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(relay_state == NULL || strlen(relay_state) == 0) { data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_handler.c:3679: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). endpoint = &r->uri[strlen(cfg->endpoint_path)]; data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_httpclient.c:614: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). return am_httpclient_post(r, uri, post_data, strlen(post_data), data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_util.c:215: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). apr_size_t inlen = strlen(instr); data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_util.c:693: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). namelen = strlen(name); data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_util.c:1521:34: [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). output = apr_palloc(r->pool, strlen(str) + 1); data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_util.c:1558:34: [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). output = apr_palloc(r->pool, strlen(str) + xlen + 1); data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_util.c:1602: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). *last = s + strlen(s); data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_util.c:1604: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). *last = np + strlen(sep); data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_util.c:1605: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). memset(np, 0, strlen(sep)); data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_util.c:1710: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(attr_value); data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_util.c:1755: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). body += strlen(lflf); data/libapache2-mod-auth-mellon-0.17.0/auth_mellon_util.c:1758: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 ((body_len = strlen(body)) >= 1) { ANALYSIS SUMMARY: Hits = 62 Lines analyzed = 13129 in approximately 0.34 seconds (38609 lines/second) Physical Source Lines of Code (SLOC) = 8106 Hits@level = [0] 0 [1] 33 [2] 15 [3] 1 [4] 13 [5] 0 Hits@level+ = [0+] 62 [1+] 62 [2+] 29 [3+] 14 [4+] 13 [5+] 0 Hits/KSLOC@level+ = [0+] 7.64866 [1+] 7.64866 [2+] 3.5776 [3+] 1.72712 [4+] 1.60375 [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.