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/lcmaps-plugins-voms-1.7.1/src/utils/lcmaps_plugin_prototypes.h Examining data/lcmaps-plugins-voms-1.7.1/src/utils/lcmaps_gridmapfile.c Examining data/lcmaps-plugins-voms-1.7.1/src/utils/lcmaps_gridmapdir.c Examining data/lcmaps-plugins-voms-1.7.1/src/utils/lcmaps_gridmapdir.h Examining data/lcmaps-plugins-voms-1.7.1/src/utils/lcmaps_gridmapfile.h Examining data/lcmaps-plugins-voms-1.7.1/src/voms/lcmaps_voms.c Examining data/lcmaps-plugins-voms-1.7.1/src/voms/lcmaps_voms_poolaccount.c Examining data/lcmaps-plugins-voms-1.7.1/src/voms/lcmaps_ban_fqan.c Examining data/lcmaps-plugins-voms-1.7.1/src/voms/lcmaps_voms_localaccount.c Examining data/lcmaps-plugins-voms-1.7.1/src/voms/lcmaps_voms_localgroup.c Examining data/lcmaps-plugins-voms-1.7.1/src/voms/lcmaps_voms_poolgroup.c FINAL RESULTS: data/lcmaps-plugins-voms-1.7.1/src/utils/lcmaps_gridmapfile.c:307:10: [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. len=snprintf(path, 0, SECURITY_DIR"%s", file); data/lcmaps-plugins-voms-1.7.1/src/utils/lcmaps_gridmapfile.c:317:6: [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(path, (size_t)(len+1), SECURITY_DIR"%s", file); data/lcmaps-plugins-voms-1.7.1/src/utils/lcmaps_gridmapfile.c:507:7: [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. len=snprintf(path,0, "%s/"LOCAL_GRIDMAP, pw->pw_dir); data/lcmaps-plugins-voms-1.7.1/src/utils/lcmaps_gridmapfile.c:517:3: [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(path,(size_t)(len+1),"%s/"LOCAL_GRIDMAP, data/lcmaps-plugins-voms-1.7.1/src/utils/lcmaps_gridmapdir.c:317:18: [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. if ( (char_p=getenv("GRIDMAPDIR"))==NULL || char_p[0]=='\0') { data/lcmaps-plugins-voms-1.7.1/src/utils/lcmaps_gridmapfile.c:472:38: [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. if ( ( (env="GRIDMAP", char_p = getenv(env))!= NULL || data/lcmaps-plugins-voms-1.7.1/src/utils/lcmaps_gridmapfile.c:473: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. (env="GLOBUSMAP",char_p = getenv(env))!= NULL || data/lcmaps-plugins-voms-1.7.1/src/utils/lcmaps_gridmapfile.c:474: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. (env="globusmap",char_p = getenv(env))!= NULL || data/lcmaps-plugins-voms-1.7.1/src/utils/lcmaps_gridmapfile.c:475: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. (env="GlobusMap",char_p = getenv(env))!= NULL ) && char_p[0]!='\0') data/lcmaps-plugins-voms-1.7.1/src/voms/lcmaps_voms_poolgroup.c:604:15: [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. if ( (char_p=getenv("GROUPMAPDIR"))==NULL || char_p[0]=='\0') { data/lcmaps-plugins-voms-1.7.1/src/utils/lcmaps_gridmapdir.c:969: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). if ( (fd=open(mapping_filename, O_WRONLY|O_APPEND)) < 0 ) { data/lcmaps-plugins-voms-1.7.1/src/utils/lcmaps_gridmapfile.c:396: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). if ( (fd=open(filename,O_RDONLY))<0) { data/lcmaps-plugins-voms-1.7.1/src/utils/lcmaps_gridmapdir.c:362: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). if ( strlen(mapping) < (poollen=strlen(pool)) || data/lcmaps-plugins-voms-1.7.1/src/utils/lcmaps_gridmapdir.c:362: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). if ( strlen(mapping) < (poollen=strlen(pool)) || data/lcmaps-plugins-voms-1.7.1/src/utils/lcmaps_gridmapdir.c:399: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). leaselen=strlen(oldlease)+15; data/lcmaps-plugins-voms-1.7.1/src/utils/lcmaps_gridmapdir.c:440: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=3*strlen(idp)+1; data/lcmaps-plugins-voms-1.7.1/src/utils/lcmaps_gridmapdir.c:453:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buffer+j,idp+i+1,len-j); data/lcmaps-plugins-voms-1.7.1/src/utils/lcmaps_gridmapfile.c:233: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). if (strncmp(mapping, searchstr, strlen(searchstr))==0) { data/lcmaps-plugins-voms-1.7.1/src/utils/lcmaps_gridmapfile.c:238: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). if (strncmp(mapping, searchstr, strlen(searchstr))!=0) { data/lcmaps-plugins-voms-1.7.1/src/utils/lcmaps_gridmapfile.c:423:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd,mybuffer,size)!=(ssize_t)size) { data/lcmaps-plugins-voms-1.7.1/src/voms/lcmaps_voms_poolaccount.c:959: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). leasenamelen = strlen(dn) + strlen(gidbuffer) + 1; data/lcmaps-plugins-voms-1.7.1/src/voms/lcmaps_voms_poolaccount.c:959: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). leasenamelen = strlen(dn) + strlen(gidbuffer) + 1; data/lcmaps-plugins-voms-1.7.1/src/voms/lcmaps_voms_poolaccount.c:1203: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). len=1+strlen(group_info->gr_name); data/lcmaps-plugins-voms-1.7.1/src/voms/lcmaps_voms_poolaccount.c:1223:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(&(gidbuffer[*my_index+1]), group_info->gr_name, len); ANALYSIS SUMMARY: Hits = 24 Lines analyzed = 6044 in approximately 0.40 seconds (15194 lines/second) Physical Source Lines of Code (SLOC) = 3111 Hits@level = [0] 5 [1] 12 [2] 2 [3] 6 [4] 4 [5] 0 Hits@level+ = [0+] 29 [1+] 24 [2+] 12 [3+] 10 [4+] 4 [5+] 0 Hits/KSLOC@level+ = [0+] 9.32176 [1+] 7.71456 [2+] 3.85728 [3+] 3.2144 [4+] 1.28576 [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.