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/disorderfs-0.5.10/disorderfs.cpp FINAL RESULTS: data/disorderfs-0.5.10/disorderfs.cpp:314:27: [5] (race) readlink: This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach. const ssize_t len{readlink((root + path).c_str(), buf, sz - 1)}; // sz > 0, since it includes space for null terminator data/disorderfs-0.5.10/disorderfs.cpp:351:21: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. return wrap(chmod((root + path).c_str(), mode)); data/disorderfs-0.5.10/disorderfs.cpp:265:31: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. if (char* resolved_path = realpath(bare_arguments[0].c_str(), nullptr)) { data/disorderfs-0.5.10/disorderfs.cpp:172: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(&fi->fh, &data, sizeof(data)); data/disorderfs-0.5.10/disorderfs.cpp:363:22: [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). const int fd{open((root + path).c_str(), info->flags)}; data/disorderfs-0.5.10/disorderfs.cpp:488:22: [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). const int fd{open((root + path).c_str(), info->flags | O_CREAT, mode)}; data/disorderfs-0.5.10/disorderfs.cpp:251:5: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(0); ANALYSIS SUMMARY: Hits = 7 Lines analyzed = 566 in approximately 0.04 seconds (13324 lines/second) Physical Source Lines of Code (SLOC) = 482 Hits@level = [0] 0 [1] 1 [2] 3 [3] 1 [4] 0 [5] 2 Hits@level+ = [0+] 7 [1+] 7 [2+] 6 [3+] 3 [4+] 2 [5+] 2 Hits/KSLOC@level+ = [0+] 14.5228 [1+] 14.5228 [2+] 12.4481 [3+] 6.22407 [4+] 4.14938 [5+] 4.14938 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.