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/stealth-4.02.00/documentation/manual/usage.cc Examining data/stealth-4.02.00/integrityscanner/put.cc Examining data/stealth-4.02.00/integrityscanner/skip.cc Examining data/stealth-4.02.00/integrityscanner/get.cc Examining data/stealth-4.02.00/integrityscanner/data.cc Examining data/stealth-4.02.00/integrityscanner/integrityscanner1.cc Examining data/stealth-4.02.00/integrityscanner/sameoutput.cc Examining data/stealth-4.02.00/integrityscanner/nodifferences.cc Examining data/stealth-4.02.00/integrityscanner/getpath.cc Examining data/stealth-4.02.00/integrityscanner/local.cc Examining data/stealth-4.02.00/integrityscanner/foreground.cc Examining data/stealth-4.02.00/integrityscanner/run.cc Examining data/stealth-4.02.00/integrityscanner/read.cc Examining data/stealth-4.02.00/integrityscanner/addto.cc Examining data/stealth-4.02.00/integrityscanner/removelog.cc Examining data/stealth-4.02.00/integrityscanner/doplaincommand.cc Examining data/stealth-4.02.00/integrityscanner/execute.cc Examining data/stealth-4.02.00/integrityscanner/removefirstword.cc Examining data/stealth-4.02.00/integrityscanner/testexitvalue.cc Examining data/stealth-4.02.00/integrityscanner/nextcommand.cc Examining data/stealth-4.02.00/integrityscanner/setsentinel.cc Examining data/stealth-4.02.00/integrityscanner/filename.cc Examining data/stealth-4.02.00/integrityscanner/remote.cc Examining data/stealth-4.02.00/integrityscanner/datetime.cc Examining data/stealth-4.02.00/integrityscanner/integrityscanner.h Examining data/stealth-4.02.00/integrityscanner/replace.cc Examining data/stealth-4.02.00/integrityscanner/checksize.cc Examining data/stealth-4.02.00/integrityscanner/killchildren.cc Examining data/stealth-4.02.00/integrityscanner/putcommand.cc Examining data/stealth-4.02.00/integrityscanner/setskip.cc Examining data/stealth-4.02.00/integrityscanner/docheckcommand.cc Examining data/stealth-4.02.00/integrityscanner/skipdecision.cc Examining data/stealth-4.02.00/integrityscanner/write.cc Examining data/stealth-4.02.00/integrityscanner/startcommandshells.cc Examining data/stealth-4.02.00/integrityscanner/loadskipfiles.cc Examining data/stealth-4.02.00/integrityscanner/waitforsentinel.cc Examining data/stealth-4.02.00/integrityscanner/copy.cc Examining data/stealth-4.02.00/logunit/newlog.cc Examining data/stealth-4.02.00/logunit/setuplogs2.cc Examining data/stealth-4.02.00/logunit/logunit.h Examining data/stealth-4.02.00/logunit/newsyslogstream.cc Examining data/stealth-4.02.00/logunit/logunit1.cc Examining data/stealth-4.02.00/logunit/setuplogs1.cc Examining data/stealth-4.02.00/main.cc Examining data/stealth-4.02.00/msg/data.cc Examining data/stealth-4.02.00/msg/msg2.cc Examining data/stealth-4.02.00/msg/msg1.cc Examining data/stealth-4.02.00/msg/setverbosity.cc Examining data/stealth-4.02.00/msg/driver/driver.cc Examining data/stealth-4.02.00/msg/msg.h Examining data/stealth-4.02.00/options/checkmode.cc Examining data/stealth-4.02.00/options/data.cc Examining data/stealth-4.02.00/options/getcwd.cc Examining data/stealth-4.02.00/options/options1.cc Examining data/stealth-4.02.00/options/checkm.cc Examining data/stealth-4.02.00/options/setrepeat.cc Examining data/stealth-4.02.00/options/usage.cc Examining data/stealth-4.02.00/options/randomaddition.cc Examining data/stealth-4.02.00/options/setrandomdelay.cc Examining data/stealth-4.02.00/options/rfc2822.cc Examining data/stealth-4.02.00/options/setcommandnr.cc Examining data/stealth-4.02.00/options/setskipfile.cc Examining data/stealth-4.02.00/options/setdownloadsize.cc Examining data/stealth-4.02.00/options/setsyslog.cc Examining data/stealth-4.02.00/options/setlog.cc Examining data/stealth-4.02.00/options/setmode.cc Examining data/stealth-4.02.00/options/options.h Examining data/stealth-4.02.00/options/setsyslogfacility.cc Examining data/stealth-4.02.00/options/foregroundonly.cc Examining data/stealth-4.02.00/options/setpolicypath.cc Examining data/stealth-4.02.00/options/requiresomeargument.cc Examining data/stealth-4.02.00/options/setstdout.cc Examining data/stealth-4.02.00/options/setverbosity.cc Examining data/stealth-4.02.00/options/settimestamp.cc Examining data/stealth-4.02.00/options/oldoptions.cc Examining data/stealth-4.02.00/options/setparsepolicy.cc Examining data/stealth-4.02.00/options/setconfigoptions.cc Examining data/stealth-4.02.00/options/setmail.cc Examining data/stealth-4.02.00/options/setsyslogpriority.cc Examining data/stealth-4.02.00/policyfile/insert.cc Examining data/stealth-4.02.00/policyfile/chdirbase.cc Examining data/stealth-4.02.00/policyfile/data.cc Examining data/stealth-4.02.00/policyfile/policyfile.h Examining data/stealth-4.02.00/policyfile/policyfile1.cc Examining data/stealth-4.02.00/policyfile/replacedefines.cc Examining data/stealth-4.02.00/policyfile/fixrelativelocations.cc Examining data/stealth-4.02.00/policyfile/directivesandcommands.cc Examining data/stealth-4.02.00/policyfile/loadoptions.cc Examining data/stealth-4.02.00/policyfile/fetchcommands.cc Examining data/stealth-4.02.00/policyfile/load.cc Examining data/stealth-4.02.00/report/refresh.cc Examining data/stealth-4.02.00/report/rewind.cc Examining data/stealth-4.02.00/report/hasmail.cc Examining data/stealth-4.02.00/report/sendmail.cc Examining data/stealth-4.02.00/report/processmail.cc Examining data/stealth-4.02.00/report/report1.cc Examining data/stealth-4.02.00/report/demo/demo.cc Examining data/stealth-4.02.00/report/demo/demo.h Examining data/stealth-4.02.00/report/timestamp.cc Examining data/stealth-4.02.00/report/mail.cc Examining data/stealth-4.02.00/report/report.h Examining data/stealth-4.02.00/report/destructor.cc Examining data/stealth-4.02.00/report/scanheader.cc Examining data/stealth-4.02.00/runmode/data.cc Examining data/stealth-4.02.00/runmode/runmode.h Examining data/stealth-4.02.00/runmode/setmode.cc Examining data/stealth-4.02.00/stealth/parentprocess.cc Examining data/stealth-4.02.00/stealth/incomingrequest.cc Examining data/stealth-4.02.00/stealth/overflow.cc Examining data/stealth-4.02.00/stealth/terminate.cc Examining data/stealth-4.02.00/stealth/data.cc Examining data/stealth-4.02.00/stealth/mailreport.cc Examining data/stealth-4.02.00/stealth/logreportbuf1.cc Examining data/stealth-4.02.00/stealth/reload.cc Examining data/stealth-4.02.00/stealth/acceptmode.cc Examining data/stealth-4.02.00/stealth/waitforkey.cc Examining data/stealth-4.02.00/stealth/policymode.cc Examining data/stealth-4.02.00/stealth/childprocess.cc Examining data/stealth-4.02.00/stealth/reloadrequest.cc Examining data/stealth-4.02.00/stealth/ipcinterface.cc Examining data/stealth-4.02.00/stealth/suspendrequest.cc Examining data/stealth-4.02.00/stealth/terminaterequest.cc Examining data/stealth-4.02.00/stealth/setuniqueptrs.cc Examining data/stealth-4.02.00/stealth/rerun.cc Examining data/stealth-4.02.00/stealth/stealth1.cc Examining data/stealth-4.02.00/stealth/resumerequest.cc Examining data/stealth-4.02.00/stealth/suspend.cc Examining data/stealth-4.02.00/stealth/resume.cc Examining data/stealth-4.02.00/stealth/ipcmode.cc Examining data/stealth-4.02.00/stealth/unknownrequest.cc Examining data/stealth-4.02.00/stealth/autoscan.cc Examining data/stealth-4.02.00/stealth/integrityscan.cc Examining data/stealth-4.02.00/stealth/sync.cc Examining data/stealth-4.02.00/stealth/destructor.cc Examining data/stealth-4.02.00/stealth/jobshandler.cc Examining data/stealth-4.02.00/stealth/notifytask.cc Examining data/stealth-4.02.00/stealth/deniedmode.cc Examining data/stealth-4.02.00/stealth/pingrequest.cc Examining data/stealth-4.02.00/stealth/stealth.h Examining data/stealth-4.02.00/stealth/rerunrequest.cc Examining data/stealth-4.02.00/stealth/dotasks.cc Examining data/stealth-4.02.00/stealth/setupfatalreport.cc Examining data/stealth-4.02.00/stealth/nextjob.cc Examining data/stealth-4.02.00/stealthenums/stealthenums.h Examining data/stealth-4.02.00/syslogstruct/syslogstruct.h Examining data/stealth-4.02.00/util/abspath.cc Examining data/stealth-4.02.00/util/mkdir.cc Examining data/stealth-4.02.00/util/realpath.cc Examining data/stealth-4.02.00/util/util.h Examining data/stealth-4.02.00/version.cc Examining data/stealth-4.02.00/VERSION.h FINAL RESULTS: data/stealth-4.02.00/integrityscanner/sameoutput.cc:15:9: [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 (access(logfile.c_str(), R_OK) != 0) // no old report yet data/stealth-4.02.00/logunit/setuplogs1.cc:18:25: [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. unique_ptr<ostream> syslog(newSyslogStream()); data/stealth-4.02.00/logunit/setuplogs1.cc:28:9: [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. if (syslog.get() != 0) data/stealth-4.02.00/logunit/setuplogs1.cc:30:23: [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. d_syslog.swap(syslog); // install the new syslogbuf data/stealth-4.02.00/options/options1.cc:38:13: [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 (access(d_unixDomainSocket.c_str(), F_OK) == 0) data/stealth-4.02.00/options/options1.cc:49:9: [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. access(d_skipFile.c_str(), R_OK) != 0 data/stealth-4.02.00/integrityscanner/foreground.cc:16:10: [3] (random) setstate: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. cout.setstate(ios::failbit); data/stealth-4.02.00/msg/setverbosity.cc:9:16: [3] (random) setstate: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. m1.setstate(ios::failbit); data/stealth-4.02.00/msg/setverbosity.cc:11:16: [3] (random) setstate: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. m2.setstate(ios::failbit); data/stealth-4.02.00/msg/setverbosity.cc:13:16: [3] (random) setstate: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. m3.setstate(ios::failbit); data/stealth-4.02.00/options/randomaddition.cc:6:36: [3] (random) random: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. d_delayInterval * (random() / (RAND_MAX + 1.0)) data/stealth-4.02.00/options/setparsepolicy.cc:5:8: [3] (random) setstate: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. mp.setstate(ios::failbit); data/stealth-4.02.00/options/setrandomdelay.cc:16:5: [3] (random) srandom: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srandom(time(0)); // seed the random time generator data/stealth-4.02.00/integrityscanner/datetime.cc:7: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[80]; data/stealth-4.02.00/integrityscanner/write.cc:17: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 buffer[SIZEOF_BUF]; data/stealth-4.02.00/policyfile/loadoptions.cc:19:27: [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). ArgConfig::instance().open(tmpStream.fileName()); data/stealth-4.02.00/report/report1.cc:13:9: [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). open(d_name, ios::out | ios::in | ios::trunc); data/stealth-4.02.00/stealth/ipcmode.cc:13:13: [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). uds.open(d_options.unixDomainSocket()); data/stealth-4.02.00/util/mkdir.cc:5: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[path.length() + 1]; data/stealth-4.02.00/integrityscanner/get.cc:35:5: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read(d_sshFork, destination); // read its output, tests exit value data/stealth-4.02.00/integrityscanner/integrityscanner.h:127:21: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FBB::Process &src, std::string const &fname); data/stealth-4.02.00/integrityscanner/read.cc:5:24: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void IntegrityScanner::read(Process &src, string const &fname) data/stealth-4.02.00/integrityscanner/read.cc:20:21: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (not src.read(&c, 1)) // read char by char data/stealth-4.02.00/integrityscanner/replace.cc:6: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). size_t orglen = strlen(org); data/stealth-4.02.00/integrityscanner/write.cc:19:31: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). size_t nRead = source.read(buffer, SIZEOF_BUF).gcount(); ANALYSIS SUMMARY: Hits = 25 Lines analyzed = 4162 in approximately 0.16 seconds (26284 lines/second) Physical Source Lines of Code (SLOC) = 2809 Hits@level = [0] 0 [1] 6 [2] 6 [3] 7 [4] 6 [5] 0 Hits@level+ = [0+] 25 [1+] 25 [2+] 19 [3+] 13 [4+] 6 [5+] 0 Hits/KSLOC@level+ = [0+] 8.89996 [1+] 8.89996 [2+] 6.76397 [3+] 4.62798 [4+] 2.13599 [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.