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/anytun-0.3.7/src/anyrtpproxy/anyrtpproxy.cpp Examining data/anytun-0.3.7/src/anyrtpproxy/callIdQueue.cpp Examining data/anytun-0.3.7/src/anyrtpproxy/callIdQueue.h Examining data/anytun-0.3.7/src/anyrtpproxy/commandHandler.cpp Examining data/anytun-0.3.7/src/anyrtpproxy/commandHandler.h Examining data/anytun-0.3.7/src/anyrtpproxy/connectionList.cpp Examining data/anytun-0.3.7/src/anyrtpproxy/connectionList.h Examining data/anytun-0.3.7/src/anyrtpproxy/options.cpp Examining data/anytun-0.3.7/src/anyrtpproxy/options.h Examining data/anytun-0.3.7/src/anyrtpproxy/portWindow.cpp Examining data/anytun-0.3.7/src/anyrtpproxy/portWindow.h Examining data/anytun-0.3.7/src/anyrtpproxy/rtpSession.cpp Examining data/anytun-0.3.7/src/anyrtpproxy/rtpSession.h Examining data/anytun-0.3.7/src/anyrtpproxy/rtpSessionTable.cpp Examining data/anytun-0.3.7/src/anyrtpproxy/rtpSessionTable.h Examining data/anytun-0.3.7/src/anyrtpproxy/syncRtpCommand.cpp Examining data/anytun-0.3.7/src/anyrtpproxy/syncRtpCommand.h Examining data/anytun-0.3.7/src/anytun-config.cpp Examining data/anytun-0.3.7/src/anytun-controld.cpp Examining data/anytun-0.3.7/src/anytun-showtables.cpp Examining data/anytun-0.3.7/src/anytun.cpp Examining data/anytun-0.3.7/src/anytunError.h Examining data/anytun-0.3.7/src/authAlgo.cpp Examining data/anytun-0.3.7/src/authAlgo.h Examining data/anytun-0.3.7/src/authAlgoFactory.cpp Examining data/anytun-0.3.7/src/authAlgoFactory.h Examining data/anytun-0.3.7/src/bsd/tunDevice.cpp Examining data/anytun-0.3.7/src/buffer.cpp Examining data/anytun-0.3.7/src/buffer.h Examining data/anytun-0.3.7/src/cipher.cpp Examining data/anytun-0.3.7/src/cipher.h Examining data/anytun-0.3.7/src/cipherFactory.cpp Examining data/anytun-0.3.7/src/cipherFactory.h Examining data/anytun-0.3.7/src/connectionList.cpp Examining data/anytun-0.3.7/src/connectionList.h Examining data/anytun-0.3.7/src/connectionParam.cpp Examining data/anytun-0.3.7/src/connectionParam.h Examining data/anytun-0.3.7/src/cryptinit.hpp Examining data/anytun-0.3.7/src/datatypes.h Examining data/anytun-0.3.7/src/deviceConfig.hpp Examining data/anytun-0.3.7/src/encryptedPacket.cpp Examining data/anytun-0.3.7/src/encryptedPacket.h Examining data/anytun-0.3.7/src/endian.h Examining data/anytun-0.3.7/src/keyDerivation.cpp Examining data/anytun-0.3.7/src/keyDerivation.h Examining data/anytun-0.3.7/src/keyDerivationFactory.cpp Examining data/anytun-0.3.7/src/keyDerivationFactory.h Examining data/anytun-0.3.7/src/linux/tunDevice.cpp Examining data/anytun-0.3.7/src/log.cpp Examining data/anytun-0.3.7/src/log.h Examining data/anytun-0.3.7/src/logTargets.cpp Examining data/anytun-0.3.7/src/logTargets.h Examining data/anytun-0.3.7/src/networkAddress.cpp Examining data/anytun-0.3.7/src/networkAddress.h Examining data/anytun-0.3.7/src/networkPrefix.cpp Examining data/anytun-0.3.7/src/networkPrefix.h Examining data/anytun-0.3.7/src/nullDaemon.cpp Examining data/anytun-0.3.7/src/nullDaemon.h Examining data/anytun-0.3.7/src/options.cpp Examining data/anytun-0.3.7/src/options.h Examining data/anytun-0.3.7/src/packetSource.cpp Examining data/anytun-0.3.7/src/packetSource.h Examining data/anytun-0.3.7/src/plainPacket.cpp Examining data/anytun-0.3.7/src/plainPacket.h Examining data/anytun-0.3.7/src/posix/posixDaemon.cpp Examining data/anytun-0.3.7/src/posix/posixDaemon.h Examining data/anytun-0.3.7/src/posix/signalHandler.hpp Examining data/anytun-0.3.7/src/posix/sysExec.hpp Examining data/anytun-0.3.7/src/resolver.h Examining data/anytun-0.3.7/src/routingTable.cpp Examining data/anytun-0.3.7/src/routingTable.h Examining data/anytun-0.3.7/src/routingTree.hpp Examining data/anytun-0.3.7/src/routingTreeNode.cpp Examining data/anytun-0.3.7/src/routingTreeNode.h Examining data/anytun-0.3.7/src/seqWindow.cpp Examining data/anytun-0.3.7/src/seqWindow.h Examining data/anytun-0.3.7/src/signalController.cpp Examining data/anytun-0.3.7/src/signalController.h Examining data/anytun-0.3.7/src/syncBuffer.cpp Examining data/anytun-0.3.7/src/syncBuffer.h Examining data/anytun-0.3.7/src/syncClient.cpp Examining data/anytun-0.3.7/src/syncClient.h Examining data/anytun-0.3.7/src/syncCommand.cpp Examining data/anytun-0.3.7/src/syncCommand.h Examining data/anytun-0.3.7/src/syncConnectionCommand.cpp Examining data/anytun-0.3.7/src/syncConnectionCommand.h Examining data/anytun-0.3.7/src/syncOnConnect.hpp Examining data/anytun-0.3.7/src/syncQueue.cpp Examining data/anytun-0.3.7/src/syncQueue.h Examining data/anytun-0.3.7/src/syncRouteCommand.cpp Examining data/anytun-0.3.7/src/syncRouteCommand.h Examining data/anytun-0.3.7/src/syncServer.h Examining data/anytun-0.3.7/src/sysExec.cpp Examining data/anytun-0.3.7/src/sysExec.h Examining data/anytun-0.3.7/src/threadUtils.hpp Examining data/anytun-0.3.7/src/tunDevice.h Examining data/anytun-0.3.7/src/win32/common.h Examining data/anytun-0.3.7/src/win32/registryKey.cpp Examining data/anytun-0.3.7/src/win32/registryKey.h Examining data/anytun-0.3.7/src/win32/signalHandler.hpp Examining data/anytun-0.3.7/src/win32/signalServiceHandler.hpp Examining data/anytun-0.3.7/src/win32/sysExec.hpp Examining data/anytun-0.3.7/src/win32/tunDevice.cpp Examining data/anytun-0.3.7/src/win32/winService.cpp Examining data/anytun-0.3.7/src/win32/winService.h Examining data/anytun-0.3.7/src/anytunError.cpp Examining data/anytun-0.3.7/src/resolver.cpp Examining data/anytun-0.3.7/src/syncServer.cpp Examining data/anytun-0.3.7/src/syncTcpConnection.cpp Examining data/anytun-0.3.7/src/syncTcpConnection.h FINAL RESULTS: data/anytun-0.3.7/src/anyrtpproxy/rtpSession.h:91:38: [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. friend class boost::serialization::access; data/anytun-0.3.7/src/anyrtpproxy/syncRtpCommand.h:64:38: [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. friend class boost::serialization::access; data/anytun-0.3.7/src/anytunError.cpp:67:10: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. boost::system::system_error err(boost::system::error_code(value.err_, boost::system::system_category())); data/anytun-0.3.7/src/anytunError.cpp:67:42: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. boost::system::system_error err(boost::system::error_code(value.err_, boost::system::system_category())); data/anytun-0.3.7/src/anytunError.cpp:67:80: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. boost::system::system_error err(boost::system::error_code(value.err_, boost::system::system_category())); data/anytun-0.3.7/src/connectionParam.h:72:38: [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. friend class boost::serialization::access; data/anytun-0.3.7/src/keyDerivation.h:108:38: [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. friend class boost::serialization::access; data/anytun-0.3.7/src/keyDerivation.h:150:38: [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. friend class boost::serialization::access; data/anytun-0.3.7/src/keyDerivation.h:182:38: [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. friend class boost::serialization::access; data/anytun-0.3.7/src/networkAddress.h:102:38: [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. friend class boost::serialization::access; data/anytun-0.3.7/src/networkPrefix.h:69:38: [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. friend class boost::serialization::access; data/anytun-0.3.7/src/resolver.cpp:83:53: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. void ResolveHandler<Proto>::operator()(const boost::system::error_code& e, boost::asio::ip::basic_resolver_iterator<Proto> endpointIt) data/anytun-0.3.7/src/resolver.cpp:85:13: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. if(boost::system::posix_error::success == e) { data/anytun-0.3.7/src/resolver.h:65:32: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. void operator()(const boost::system::error_code& e, boost::asio::ip::basic_resolver_iterator<Proto>); data/anytun-0.3.7/src/seqWindow.h:91:38: [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. friend class boost::serialization::access; data/anytun-0.3.7/src/syncBuffer.h:67:38: [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. friend class boost::serialization::access; data/anytun-0.3.7/src/syncClient.cpp:80:14: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. boost::system::error_code error = boost::asio::error::host_not_found; data/anytun-0.3.7/src/syncClient.cpp:86:22: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. throw boost::system::system_error(error); data/anytun-0.3.7/src/syncClient.cpp:128:12: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. boost::system::error_code error; data/anytun-0.3.7/src/syncClient.cpp:133:20: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. throw boost::system::system_error(error); // Some other error. data/anytun-0.3.7/src/syncCommand.h:71:38: [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. friend class boost::serialization::access; data/anytun-0.3.7/src/syncConnectionCommand.h:66:38: [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. friend class boost::serialization::access; data/anytun-0.3.7/src/syncRouteCommand.h:67:38: [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. friend class boost::serialization::access; data/anytun-0.3.7/src/syncServer.cpp:141:88: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. void SyncServer::handle_accept(SyncTcpConnection::pointer new_connection, const boost::system::error_code& error, std::list<AcceptorsElement>::iterator it) data/anytun-0.3.7/src/syncServer.h:87:78: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. void handle_accept(SyncTcpConnection::pointer new_connection, const boost::system::error_code& error, std::list<AcceptorsElement>::iterator it); data/anytun-0.3.7/src/syncTcpConnection.cpp:82:51: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. void SyncTcpConnection::handle_write(const boost::system::error_code& /*error*/, data/anytun-0.3.7/src/syncTcpConnection.h:85:34: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. void handle_write(const boost::system::error_code & /*error*/, data/anytun-0.3.7/src/anyrtpproxy/anyrtpproxy.cpp:226:8: [3] (misc) chroot: chroot can be very helpful, but is hard to use correctly (CWE-250, CWE-22). Make sure the program immediately chdir("/"), closes file descriptors, and drops root privileges, and that all necessary files (and no more!) are in the new root. if(chroot(chrootdir.c_str())) { data/anytun-0.3.7/src/anytun-controld.cpp:129:15: [3] (misc) chroot: chroot can be very helpful, but is hard to use correctly (CWE-250, CWE-22). Make sure the program immediately chdir("/"), closes file descriptors, and drops root privileges, and that all necessary files (and no more!) are in the new root. service.chroot(gOpt.getChrootDir()); data/anytun-0.3.7/src/anytun.cpp:417:17: [3] (misc) chroot: chroot can be very helpful, but is hard to use correctly (CWE-250, CWE-22). Make sure the program immediately chdir("/"), closes file descriptors, and drops root privileges, and that all necessary files (and no more!) are in the new root. service.chroot(gOpt.getChrootDir()); data/anytun-0.3.7/src/nullDaemon.cpp:58:21: [3] (misc) chroot: chroot can be very helpful, but is hard to use correctly (CWE-250, CWE-22). Make sure the program immediately chdir("/"), closes file descriptors, and drops root privileges, and that all necessary files (and no more!) are in the new root. void DaemonService::chroot(std::string const& chrootdir) data/anytun-0.3.7/src/nullDaemon.h:56:8: [3] (misc) chroot: chroot can be very helpful, but is hard to use correctly (CWE-250, CWE-22). Make sure the program immediately chdir("/"), closes file descriptors, and drops root privileges, and that all necessary files (and no more!) are in the new root. void chroot(std::string const& dir); data/anytun-0.3.7/src/posix/posixDaemon.cpp:108:21: [3] (misc) chroot: chroot can be very helpful, but is hard to use correctly (CWE-250, CWE-22). Make sure the program immediately chdir("/"), closes file descriptors, and drops root privileges, and that all necessary files (and no more!) are in the new root. void DaemonService::chroot(std::string const& chrootdir) data/anytun-0.3.7/src/posix/posixDaemon.cpp:114:8: [3] (misc) chroot: chroot can be very helpful, but is hard to use correctly (CWE-250, CWE-22). Make sure the program immediately chdir("/"), closes file descriptors, and drops root privileges, and that all necessary files (and no more!) are in the new root. if(::chroot(chrootdir.c_str())) { data/anytun-0.3.7/src/posix/posixDaemon.h:58:8: [3] (misc) chroot: chroot can be very helpful, but is hard to use correctly (CWE-250, CWE-22). Make sure the program immediately chdir("/"), closes file descriptors, and drops root privileges, and that all necessary files (and no more!) are in the new root. void chroot(std::string const& dir); data/anytun-0.3.7/src/win32/winService.cpp:203:18: [3] (misc) chroot: chroot can be very helpful, but is hard to use correctly (CWE-250, CWE-22). Make sure the program immediately chdir("/"), closes file descriptors, and drops root privileges, and that all necessary files (and no more!) are in the new root. void WinService::chroot(std::string const& dir) data/anytun-0.3.7/src/win32/winService.h:70:8: [3] (misc) chroot: chroot can be very helpful, but is hard to use correctly (CWE-250, CWE-22). Make sure the program immediately chdir("/"), closes file descriptors, and drops root privileges, and that all necessary files (and no more!) are in the new root. void chroot(std::string const& dir); data/anytun-0.3.7/src/anyrtpproxy/anyrtpproxy.cpp:179:20: [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). ld->sock1_.open(session.getLocalEnd1().protocol()); data/anytun-0.3.7/src/anyrtpproxy/anyrtpproxy.cpp:182:20: [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). ld->sock2_.open(session.getLocalEnd2().protocol()); data/anytun-0.3.7/src/anyrtpproxy/anyrtpproxy.cpp:260:6: [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). fd=open("/dev/null",O_RDWR); // stdin data/anytun-0.3.7/src/anyrtpproxy/anyrtpproxy.cpp:324: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). pidFile.open(gOpt.getPidFile().c_str()); data/anytun-0.3.7/src/anyrtpproxy/commandHandler.cpp:73:17: [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). control_sock_.open(e.protocol()); data/anytun-0.3.7/src/anyrtpproxy/commandHandler.cpp:84:17: [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). control_sock_.open(e.protocol()); data/anytun-0.3.7/src/anytun-showtables.cpp:102: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 a[1]; data/anytun-0.3.7/src/anytunError.cpp:56:3: [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 buf[STERROR_TEXT_MAX]; data/anytun-0.3.7/src/authAlgo.cpp:171:8: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. std::memcpy(&tag[packet.getAuthTagLength() - length], &hmac[DIGEST_LENGTH - length], length); data/anytun-0.3.7/src/bsd/tunDevice.cpp:102:15: [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). fd_ = ::open(ds.str().c_str(), O_RDWR); data/anytun-0.3.7/src/bsd/tunDevice.cpp:108: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). fd_ = ::open(device_file.c_str(), O_RDWR); data/anytun-0.3.7/src/buffer.cpp:87:8: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. std::memcpy(buf_, data, length_); data/anytun-0.3.7/src/buffer.cpp:124:8: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. std::memcpy(buf_, src.buf_, length_); data/anytun-0.3.7/src/buffer.cpp:143:8: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. std::memcpy(buf_, src.buf_, length_); data/anytun-0.3.7/src/buffer.cpp:204:10: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. std::memcpy(buf_, old_buf, old_length); data/anytun-0.3.7/src/cipher.cpp:82:8: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. std::memcpy(out, in, (ilen < olen) ? ilen : olen); data/anytun-0.3.7/src/cipher.cpp:88:8: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. std::memcpy(out, in, (ilen < olen) ? ilen : olen); data/anytun-0.3.7/src/cipher.cpp:167:8: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. std::memcpy(ctr_.salt_.buf_, salt_.getBuf(), SALT_LENGTH); data/anytun-0.3.7/src/keyDerivation.cpp:119:8: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. std::memcpy(master_key_.getBuf(), &digest.getBuf()[digest.getLength() - master_key_.getLength()], master_key_.getLength()); data/anytun-0.3.7/src/keyDerivation.cpp:156:8: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. std::memcpy(master_salt_.getBuf(), &digest.getBuf()[digest.getLength() - master_salt_.getLength()], master_salt_.getLength()); data/anytun-0.3.7/src/keyDerivation.cpp:342:8: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. std::memcpy(ctr_[dir].salt_.buf_, master_salt_.getBuf(), SALT_LENGTH); data/anytun-0.3.7/src/linux/tunDevice.cpp:85:11: [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). fd_ = ::open(DEFAULT_DEVICE, O_RDWR); data/anytun-0.3.7/src/log.cpp:79:11: [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). target->open(); data/anytun-0.3.7/src/log.cpp:89:11: [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). target->open(); data/anytun-0.3.7/src/logTargets.cpp:119:3: [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 buff[100]; data/anytun-0.3.7/src/logTargets.cpp:310:23: [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). void LogTargetSyslog::open() data/anytun-0.3.7/src/logTargets.cpp:337:3: [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(); data/anytun-0.3.7/src/logTargets.cpp:347:3: [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(); data/anytun-0.3.7/src/logTargets.cpp:370:21: [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). void LogTargetFile::open() data/anytun-0.3.7/src/logTargets.cpp:372:11: [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). logfile.open(logfilename.c_str(), std::fstream::out | std::fstream::app); data/anytun-0.3.7/src/logTargets.cpp:400:3: [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(); data/anytun-0.3.7/src/logTargets.cpp:418:23: [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). void LogTargetStdout::open() data/anytun-0.3.7/src/logTargets.cpp:457:28: [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). void LogTargetWinEventlog::open() data/anytun-0.3.7/src/logTargets.cpp:494:3: [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(); data/anytun-0.3.7/src/logTargets.h:69:16: [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). virtual void open() = 0; data/anytun-0.3.7/src/logTargets.h:141:8: [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). void open(); data/anytun-0.3.7/src/logTargets.h:164:8: [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). void open(); data/anytun-0.3.7/src/logTargets.h:185:8: [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). void open(); data/anytun-0.3.7/src/logTargets.h:204:8: [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). void open(); data/anytun-0.3.7/src/packetSource.cpp:94:17: [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). sock.sock_->open(e.protocol()); data/anytun-0.3.7/src/packetSource.cpp:167:8: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. std::memcpy(buf, result.it_->buf_, (len < result.len_) ? len : result.len_); data/anytun-0.3.7/src/posix/posixDaemon.cpp:132: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). pidFile.open(gOpt.getPidFile().c_str()); data/anytun-0.3.7/src/posix/posixDaemon.cpp:171:8: [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). fd = open("/dev/null",O_RDWR); // stdin data/anytun-0.3.7/src/posix/sysExec.hpp:131:8: [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). fd = open("/dev/null",O_RDWR); // stdin data/anytun-0.3.7/src/syncServer.cpp:79:25: [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). acceptor.acceptor_->open(e.protocol()); data/anytun-0.3.7/src/win32/registryKey.cpp:60:3: [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(hkey, subKey, samDesired); data/anytun-0.3.7/src/win32/registryKey.cpp:78:20: [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). DWORD RegistryKey::open(HKEY hkey, std::string subKey, REGSAM samDesired) data/anytun-0.3.7/src/win32/registryKey.cpp:110:3: [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 value[STRING_VALUE_LENGTH]; data/anytun-0.3.7/src/win32/registryKey.cpp:129:3: [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 subkeyname[NAME_LENGTH]; data/anytun-0.3.7/src/win32/registryKey.cpp:136:17: [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). return subKey.open(key_, subkeyname, sam); data/anytun-0.3.7/src/win32/registryKey.cpp:141:17: [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). return subKey.open(key_, name.c_str(), sam); data/anytun-0.3.7/src/win32/registryKey.h:64: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). DWORD open(HKEY hkey, std::string subKey, REGSAM samDesired); data/anytun-0.3.7/src/win32/tunDevice.cpp:127:20: [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). DWORD err = akey.open(HKEY_LOCAL_MACHINE, ADAPTER_KEY, KEY_ENUMERATE_SUB_KEYS); data/anytun-0.3.7/src/win32/tunDevice.cpp:152:18: [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). err = nkey.open(HKEY_LOCAL_MACHINE, keyname.str().c_str(), KEY_QUERY_VALUE);; data/anytun-0.3.7/src/win32/winService.cpp:61:3: [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 szPath[MAX_PATH]; data/anytun-0.3.7/src/anyrtpproxy/anyrtpproxy.cpp:211:7: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(500); // in case of an hard error don't block cpu (this is ugly) data/anytun-0.3.7/src/anyrtpproxy/anyrtpproxy.cpp:263:3: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(027); data/anytun-0.3.7/src/anyrtpproxy/options.cpp:195: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). for(size_t j=0; j < strlen(argv[i+1]); ++j) \ data/anytun-0.3.7/src/anytun-showtables.cpp:103:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). std::cin.read(a,1); data/anytun-0.3.7/src/anytun.cpp:169:22: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int len = dev->read(plain_packet.getPayload(), plain_packet.getPayloadLength()); data/anytun-0.3.7/src/bsd/tunDevice.cpp:227:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int TunDevice::read(uint8_t* buf, uint32_t len) data/anytun-0.3.7/src/bsd/tunDevice.cpp:243:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return(::read(fd_, buf, len)); data/anytun-0.3.7/src/linux/tunDevice.cpp:82:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ifr.ifr_name, dev_name.c_str(), IFNAMSIZ-1); data/anytun-0.3.7/src/linux/tunDevice.cpp:121:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int TunDevice::read(uint8_t* buf, uint32_t len) data/anytun-0.3.7/src/linux/tunDevice.cpp:137:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return(::read(fd_, buf, len)); data/anytun-0.3.7/src/options.cpp:297:43: [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). uint32_t pos = str.length() + 1 + strlen(argv[i+1]) + 1; \ data/anytun-0.3.7/src/options.cpp:340: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). for(size_t j=0; j < strlen(argv[i+1]); ++j) \ data/anytun-0.3.7/src/options.cpp:357: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). for(size_t j=0; j < strlen(argv[i+1]); ++j) \ data/anytun-0.3.7/src/posix/posixDaemon.cpp:147:3: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(0); data/anytun-0.3.7/src/posix/sysExec.hpp:174:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(read(pipefd_, (void*)(&err), sizeof(err)) >= static_cast<int>(sizeof(err))) { data/anytun-0.3.7/src/tunDevice.h:64:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int read(uint8_t* buf, uint32_t len); data/anytun-0.3.7/src/win32/tunDevice.cpp:225:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int TunDevice::read(uint8_t* buf, uint32_t len) ANALYSIS SUMMARY: Hits = 109 Lines analyzed = 16363 in approximately 0.51 seconds (32172 lines/second) Physical Source Lines of Code (SLOC) = 9212 Hits@level = [0] 7 [1] 17 [2] 55 [3] 10 [4] 27 [5] 0 Hits@level+ = [0+] 116 [1+] 109 [2+] 92 [3+] 37 [4+] 27 [5+] 0 Hits/KSLOC@level+ = [0+] 12.5923 [1+] 11.8324 [2+] 9.98697 [3+] 4.0165 [4+] 2.93096 [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.