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/libcrypt-u2f-server-perl-0.45/u2f.h Examining data/libcrypt-u2f-server-perl-0.45/ppport.h Examining data/libcrypt-u2f-server-perl-0.45/u2f.c FINAL RESULTS: data/libcrypt-u2f-server-perl-0.45/ppport.h:7084:14: [4] (format) vsnprintf: 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. retval = vsnprintf(buffer, len, format, ap); data/libcrypt-u2f-server-perl-0.45/ppport.h:7086:14: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. retval = vsprintf(buffer, format, ap); data/libcrypt-u2f-server-perl-0.45/ppport.h:7115:5: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. vsprintf(buffer, pat, args); data/libcrypt-u2f-server-perl-0.45/u2f.c:70:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(errorstring, "error: u2fs_global_init (%d): %s", rc, data/libcrypt-u2f-server-perl-0.45/u2f.c:83:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(errorstring, "error: u2fs_init (%d): %s", rc, u2fs_strerror(rc)); data/libcrypt-u2f-server-perl-0.45/u2f.c:95:7: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(errorstring, "error: u2fs_set_keyHandle (%d): %s", rc, data/libcrypt-u2f-server-perl-0.45/u2f.c:109:7: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(errorstring, "error: u2fs_set_publicKey (%d): %s", rc, data/libcrypt-u2f-server-perl-0.45/u2f.c:122:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(errorstring, "error: u2fs_set_origin (%d): %s", rc, u2fs_strerror(rc)); data/libcrypt-u2f-server-perl-0.45/u2f.c:133:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(errorstring, "error: u2fs_set_appid (%d): %s", rc, data/libcrypt-u2f-server-perl-0.45/u2f.c:145:7: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(errorstring, "error: u2fs_set_challenge (%d): %s", rc, data/libcrypt-u2f-server-perl-0.45/u2f.c:157:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(errorstring, "error (%d): %s", rc, u2fs_strerror(rc)); data/libcrypt-u2f-server-perl-0.45/u2f.c:168:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(errorstring, "error (%d): %s", rc, u2fs_strerror(rc)); data/libcrypt-u2f-server-perl-0.45/u2f.c:181:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(errorstring, "error (%d): %s", rc, u2fs_strerror(rc)); data/libcrypt-u2f-server-perl-0.45/u2f.c:205:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(errorstring, "Authentication failed: %s", u2fs_strerror(rc)); data/libcrypt-u2f-server-perl-0.45/u2f.c:209:7: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(errorstring, "error: u2fs_authentication_verify (%d): %s", rc, data/libcrypt-u2f-server-perl-0.45/ppport.h:4025:42: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. # define CopyD(s,d,n,t) memcpy((char*)(d),(char*)(s), (n) * sizeof(t)) data/libcrypt-u2f-server-perl-0.45/ppport.h:6939:38: [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. && (xdigit = strchr((char *) PL_hexdigit, s[1]))) data/libcrypt-u2f-server-perl-0.45/ppport.h:7161: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(dst + used, src, copy); data/libcrypt-u2f-server-perl-0.45/ppport.h:7190: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(dst, src, copy); data/libcrypt-u2f-server-perl-0.45/ppport.h:7282: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 octbuf[32] = "%123456789ABCDF"; data/libcrypt-u2f-server-perl-0.45/ppport.h:7352: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 tmp[2]; data/libcrypt-u2f-server-perl-0.45/u2f.c:56:1: [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 errorstring[10000]; data/libcrypt-u2f-server-perl-0.45/u2f.c:57:1: [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 kh[1000]; data/libcrypt-u2f-server-perl-0.45/u2f.c:184: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(pk, u2fs_get_registration_publicKey(reg_result), U2FS_PUBLIC_KEY_LEN); data/libcrypt-u2f-server-perl-0.45/ppport.h:5529: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). sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*)); data/libcrypt-u2f-server-perl-0.45/ppport.h:5537:59: [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). # define sv_vcatpvf(sv, pat, args) sv_vcatpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*)) data/libcrypt-u2f-server-perl-0.45/ppport.h:5541:59: [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). # define sv_vsetpvf(sv, pat, args) sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*)) data/libcrypt-u2f-server-perl-0.45/ppport.h:5561: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). sv_vcatpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*)); data/libcrypt-u2f-server-perl-0.45/ppport.h:5589: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). sv_vcatpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*)); data/libcrypt-u2f-server-perl-0.45/ppport.h:5610: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). sv_vcatpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*)); \ data/libcrypt-u2f-server-perl-0.45/ppport.h:5632: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). sv_vsetpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*)); data/libcrypt-u2f-server-perl-0.45/ppport.h:5660: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). sv_vsetpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*)); data/libcrypt-u2f-server-perl-0.45/ppport.h:5681: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). sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*)); \ data/libcrypt-u2f-server-perl-0.45/ppport.h:5735:65: [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). # define HvNAMELEN_get(hv) (HvNAME_get(hv) ? (I32)strlen(HvNAME_get(hv)) : 0) data/libcrypt-u2f-server-perl-0.45/ppport.h:6533: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). STRLEN len = strlen(radix); data/libcrypt-u2f-server-perl-0.45/ppport.h:7117: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). return strlen(buffer); data/libcrypt-u2f-server-perl-0.45/ppport.h:7157: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). used = strlen(dst); data/libcrypt-u2f-server-perl-0.45/ppport.h:7158:14: [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). length = strlen(src); data/libcrypt-u2f-server-perl-0.45/ppport.h:7187:14: [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). length = strlen(src); data/libcrypt-u2f-server-perl-0.45/u2f.c:186:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(kh, u2fs_get_registration_keyHandle(reg_result), 1000); ANALYSIS SUMMARY: Hits = 40 Lines analyzed = 7736 in approximately 0.18 seconds (42714 lines/second) Physical Source Lines of Code (SLOC) = 3289 Hits@level = [0] 0 [1] 16 [2] 9 [3] 0 [4] 15 [5] 0 Hits@level+ = [0+] 40 [1+] 40 [2+] 24 [3+] 15 [4+] 15 [5+] 0 Hits/KSLOC@level+ = [0+] 12.1618 [1+] 12.1618 [2+] 7.29705 [3+] 4.56066 [4+] 4.56066 [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.