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-pubtkt-0.13/src/ap_compat.h Examining data/libapache2-mod-auth-pubtkt-0.13/src/mod_auth_pubtkt.h Examining data/libapache2-mod-auth-pubtkt-0.13/src/mod_auth_pubtkt.c FINAL RESULTS: data/libapache2-mod-auth-pubtkt-0.13/src/mod_auth_pubtkt.c:155: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(tkt, &cache->slots[i].tkt, sizeof(*tkt)); data/libapache2-mod-auth-pubtkt-0.13/src/mod_auth_pubtkt.c:182:2: [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(&cache->slots[cache->nextslot].tkt, tkt, sizeof(*tkt)); data/libapache2-mod-auth-pubtkt-0.13/src/mod_auth_pubtkt.c:231:9: [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). fkey = fopen(pubkeypath, "r"); data/libapache2-mod-auth-pubtkt-0.13/src/mod_auth_pubtkt.c:294:14: [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). int debug = atoi(param); data/libapache2-mod-auth-pubtkt-0.13/src/mod_auth_pubtkt.c:396:23: [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). tkt->valid_until = atoi(value); data/libapache2-mod-auth-pubtkt-0.13/src/mod_auth_pubtkt.c:398:24: [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). tkt->grace_period = atoi(value); data/libapache2-mod-auth-pubtkt-0.13/src/mod_auth_pubtkt.c:406:44: [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). tkt->multifactor = atoi(value); data/libapache2-mod-auth-pubtkt-0.13/src/mod_auth_pubtkt.h:90: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 uid[MAX_UID_SIZE+1]; data/libapache2-mod-auth-pubtkt-0.13/src/mod_auth_pubtkt.h:91: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 clientip[40]; data/libapache2-mod-auth-pubtkt-0.13/src/mod_auth_pubtkt.h:94: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 bauth[256]; data/libapache2-mod-auth-pubtkt-0.13/src/mod_auth_pubtkt.h:95: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 tokens[256]; data/libapache2-mod-auth-pubtkt-0.13/src/mod_auth_pubtkt.h:96: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 user_data[256]; data/libapache2-mod-auth-pubtkt-0.13/src/mod_auth_pubtkt.h:116: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 ticket[MAX_TICKET_SIZE+1]; /* the unparsed ticket value */ data/libapache2-mod-auth-pubtkt-0.13/src/mod_auth_pubtkt.c:180:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(cache->slots[cache->nextslot].ticket, ticket, MAX_TICKET_SIZE); data/libapache2-mod-auth-pubtkt-0.13/src/mod_auth_pubtkt.c:283: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(param) != PASSTHRU_AUTH_KEY_SIZE) data/libapache2-mod-auth-pubtkt-0.13/src/mod_auth_pubtkt.c:392:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(tkt->uid, value, sizeof(tkt->uid)-1); data/libapache2-mod-auth-pubtkt-0.13/src/mod_auth_pubtkt.c:394:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(tkt->clientip, value, sizeof(tkt->clientip)-1); data/libapache2-mod-auth-pubtkt-0.13/src/mod_auth_pubtkt.c:400:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(tkt->tokens, value, sizeof(tkt->tokens)-1); data/libapache2-mod-auth-pubtkt-0.13/src/mod_auth_pubtkt.c:402:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(tkt->user_data, value, sizeof(tkt->user_data)-1); data/libapache2-mod-auth-pubtkt-0.13/src/mod_auth_pubtkt.c:404:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(tkt->bauth, value, sizeof(tkt->bauth)-1); data/libapache2-mod-auth-pubtkt-0.13/src/mod_auth_pubtkt.c:431:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t cknamelen = strlen(cr->cookie_name); data/libapache2-mod-auth-pubtkt-0.13/src/mod_auth_pubtkt.c:434:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(cookie_name, cr->cookie_name, cknamelen); data/libapache2-mod-auth-pubtkt-0.13/src/mod_auth_pubtkt.c:451: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). len = strlen(cookiebuf); data/libapache2-mod-auth-pubtkt-0.13/src/mod_auth_pubtkt.c:544: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). ticket_len = strlen(ticket_decoded); data/libapache2-mod-auth-pubtkt-0.13/src/mod_auth_pubtkt.c:604: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 (!cr->cookie || strlen(cr->cookie) < MIN_AUTH_COOKIE_SIZE) data/libapache2-mod-auth-pubtkt-0.13/src/mod_auth_pubtkt.c:621: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(ticket) > MAX_TICKET_SIZE) { data/libapache2-mod-auth-pubtkt-0.13/src/mod_auth_pubtkt.c:659: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). sig_buf = (char*)apr_palloc(r->pool, strlen(sigptr) + 1); data/libapache2-mod-auth-pubtkt-0.13/src/mod_auth_pubtkt.c:685: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). if (!EVP_VerifyUpdate(ctx, tktval_buf, strlen(tktval_buf))) { data/libapache2-mod-auth-pubtkt-0.13/src/mod_auth_pubtkt.c:745:23: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t token_len = strlen(auth_tokens[i]); data/libapache2-mod-auth-pubtkt-0.13/src/mod_auth_pubtkt.c:815: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). char *copy = apr_palloc(p, 3 * strlen(segment) + 1); ANALYSIS SUMMARY: Hits = 30 Lines analyzed = 1592 in approximately 0.34 seconds (4637 lines/second) Physical Source Lines of Code (SLOC) = 1218 Hits@level = [0] 20 [1] 17 [2] 13 [3] 0 [4] 0 [5] 0 Hits@level+ = [0+] 50 [1+] 30 [2+] 13 [3+] 0 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 41.0509 [1+] 24.6305 [2+] 10.6732 [3+] 0 [4+] 0 [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.