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/firejail-0.9.64/src/firejail/fs_bin.c Examining data/firejail-0.9.64/src/firejail/netns.c Examining data/firejail-0.9.64/src/firejail/appimage_size.c Examining data/firejail-0.9.64/src/firejail/netfilter.c Examining data/firejail-0.9.64/src/firejail/no_sandbox.c Examining data/firejail-0.9.64/src/firejail/preproc.c Examining data/firejail-0.9.64/src/firejail/arp.c Examining data/firejail-0.9.64/src/firejail/fs_etc.c Examining data/firejail-0.9.64/src/firejail/mountinfo.c Examining data/firejail-0.9.64/src/firejail/fs_whitelist.c Examining data/firejail-0.9.64/src/firejail/seccomp.c Examining data/firejail-0.9.64/src/firejail/cpu.c Examining data/firejail-0.9.64/src/firejail/firejail.h Examining data/firejail-0.9.64/src/firejail/util.c Examining data/firejail-0.9.64/src/firejail/restricted_shell.c Examining data/firejail-0.9.64/src/firejail/checkcfg.c Examining data/firejail-0.9.64/src/firejail/fs_home.c Examining data/firejail-0.9.64/src/firejail/shutdown.c Examining data/firejail-0.9.64/src/firejail/dhcp.c Examining data/firejail-0.9.64/src/firejail/appimage.c Examining data/firejail-0.9.64/src/firejail/fs_dev.c Examining data/firejail-0.9.64/src/firejail/chroot.c Examining data/firejail-0.9.64/src/firejail/x11.c Examining data/firejail-0.9.64/src/firejail/fs_trace.c Examining data/firejail-0.9.64/src/firejail/run_files.c Examining data/firejail-0.9.64/src/firejail/rlimit.c Examining data/firejail-0.9.64/src/firejail/join.c Examining data/firejail-0.9.64/src/firejail/output.c Examining data/firejail-0.9.64/src/firejail/cgroup.c Examining data/firejail-0.9.64/src/firejail/fs_mkdir.c Examining data/firejail-0.9.64/src/firejail/fs_logger.c Examining data/firejail-0.9.64/src/firejail/paths.c Examining data/firejail-0.9.64/src/firejail/run_symlink.c Examining data/firejail-0.9.64/src/firejail/bandwidth.c Examining data/firejail-0.9.64/src/firejail/fs_var.c Examining data/firejail-0.9.64/src/firejail/macros.c Examining data/firejail-0.9.64/src/firejail/profile.c Examining data/firejail-0.9.64/src/firejail/dbus.c Examining data/firejail-0.9.64/src/firejail/main.c Examining data/firejail-0.9.64/src/firejail/usage.c Examining data/firejail-0.9.64/src/firejail/network_main.c Examining data/firejail-0.9.64/src/firejail/env.c Examining data/firejail-0.9.64/src/firejail/cmdline.c Examining data/firejail-0.9.64/src/firejail/sbox.c Examining data/firejail-0.9.64/src/firejail/fs_lib2.c Examining data/firejail-0.9.64/src/firejail/pulseaudio.c Examining data/firejail-0.9.64/src/firejail/network.c Examining data/firejail-0.9.64/src/firejail/protocol.c Examining data/firejail-0.9.64/src/firejail/fs_hostname.c Examining data/firejail-0.9.64/src/firejail/fs_lib.c Examining data/firejail-0.9.64/src/firejail/caps.c Examining data/firejail-0.9.64/src/firejail/restrict_users.c Examining data/firejail-0.9.64/src/firejail/ls.c Examining data/firejail-0.9.64/src/firejail/selinux.c Examining data/firejail-0.9.64/src/firejail/fs.c Examining data/firejail-0.9.64/src/firejail/sandbox.c Examining data/firejail-0.9.64/src/libtrace/libtrace.c Examining data/firejail-0.9.64/src/ftee/ftee.h Examining data/firejail-0.9.64/src/ftee/main.c Examining data/firejail-0.9.64/src/fcopy/main.c Examining data/firejail-0.9.64/src/profstats/main.c Examining data/firejail-0.9.64/src/include/syscall_i386.h Examining data/firejail-0.9.64/src/include/syscall_x86_64.h Examining data/firejail-0.9.64/src/include/syscall_armeabi.h Examining data/firejail-0.9.64/src/include/pid.h Examining data/firejail-0.9.64/src/include/ldd_utils.h Examining data/firejail-0.9.64/src/include/firejail_user.h Examining data/firejail-0.9.64/src/include/seccomp.h Examining data/firejail-0.9.64/src/include/euid_common.h Examining data/firejail-0.9.64/src/include/rundefs.h Examining data/firejail-0.9.64/src/include/syscall.h Examining data/firejail-0.9.64/src/include/libnetlink.h Examining data/firejail-0.9.64/src/include/common.h Examining data/firejail-0.9.64/src/fsec-print/print.c Examining data/firejail-0.9.64/src/fsec-print/fsec_print.h Examining data/firejail-0.9.64/src/fsec-print/main.c Examining data/firejail-0.9.64/src/lib/ldd_utils.c Examining data/firejail-0.9.64/src/lib/common.c Examining data/firejail-0.9.64/src/lib/firejail_user.c Examining data/firejail-0.9.64/src/lib/errno.c Examining data/firejail-0.9.64/src/lib/pid.c Examining data/firejail-0.9.64/src/lib/syscall.c Examining data/firejail-0.9.64/src/lib/libnetlink.c Examining data/firejail-0.9.64/src/fldd/main.c Examining data/firejail-0.9.64/src/libtracelog/libtracelog.c Examining data/firejail-0.9.64/src/fnetfilter/main.c Examining data/firejail-0.9.64/src/firemon/firemon.h Examining data/firejail-0.9.64/src/firemon/arp.c Examining data/firejail-0.9.64/src/firemon/seccomp.c Examining data/firejail-0.9.64/src/firemon/cpu.c Examining data/firejail-0.9.64/src/firemon/x11.c Examining data/firejail-0.9.64/src/firemon/route.c Examining data/firejail-0.9.64/src/firemon/list.c Examining data/firejail-0.9.64/src/firemon/cgroup.c Examining data/firejail-0.9.64/src/firemon/netstats.c Examining data/firejail-0.9.64/src/firemon/firemon.c Examining data/firejail-0.9.64/src/firemon/interface.c Examining data/firejail-0.9.64/src/firemon/usage.c Examining data/firejail-0.9.64/src/firemon/apparmor.c Examining data/firejail-0.9.64/src/firemon/procevent.c Examining data/firejail-0.9.64/src/firemon/caps.c Examining data/firejail-0.9.64/src/firemon/tree.c Examining data/firejail-0.9.64/src/firemon/top.c Examining data/firejail-0.9.64/src/fnet/arp.c Examining data/firejail-0.9.64/src/fnet/main.c Examining data/firejail-0.9.64/src/fnet/interface.c Examining data/firejail-0.9.64/src/fnet/veth.c Examining data/firejail-0.9.64/src/fnet/fnet.h Examining data/firejail-0.9.64/src/firecfg/util.c Examining data/firejail-0.9.64/src/firecfg/firecfg.h Examining data/firejail-0.9.64/src/firecfg/main.c Examining data/firejail-0.9.64/src/firecfg/sound.c Examining data/firejail-0.9.64/src/firecfg/desktop_files.c Examining data/firejail-0.9.64/src/fbuilder/build_bin.c Examining data/firejail-0.9.64/src/fbuilder/build_seccomp.c Examining data/firejail-0.9.64/src/fbuilder/build_home.c Examining data/firejail-0.9.64/src/fbuilder/utils.c Examining data/firejail-0.9.64/src/fbuilder/build_profile.c Examining data/firejail-0.9.64/src/fbuilder/build_fs.c Examining data/firejail-0.9.64/src/fbuilder/main.c Examining data/firejail-0.9.64/src/fbuilder/fbuilder.h Examining data/firejail-0.9.64/src/fbuilder/filedb.c Examining data/firejail-0.9.64/src/faudit/seccomp.c Examining data/firejail-0.9.64/src/faudit/x11.c Examining data/firejail-0.9.64/src/faudit/faudit.h Examining data/firejail-0.9.64/src/faudit/pid.c Examining data/firejail-0.9.64/src/faudit/syscall.c Examining data/firejail-0.9.64/src/faudit/dbus.c Examining data/firejail-0.9.64/src/faudit/dev.c Examining data/firejail-0.9.64/src/faudit/main.c Examining data/firejail-0.9.64/src/faudit/files.c Examining data/firejail-0.9.64/src/faudit/network.c Examining data/firejail-0.9.64/src/faudit/caps.c Examining data/firejail-0.9.64/src/fseccomp/fseccomp.h Examining data/firejail-0.9.64/src/fseccomp/seccomp.c Examining data/firejail-0.9.64/src/fseccomp/seccomp_secondary.c Examining data/firejail-0.9.64/src/fseccomp/main.c Examining data/firejail-0.9.64/src/fseccomp/seccomp_file.c Examining data/firejail-0.9.64/src/fseccomp/protocol.c Examining data/firejail-0.9.64/src/libpostexecseccomp/libpostexecseccomp.c Examining data/firejail-0.9.64/src/fsec-optimize/fsec_optimize.h Examining data/firejail-0.9.64/src/fsec-optimize/main.c Examining data/firejail-0.9.64/src/fsec-optimize/optimizer.c Examining data/firejail-0.9.64/test/filters/syscall_test.c Examining data/firejail-0.9.64/test/filters/memwrexe.c Examining data/firejail-0.9.64/test/network/tcpserver.c Examining data/firejail-0.9.64/test/chroot/unchroot.c FINAL RESULTS: data/firejail-0.9.64/src/fcopy/main.c:165:2: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. chmod(fname, mode) == -1) { data/firejail-0.9.64/src/fcopy/main.c:169:6: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. if (chown(fname, uid, gid)) { data/firejail-0.9.64/src/firecfg/desktop_files.c:139:8: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. rv = chmod(user_apps_dir, 0700); data/firejail-0.9.64/src/firejail/fs_dev.c:144:6: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. if (chmod(path, mode) < 0) data/firejail-0.9.64/src/firejail/fs_home.c:388:9: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. if (chown(homedir, u, g) < 0) data/firejail-0.9.64/src/firejail/fs_lib.c:114:6: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. if (chown(RUN_LIB_FILE, getuid(), getgid())) data/firejail-0.9.64/src/firejail/fs_logger.c:116:6: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. if (chown(RUN_FSLOGGER_FILE, 0, 0) == -1) data/firejail-0.9.64/src/firejail/seccomp.c:95:11: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. int rv = chown(RUN_SECCOMP_LIST, getuid(), getgid()); data/firejail-0.9.64/src/firejail/util.c:1007:9: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. if (chmod(dir, mode) == -1) data/firejail-0.9.64/src/firejail/util.c:1068:6: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. if (chmod(fname, mode) == -1) data/firejail-0.9.64/src/firejail/util.c:1070:6: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. if (chown(fname, uid, gid) == -1) data/firejail-0.9.64/src/firejail/util.c:1104:6: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. chmod(fname, mode) == -1 || data/firejail-0.9.64/src/firejail/util.c:1105:6: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. chown(fname, uid, gid)) { data/firejail-0.9.64/src/libtrace/libtrace.c:710:11: [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. int rv = readlink("/proc/self/exe", buf, PATH_MAX); data/firejail-0.9.64/src/faudit/files.c:34:6: [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(fname, R_OK) == 0) { data/firejail-0.9.64/src/faudit/syscall.c:98:3: [4] (shell) execl: 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. execl(prog, prog, "syscall", name, NULL); data/firejail-0.9.64/src/fbuilder/build_profile.c:85:6: [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("/usr/bin/strace", X_OK) == 0) data/firejail-0.9.64/src/fbuilder/build_profile.c:121:12: [4] (shell) execvp: 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. int rv = execvp(cmd[0], cmd); data/firejail-0.9.64/src/fbuilder/main.c:31:1: [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. system("cat /proc/self/status"); data/firejail-0.9.64/src/firecfg/desktop_files.c:34:6: [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(profname1, R_OK) == 0) { data/firejail-0.9.64/src/firecfg/desktop_files.c:39:11: [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. else if (access(profname2, R_OK) == 0) { data/firejail-0.9.64/src/firecfg/main.c:343:8: [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(arg_bindir, R_OK | W_OK | X_OK)) { data/firejail-0.9.64/src/firecfg/main.c:464: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. int rv = system(cmd); data/firejail-0.9.64/src/firejail/appimage.c:49:6: [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(appimage, R_OK) == -1) { data/firejail-0.9.64/src/firejail/cmdline.c:130:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(ptr2, "%s ", argv[i + index]); data/firejail-0.9.64/src/firejail/fs.c:405:6: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(newname, "%s%s", path, fname); data/firejail-0.9.64/src/firejail/fs_bin.c:116:6: [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(name, X_OK) == -1) data/firejail-0.9.64/src/firejail/fs_etc.c:90:6: [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(fname, R_OK) == -1) data/firejail-0.9.64/src/firejail/fs_hostname.c:204:6: [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(rv, R_OK)) data/firejail-0.9.64/src/firejail/fs_lib.c:64:51: [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 (stat(full_path, &s) != 0 || s.st_uid != 0 || access(full_path, R_OK)) data/firejail-0.9.64/src/firejail/fs_lib.c:105:6: [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(full_path, R_OK)) { data/firejail-0.9.64/src/firejail/fs_lib.c:147:74: [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 (stat(full_path, &s) != 0 || s.st_uid != 0 || !S_ISDIR(s.st_mode) || access(full_path, R_OK)) data/firejail-0.9.64/src/firejail/fs_lib.c:183:48: [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 (stat(fname, &s) == 0 && s.st_uid == 0 && !access(fname, R_OK)) { data/firejail-0.9.64/src/firejail/fs_lib.c:190: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(fname, X_OK) != 0) // don't duplicate executables, just install the libraries data/firejail-0.9.64/src/firejail/fs_lib2.c:270:8: [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(name, R_OK) == 0) { data/firejail-0.9.64/src/firejail/fs_lib2.c:279: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(name, R_OK) == 0) { data/firejail-0.9.64/src/firejail/fs_lib2.c:290: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(name, R_OK) == 0) { data/firejail-0.9.64/src/firejail/fs_lib2.c:299:10: [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(name, R_OK) == 0) { data/firejail-0.9.64/src/firejail/ls.c:66:2: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf( (s.st_mode & S_IRUSR) ? "r" : "-"); data/firejail-0.9.64/src/firejail/ls.c:67:2: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf( (s.st_mode & S_IWUSR) ? "w" : "-"); data/firejail-0.9.64/src/firejail/ls.c:68:2: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf( (s.st_mode & S_IXUSR) ? "x" : "-"); data/firejail-0.9.64/src/firejail/ls.c:69:2: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf( (s.st_mode & S_IRGRP) ? "r" : "-"); data/firejail-0.9.64/src/firejail/ls.c:70:2: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf( (s.st_mode & S_IWGRP) ? "w" : "-"); data/firejail-0.9.64/src/firejail/ls.c:71:2: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf( (s.st_mode & S_IXGRP) ? "x" : "-"); data/firejail-0.9.64/src/firejail/ls.c:72:2: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf( (s.st_mode & S_IROTH) ? "r" : "-"); data/firejail-0.9.64/src/firejail/ls.c:73:2: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf( (s.st_mode & S_IWOTH) ? "w" : "-"); data/firejail-0.9.64/src/firejail/ls.c:74:2: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf( (s.st_mode & S_IXOTH) ? "x" : "-"); data/firejail-0.9.64/src/firejail/ls.c:189: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 (!rp || access(rp, R_OK) == -1) { data/firejail-0.9.64/src/firejail/main.c:871:80: [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 (!is_dir(shell) && strstr(shell, "..") == NULL && stat(shell, &s) == 0 && access(shell, X_OK) == 0) data/firejail-0.9.64/src/firejail/main.c:881:35: [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 (stat(shells[i], &s) == 0 && access(shells[i], X_OK) == 0) { data/firejail-0.9.64/src/firejail/main.c:933:2: [4] (shell) execvp: 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. execvp(argv[0], argv); data/firejail-0.9.64/src/firejail/main.c:1173:17: [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. int rv = system(argv[2]); data/firejail-0.9.64/src/firejail/main.c:1707:8: [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("/run/firetunnel/ftc", R_OK) == 0) data/firejail-0.9.64/src/firejail/main.c:1709: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. else if (access("/run/firetunnel/fts", R_OK) == 0) data/firejail-0.9.64/src/firejail/main.c:1722:8: [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(fname, R_OK) == 0) data/firejail-0.9.64/src/firejail/main.c:1739: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(ppath, R_OK)) { data/firejail-0.9.64/src/firejail/main.c:1773:25: [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 (*ppath == ':' || access(ppath, R_OK) || is_dir(ppath)) { data/firejail-0.9.64/src/firejail/main.c:2637: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(shellpath, X_OK)) { data/firejail-0.9.64/src/firejail/main.c:2642:15: [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. } else if (access(cfg.shell, X_OK)) { data/firejail-0.9.64/src/firejail/netfilter.c:39:58: [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 (is_dir(tmp) || is_link(tmp) || strstr(tmp, "..") || access(tmp, R_OK )) { data/firejail-0.9.64/src/firejail/network_main.c:37:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(sysbridge, "/sys/class/net/%s/bridge", br->dev); data/firejail-0.9.64/src/firejail/output.c:102:3: [4] (shell) execv: 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. execv(args[0], args); data/firejail-0.9.64/src/firejail/output.c:140:2: [4] (shell) execvp: 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. execvp(args[0], args); data/firejail-0.9.64/src/firejail/paths.c:134:7: [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(scratch, X_OK) == 0) { data/firejail-0.9.64/src/firejail/profile.c:406:7: [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("/dev/nvidiactl", R_OK) == 0 && arg_no3d == 0) { data/firejail-0.9.64/src/firejail/profile.c:1635:6: [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(fname, R_OK)) { data/firejail-0.9.64/src/firejail/run_symlink.c:98:3: [4] (shell) execv: 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. execv(program, argv); data/firejail-0.9.64/src/firejail/run_symlink.c:112:2: [4] (shell) execvp: 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. execvp(a[0], a); data/firejail-0.9.64/src/firejail/sandbox.c:429:7: [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(program, X_OK) == 0) // it will also dereference symlinks data/firejail-0.9.64/src/firejail/sandbox.c:454:10: [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(fname, X_OK) == 0) { data/firejail-0.9.64/src/firejail/sandbox.c:501:3: [4] (shell) execl: 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. execl(arg_audit_prog, arg_audit_prog, NULL); data/firejail-0.9.64/src/firejail/sandbox.c:539:3: [4] (shell) execvp: 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. execvp(cfg.original_argv[cfg.original_program_index], &cfg.original_argv[cfg.original_program_index]); data/firejail-0.9.64/src/firejail/sandbox.c:593:3: [4] (shell) execvp: 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. execvp(arg[0], arg); data/firejail-0.9.64/src/firejail/seccomp.c:158:19: [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 (arg_debug && access(PATH_FSEC_PRINT, X_OK) == 0) { data/firejail-0.9.64/src/firejail/seccomp.c:306:19: [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 (arg_debug && access(PATH_FSEC_PRINT, X_OK) == 0) { data/firejail-0.9.64/src/firejail/seccomp.c:357:19: [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 (arg_debug && access(PATH_FSEC_PRINT, X_OK) == 0) { data/firejail-0.9.64/src/firejail/util.c:190:2: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, fmt, args); data/firejail-0.9.64/src/firejail/util.c:200:2: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, fmt, args); data/firejail-0.9.64/src/firejail/util.c:240:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(ptr, "%s ", argv[i]); data/firejail-0.9.64/src/firejail/util.c:1092:2: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf( (mode & S_IRUSR) ? "r" : "-"); data/firejail-0.9.64/src/firejail/util.c:1093:2: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf( (mode & S_IWUSR) ? "w" : "-"); data/firejail-0.9.64/src/firejail/util.c:1094:2: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf( (mode & S_IXUSR) ? "x" : "-"); data/firejail-0.9.64/src/firejail/util.c:1095:2: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf( (mode & S_IRGRP) ? "r" : "-"); data/firejail-0.9.64/src/firejail/util.c:1096:2: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf( (mode & S_IWGRP) ? "w" : "-"); data/firejail-0.9.64/src/firejail/util.c:1097:2: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf( (mode & S_IXGRP) ? "x" : "-"); data/firejail-0.9.64/src/firejail/util.c:1098:2: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf( (mode & S_IROTH) ? "r" : "-"); data/firejail-0.9.64/src/firejail/util.c:1099:2: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf( (mode & S_IWOTH) ? "w" : "-"); data/firejail-0.9.64/src/firejail/util.c:1100:2: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf( (mode & S_IXOTH) ? "x" : "-"); data/firejail-0.9.64/src/firejail/x11.c:331:3: [4] (shell) execvp: 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. execvp(server_argv[0], server_argv); data/firejail-0.9.64/src/firejail/x11.c:368:3: [4] (shell) execvp: 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. execvp(jail_argv[0], jail_argv); data/firejail-0.9.64/src/firejail/x11.c:561:3: [4] (shell) execvp: 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. execvp(server_argv[0], server_argv); data/firejail-0.9.64/src/firejail/x11.c:599:3: [4] (shell) execvp: 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. execvp(jail_argv[0], jail_argv); data/firejail-0.9.64/src/firejail/x11.c:649:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(title_arg_str, title_start); data/firejail-0.9.64/src/firejail/x11.c:650:3: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(title_arg_str, title_sep); data/firejail-0.9.64/src/firejail/x11.c:651:3: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(title_arg_str, cfg.name); data/firejail-0.9.64/src/firejail/x11.c:665:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(title_arg_str, title_start); data/firejail-0.9.64/src/firejail/x11.c:666:3: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(title_arg_str, title_sep); data/firejail-0.9.64/src/firejail/x11.c:667:3: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(title_arg_str, base_out); data/firejail-0.9.64/src/firejail/x11.c:678:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(title_arg_str, title_start); data/firejail-0.9.64/src/firejail/x11.c:785:3: [4] (shell) execvp: 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. execvp(server_argv[0], server_argv); data/firejail-0.9.64/src/firejail/x11.c:832:3: [4] (shell) execvp: 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. execvp(attach_argv[0], attach_argv); data/firejail-0.9.64/src/firejail/x11.c:862:4: [4] (shell) execvp: 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. execvp(firejail_argv[0], firejail_argv); data/firejail-0.9.64/src/firejail/x11.c:888:5: [4] (shell) execvp: 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. execvp(stop_argv[0], stop_argv); data/firejail-0.9.64/src/firejail/x11.c:956:2: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(start_child,start_child_prefix); data/firejail-0.9.64/src/firejail/x11.c:958:3: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(start_child,firejail_argv[i]); data/firejail-0.9.64/src/firejail/x11.c:1056:3: [4] (shell) execvp: 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. execvp(server_argv[0], server_argv); data/firejail-0.9.64/src/firemon/procevent.c:426:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(lineptr, " (%s)", user); data/firejail-0.9.64/src/firemon/procevent.c:440:6: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(lineptr, " NEW SANDBOX: %s\n", cmd); data/firejail-0.9.64/src/firemon/procevent.c:456:6: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(lineptr, " %s\n", cmd); data/firejail-0.9.64/src/fldd/main.c:212:7: [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(fname, R_OK) == 0 && is_lib_64(fname)) { data/firejail-0.9.64/src/fldd/main.c:312:6: [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(argv[1], R_OK)) { data/firejail-0.9.64/src/fnet/main.c:34:2: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, fmt, args); data/firejail-0.9.64/src/fnetfilter/main.c:163:1: [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. system("cat /proc/self/status"); data/firejail-0.9.64/src/ftee/main.c:47:2: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(name1, fname); data/firejail-0.9.64/src/ftee/main.c:48:2: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(name2, fname); data/firejail-0.9.64/src/lib/firejail_user.c:121:6: [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(fname, F_OK) == -1 && errno == ENOENT) { data/firejail-0.9.64/src/lib/firejail_user.c:171:6: [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(fname, F_OK) == 0) { data/firejail-0.9.64/src/libtrace/libtrace.c:41:9: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(fp, args); \ data/firejail-0.9.64/src/libtrace/libtrace.c:501:5: [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. int access(const char *pathname, int mode) { data/firejail-0.9.64/src/libtrace/libtrace.c:534:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. ptr += sprintf(ptr, "%u:%s:socket ", mypid, myname); data/firejail-0.9.64/src/libtrace/libtrace.c:539:10: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. ptr += sprintf(ptr, "%s ", str); data/firejail-0.9.64/src/libtrace/libtrace.c:552:10: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. ptr += sprintf(ptr, "%s ", str); data/firejail-0.9.64/src/libtrace/libtrace.c:561:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(ptr, "%s", str); data/firejail-0.9.64/src/libtrace/libtrace.c:597:5: [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. int system(const char *command) { data/firejail-0.9.64/src/libtracelog/libtracelog.c:626:5: [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. int access(const char *pathname, int mode) { data/firejail-0.9.64/test/chroot/unchroot.c:40:2: [4] (shell) execl: 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. execl("/bin/bash", "bash", "-i", (char *)0); data/firejail-0.9.64/src/faudit/dbus.c:53:14: [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. char *str = getenv(env_var_name); data/firejail-0.9.64/src/faudit/main.c:25:6: [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 (getenv("FIREJAIL_TEST_ARGUMENTS")) { data/firejail-0.9.64/src/faudit/main.c:52:9: [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. prog = realpath(argv[0], NULL); data/firejail-0.9.64/src/faudit/pid.c:91:14: [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. char *str = getenv("container"); data/firejail-0.9.64/src/faudit/pid.c:95:9: [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. str = getenv("SNAP"); data/firejail-0.9.64/src/faudit/syscall.c:70:12: [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. int rv = chroot("/blablabla-57281292"); data/firejail-0.9.64/src/fcopy/main.c:186:13: [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. char *rp = realpath(target, NULL); data/firejail-0.9.64/src/fcopy/main.c:272:15: [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. char *rsrc = realpath(src, NULL); data/firejail-0.9.64/src/fcopy/main.c:389:16: [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. char *quiet = getenv("FIREJAIL_QUIET"); data/firejail-0.9.64/src/fcopy/main.c:392:16: [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. char *debug = getenv("FIREJAIL_DEBUG"); data/firejail-0.9.64/src/fcopy/main.c:455:13: [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. char *cl = getenv("FIREJAIL_FILE_COPY_LIMIT"); data/firejail-0.9.64/src/firecfg/main.c:88:18: [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. char* fname = realpath(fullname, NULL); data/firejail-0.9.64/src/firecfg/main.c:126:18: [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. char* fname = realpath(fullname, NULL); data/firejail-0.9.64/src/firecfg/main.c:287: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. char *user = getenv("SUDO_USER"); data/firejail-0.9.64/src/firecfg/util.c:52:16: [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. char *path1 = getenv("PATH"); data/firejail-0.9.64/src/firejail/appimage.c:129:18: [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. char* abspath = realpath(appimage, NULL); data/firejail-0.9.64/src/firejail/chroot.c:42:16: [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. char *rpath = realpath(cfg.chrootdir, NULL); data/firejail-0.9.64/src/firejail/chroot.c:176:6: [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 (getenv("FIREJAIL_X11") || getenv("FIREJAIL_CHROOT_X11")) { data/firejail-0.9.64/src/firejail/chroot.c:176:32: [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 (getenv("FIREJAIL_X11") || getenv("FIREJAIL_CHROOT_X11")) { data/firejail-0.9.64/src/firejail/chroot.c:197:6: [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 (getenv("FIREJAIL_CHROOT_PULSE")) { data/firejail-0.9.64/src/firejail/chroot.c:288:6: [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(oroot) < 0) data/firejail-0.9.64/src/firejail/dbus.c:332:21: [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. char *user_env = getenv(DBUS_SESSION_BUS_ADDRESS_ENV); data/firejail-0.9.64/src/firejail/dbus.c:353:23: [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. char *system_env = getenv(DBUS_SYSTEM_BUS_ADDRESS_ENV); data/firejail-0.9.64/src/firejail/dbus.c:439:16: [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. char *value = getenv(name); data/firejail-0.9.64/src/firejail/env.c:144: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. char *prompt = getenv("FIREJAIL_PROMPT"); data/firejail-0.9.64/src/firejail/fs.c:69:16: [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. char* fname = realpath(filename, NULL); data/firejail-0.9.64/src/firejail/fs.c:622:16: [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. char *rpath = realpath(path, NULL); data/firejail-0.9.64/src/firejail/fs.c:1170:6: [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(oroot) == -1) data/firejail-0.9.64/src/firejail/fs.c:1215:16: [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. char *xauth = getenv("XAUTHORITY"); data/firejail-0.9.64/src/firejail/fs.c:1217:14: [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. char *rp = realpath(xauth, NULL); data/firejail-0.9.64/src/firejail/fs_bin.c:65:25: [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. char *actual_path = realpath(fname, NULL); data/firejail-0.9.64/src/firejail/fs_bin.c:200:23: [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. char *actual_path = realpath(full_path, NULL); data/firejail-0.9.64/src/firejail/fs_etc.c:41:2: [3] (random) srand: 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. srand(time(NULL)); data/firejail-0.9.64/src/firejail/fs_home.c:168:15: [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. char* rp = realpath(src, NULL); data/firejail-0.9.64/src/firejail/fs_home.c:416:21: [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. cfg.home_private = realpath(tmp, NULL); data/firejail-0.9.64/src/firejail/fs_home.c:482:17: [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. char *rname = realpath(fname, NULL); data/firejail-0.9.64/src/firejail/fs_hostname.c:131:14: [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. char *rp =realpath(src, NULL); data/firejail-0.9.64/src/firejail/fs_var.c:240:16: [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. char *lnk = realpath(dir, NULL); data/firejail-0.9.64/src/firejail/fs_whitelist.c:478:12: [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. fname = realpath(new_name, NULL); data/firejail-0.9.64/src/firejail/fs_whitelist.c:781:16: [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. char *env = getenv("TMP"); data/firejail-0.9.64/src/firejail/join.c:447:9: [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. rv = chroot(rootdir); // this will fail for processes in sandboxes not started with --chroot option data/firejail-0.9.64/src/firejail/ls.c:188:13: [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. char *rp = realpath(path, NULL); data/firejail-0.9.64/src/firejail/ls.c:304:7: [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(rootdir) < 0) data/firejail-0.9.64/src/firejail/ls.c:350: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(rootdir) < 0) data/firejail-0.9.64/src/firejail/ls.c:457: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(rootdir) < 0) data/firejail-0.9.64/src/firejail/main.c:270:2: [3] (random) srand: 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. srand(t ^ sandbox_pid); data/firejail-0.9.64/src/firejail/main.c:868:10: [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. shell = getenv("SHELL"); data/firejail-0.9.64/src/firejail/main.c:929:9: [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. assert(getenv("LD_PRELOAD") == NULL); data/firejail-0.9.64/src/firejail/main.c:1030:20: [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. char *env_quiet = getenv("FIREJAIL_QUIET"); data/firejail-0.9.64/src/firejail/main.c:1040:25: [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. char *container_name = getenv("container"); data/firejail-0.9.64/src/firejail/no_sandbox.c:44:14: [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. char *str = getenv("container"); data/firejail-0.9.64/src/firejail/paths.c:29: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. char *path = getenv("PATH"); data/firejail-0.9.64/src/firejail/profile.c:161:43: [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. return (arg_x11_block || arg_x11_xorg || getenv("FIREJAIL_X11")); data/firejail-0.9.64/src/firejail/profile.c:1165:19: [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. char *x11env = getenv("FIREJAIL_X11"); data/firejail-0.9.64/src/firejail/profile.c:1194:19: [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. char *x11env = getenv("FIREJAIL_X11"); data/firejail-0.9.64/src/firejail/profile.c:1213:19: [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. char *x11env = getenv("FIREJAIL_X11"); data/firejail-0.9.64/src/firejail/profile.c:1232:19: [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. char *x11env = getenv("FIREJAIL_X11"); data/firejail-0.9.64/src/firejail/pulseaudio.c:43: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. char *name = getenv("XDG_RUNTIME_DIR"); data/firejail-0.9.64/src/firejail/run_symlink.c:43:12: [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. char *p = getenv("PATH"); data/firejail-0.9.64/src/firejail/run_symlink.c:53:19: [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. char *selfpath = realpath("/proc/self/exe", NULL); data/firejail-0.9.64/src/firejail/run_symlink.c:68:15: [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. char* rp = realpath(name, NULL); data/firejail-0.9.64/src/firejail/run_symlink.c:111:9: [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. assert(getenv("LD_PRELOAD") == NULL); data/firejail-0.9.64/src/firejail/sandbox.c:271:17: [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. char *mycont = getenv("container"); data/firejail-0.9.64/src/firejail/sandbox.c:433:17: [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. char *path1 = getenv("PATH"); data/firejail-0.9.64/src/firejail/sandbox.c:486:29: [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. printf("LD_PRELOAD=%s\n", getenv("LD_PRELOAD")); data/firejail-0.9.64/src/firejail/sbox.c:39:13: [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. char *cl = getenv("FIREJAIL_FILE_COPY_LIMIT"); data/firejail-0.9.64/src/firejail/x11.c:44:28: [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. const char *display_str = getenv("DISPLAY"); data/firejail-0.9.64/src/firejail/x11.c:330:10: [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. assert(getenv("LD_PRELOAD") == NULL); data/firejail-0.9.64/src/firejail/x11.c:367:10: [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. assert(getenv("LD_PRELOAD") == NULL); data/firejail-0.9.64/src/firejail/x11.c:560:10: [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. assert(getenv("LD_PRELOAD") == NULL); data/firejail-0.9.64/src/firejail/x11.c:598:10: [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. assert(getenv("LD_PRELOAD") == NULL); data/firejail-0.9.64/src/firejail/x11.c:784:10: [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. assert(getenv("LD_PRELOAD") == NULL); data/firejail-0.9.64/src/firejail/x11.c:831:10: [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. assert(getenv("LD_PRELOAD") == NULL); data/firejail-0.9.64/src/firejail/x11.c:860:10: [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. assert(getenv("LD_PRELOAD") == NULL); data/firejail-0.9.64/src/firejail/x11.c:887:12: [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. assert(getenv("LD_PRELOAD") == NULL); data/firejail-0.9.64/src/firejail/x11.c:1055:10: [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. assert(getenv("LD_PRELOAD") == NULL); data/firejail-0.9.64/src/firejail/x11.c:1137: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. char *display = getenv("DISPLAY"); data/firejail-0.9.64/src/firejail/x11.c:1262:16: [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. char *envar = getenv("XAUTHORITY"); data/firejail-0.9.64/src/firejail/x11.c:1264:14: [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. char *rp = realpath(envar, NULL); data/firejail-0.9.64/src/firejail/x11.c:1394:21: [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. char *xauthority = getenv("XAUTHORITY"); data/firejail-0.9.64/src/fldd/main.c:317:16: [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. char *quiet = getenv("FIREJAIL_QUIET"); data/firejail-0.9.64/src/fnet/main.c:76:16: [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. char *quiet = getenv("FIREJAIL_QUIET"); data/firejail-0.9.64/src/fnetfilter/main.c:171:16: [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. char *quiet = getenv("FIREJAIL_QUIET"); data/firejail-0.9.64/src/fsec-optimize/main.c:49:61: [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 (prctl(PR_GET_DUMPABLE, 0, 0, 0, 0) == 1 && getuid() && getenv("FIREJAIL_PLUGIN")) data/firejail-0.9.64/src/fseccomp/main.c:74:61: [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 (prctl(PR_GET_DUMPABLE, 0, 0, 0, 0) == 1 && getuid() && getenv("FIREJAIL_PLUGIN")) data/firejail-0.9.64/src/fseccomp/main.c:78:16: [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. char *quiet = getenv("FIREJAIL_QUIET"); data/firejail-0.9.64/src/fseccomp/main.c:82:23: [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. char *error_action = getenv("FIREJAIL_SECCOMP_ERROR_ACTION"); data/firejail-0.9.64/src/libtrace/libtrace.c:70: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. char *logfile = getenv("FIREJAIL_TRACEFILE"); data/firejail-0.9.64/src/libtracelog/libtracelog.c:127:13: [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. tofind = realpath(fullpath, NULL); data/firejail-0.9.64/src/libtracelog/libtracelog.c:130:13: [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. tofind = realpath(str, NULL); data/firejail-0.9.64/src/libtracelog/libtracelog.c:695:10: [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. cwd = realpath(pathname, NULL); data/firejail-0.9.64/test/chroot/unchroot.c:27:6: [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("baz") != 0) data/firejail-0.9.64/test/chroot/unchroot.c:35:6: [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(".") != 0) data/firejail-0.9.64/src/faudit/caps.c:26:13: [2] (misc) fopen: 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). FILE *fp = fopen("/proc/self/status", "r"); data/firejail-0.9.64/src/faudit/caps.c:30:2: [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[MAXBUF]; data/firejail-0.9.64/src/faudit/faudit.h:34:30: [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. #define errExit(msg) do { char msgout[500]; snprintf(msgout, 500, "Error %s:%s(%d)", msg, __FUNCTION__, __LINE__); perror(msgout); exit(1);} while (0) data/firejail-0.9.64/src/faudit/pid.c:47:14: [2] (misc) fopen: 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). FILE *fp = fopen(fname, "r"); data/firejail-0.9.64/src/faudit/pid.c:54: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[100]; data/firejail-0.9.64/src/faudit/seccomp.c:24:13: [2] (misc) fopen: 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). FILE *fp = fopen("/proc/self/status", "r"); data/firejail-0.9.64/src/faudit/seccomp.c:28:2: [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[MAXBUF]; data/firejail-0.9.64/src/fbuilder/build_bin.c:28:13: [2] (misc) fopen: 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). FILE *fp = fopen(fname, "r"); data/firejail-0.9.64/src/fbuilder/build_bin.c:34:2: [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[MAX_BUF]; data/firejail-0.9.64/src/fbuilder/build_fs.c:32:13: [2] (misc) fopen: 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). FILE *fp = fopen(fname, "r"); data/firejail-0.9.64/src/fbuilder/build_fs.c:38:2: [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[MAX_BUF]; data/firejail-0.9.64/src/fbuilder/build_home.c:27:13: [2] (misc) fopen: 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). FILE *fp = fopen("/etc/firejail/whitelist-common.inc", "r"); data/firejail-0.9.64/src/fbuilder/build_home.c:33:2: [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[MAX_BUF]; data/firejail-0.9.64/src/fbuilder/build_home.c:56:13: [2] (misc) fopen: 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). FILE *fp = fopen(fname, "r"); data/firejail-0.9.64/src/fbuilder/build_home.c:62:2: [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[MAX_BUF]; data/firejail-0.9.64/src/fbuilder/build_profile.c:52:14: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). int tfile = mkstemp(trace_output); data/firejail-0.9.64/src/fbuilder/build_profile.c:53:15: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). int stfile = mkstemp(strace_output); data/firejail-0.9.64/src/fbuilder/build_profile.c:92:2: [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 *cmd[len]; data/firejail-0.9.64/src/fbuilder/build_seccomp.c:27:14: [2] (misc) fopen: 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). FILE *fp2 = fopen(fname, "r"); data/firejail-0.9.64/src/fbuilder/build_seccomp.c:33:2: [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[MAX_BUF]; data/firejail-0.9.64/src/fbuilder/build_seccomp.c:94:13: [2] (misc) fopen: 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). FILE *fp = fopen(fname, "r"); data/firejail-0.9.64/src/fbuilder/build_seccomp.c:100:2: [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[MAX_BUF]; data/firejail-0.9.64/src/fbuilder/main.c:62:9: [2] (misc) fopen: 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). fp = fopen(argv[i] + 8, "w"); data/firejail-0.9.64/src/fcopy/main.c:58: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 procfs_path[64]; data/firejail-0.9.64/src/fcopy/main.c:73: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). fd = open(path, O_NOFOLLOW|O_CLOEXEC|O_PATH); data/firejail-0.9.64/src/fcopy/main.c:80:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(procfs_path, "/proc/self/fd/%i", fd); data/firejail-0.9.64/src/fcopy/main.c:107:12: [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). int src = open(srcname, O_RDONLY); data/firejail-0.9.64/src/fcopy/main.c:115:12: [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). int dst = open(destname, O_CREAT|O_WRONLY|O_TRUNC, 0755); data/firejail-0.9.64/src/fcopy/main.c:126:11: [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. unsigned char buf[BUFLEN]; data/firejail-0.9.64/src/firecfg/desktop_files.c:182:14: [2] (misc) fopen: 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). FILE *fp = fopen(filename, "r"); data/firejail-0.9.64/src/firecfg/desktop_files.c:280:16: [2] (misc) fopen: 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). FILE *fpin = fopen(filename, "r"); data/firejail-0.9.64/src/firecfg/desktop_files.c:288:17: [2] (misc) fopen: 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). FILE *fpout = fopen(outname, "w"); data/firejail-0.9.64/src/firecfg/desktop_files.c:299: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 fbuf[MAX_BUF]; data/firejail-0.9.64/src/firecfg/main.c:185:13: [2] (misc) fopen: 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). FILE *fp = fopen(cfgfile, "r"); data/firejail-0.9.64/src/firecfg/main.c:193:2: [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[MAX_BUF]; data/firejail-0.9.64/src/firecfg/sound.c:34:15: [2] (misc) fopen: 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). FILE *fpin = fopen("/etc/pulse/client.conf", "r"); data/firejail-0.9.64/src/firecfg/sound.c:45:16: [2] (misc) fopen: 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). FILE *fpout = fopen(fname, "w"); data/firejail-0.9.64/src/firecfg/sound.c:53:2: [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[MAX_BUF]; data/firejail-0.9.64/src/firejail/appimage.c:62:12: [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). int ffd = open(appimage, O_RDONLY|O_CLOEXEC); data/firejail-0.9.64/src/firejail/appimage.c:70:12: [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). int cfd = open("/dev/loop-control", O_RDWR); data/firejail-0.9.64/src/firejail/appimage.c:80:12: [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). int lfd = open(devloop, O_RDONLY); data/firejail-0.9.64/src/firejail/appimage.c:192: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). int lfd = open(devloop, O_RDONLY); data/firejail-0.9.64/src/firejail/appimage_size.c:140:7: [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(fname, O_RDONLY); data/firejail-0.9.64/src/firejail/appimage_size.c:166:11: [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. unsigned char buf[4]; data/firejail-0.9.64/src/firejail/arp.c:80:2: [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 (addr.sll_addr, ifr.ifr_hwaddr.sa_data, 6); data/firejail-0.9.64/src/firejail/arp.c:91:2: [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(hdr.sender_mac, ifr.ifr_hwaddr.sa_data, 6); data/firejail-0.9.64/src/firejail/arp.c:92:2: [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(hdr.sender_ip, (uint8_t *)&srcaddr, 4); data/firejail-0.9.64/src/firejail/arp.c:93:2: [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(hdr.target_ip, (uint8_t *)&destaddr, 4); data/firejail-0.9.64/src/firejail/arp.c:99:2: [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(frame + 6, ifr.ifr_hwaddr.sa_data, 6); data/firejail-0.9.64/src/firejail/arp.c:102:2: [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 (frame + 14, &hdr, sizeof(hdr)); data/firejail-0.9.64/src/firejail/arp.c:151:2: [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 (addr.sll_addr, ifr.ifr_hwaddr.sa_data, 6); data/firejail-0.9.64/src/firejail/arp.c:162:2: [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(hdr.sender_mac, ifr.ifr_hwaddr.sa_data, 6); data/firejail-0.9.64/src/firejail/arp.c:163:2: [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(hdr.sender_ip, (uint8_t *)&srcaddr, 4); data/firejail-0.9.64/src/firejail/arp.c:164:2: [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(hdr.target_ip, (uint8_t *)&destaddr, 4); data/firejail-0.9.64/src/firejail/arp.c:170:2: [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(frame + 6, ifr.ifr_hwaddr.sa_data, 6); data/firejail-0.9.64/src/firejail/arp.c:173:2: [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 (frame + 14, &hdr, sizeof(hdr)); data/firejail-0.9.64/src/firejail/arp.c:222:4: [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(&hdr, framerx + 14, sizeof(ArpHdr)); data/firejail-0.9.64/src/firejail/arp.c:230: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(&ip, hdr.target_ip, 4); data/firejail-0.9.64/src/firejail/bandwidth.c:131:13: [2] (misc) fopen: 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). FILE *fp = fopen(fname, "w"); data/firejail-0.9.64/src/firejail/bandwidth.c:151:13: [2] (misc) fopen: 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). FILE *fp = fopen(fname, "w"); data/firejail-0.9.64/src/firejail/bandwidth.c:181:13: [2] (misc) fopen: 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). FILE *fp = fopen(fname, "r"); data/firejail-0.9.64/src/firejail/bandwidth.c:183: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[1024]; data/firejail-0.9.64/src/firejail/bandwidth.c:217:13: [2] (misc) fopen: 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). FILE *fp = fopen(fname, "w"); data/firejail-0.9.64/src/firejail/bandwidth.c:310:14: [2] (misc) fopen: 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). FILE *fp = fopen(fname, "r"); data/firejail-0.9.64/src/firejail/bandwidth.c:316: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[1024]; data/firejail-0.9.64/src/firejail/bandwidth.c:391:2: [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 *arg[4]; data/firejail-0.9.64/src/firejail/caps.c:377:13: [2] (misc) fopen: 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). FILE *fp = fopen(file, "r"); data/firejail-0.9.64/src/firejail/caps.c:382:2: [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[MAXBUF]; data/firejail-0.9.64/src/firejail/cgroup.c:29:13: [2] (misc) fopen: 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). FILE *fp = fopen(RUN_CGROUP_CFG, "w"); data/firejail-0.9.64/src/firejail/cgroup.c:51:13: [2] (misc) fopen: 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). FILE *fp = fopen(fname, "r"); data/firejail-0.9.64/src/firejail/cgroup.c:53: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[MAXBUF]; data/firejail-0.9.64/src/firejail/cgroup.c:104:13: [2] (misc) fopen: 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). FILE *fp = fopen(path, "a"); data/firejail-0.9.64/src/firejail/checkcfg.c:62:8: [2] (misc) fopen: 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). fp = fopen(fname, "r"); data/firejail-0.9.64/src/firejail/checkcfg.c:74: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[MAX_READ]; data/firejail-0.9.64/src/firejail/checkcfg.c:211:22: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). int arp_probes = atoi(ptr + 11); data/firejail-0.9.64/src/firejail/chroot.c:70: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). int in = open(abspath, O_RDONLY|O_CLOEXEC); data/firejail-0.9.64/src/firejail/cmdline.c:93:6: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(ptr1, "\'\""); data/firejail-0.9.64/src/firejail/cmdline.c:98:6: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(ptr1, "\"\'\""); data/firejail-0.9.64/src/firejail/cmdline.c:123:4: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(ptr1, "\'\'"); data/firejail-0.9.64/src/firejail/cpu.c:30:12: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). int val = atoi(str); data/firejail-0.9.64/src/firejail/cpu.c:78:13: [2] (misc) fopen: 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). FILE *fp = fopen(RUN_CPU_CFG, "w"); data/firejail-0.9.64/src/firejail/cpu.c:94:13: [2] (misc) fopen: 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). FILE *fp = fopen(fname, "r"); data/firejail-0.9.64/src/firejail/cpu.c:142:13: [2] (misc) fopen: 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). FILE *fp = fopen(file, "r"); data/firejail-0.9.64/src/firejail/cpu.c:151:2: [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[MAXBUF]; data/firejail-0.9.64/src/firejail/dbus.c:122:2: [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[DBUS_MAX_NAME_LENGTH + 1]; data/firejail-0.9.64/src/firejail/dbus.c:320: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 *args[4] = {XDG_DBUS_PROXY_PATH, NULL, NULL, NULL}; data/firejail-0.9.64/src/firejail/dbus.c:373: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[1]; data/firejail-0.9.64/src/firejail/dhcp.c:61:2: [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 *argv[256] = { data/firejail-0.9.64/src/firejail/dhcp.c:96:19: [2] (misc) fopen: 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). FILE *pidfile = fopen(client->pid_file, "r"); data/firejail-0.9.64/src/firejail/env.c:87:14: [2] (misc) fopen: 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). FILE *fp = fopen(fname, "r"); data/firejail-0.9.64/src/firejail/env.c:94: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[maxline]; data/firejail-0.9.64/src/firejail/firejail.h:153:2: [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 *profile_ignore[MAX_PROFILE_IGNORE]; data/firejail-0.9.64/src/firejail/firejail.h:365:8: [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. extern char *fullargv[MAX_ARGS]; data/firejail-0.9.64/src/firejail/firejail.h:392:27: [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. int net_get_if_addr(const char *bridge, uint32_t *ip, uint32_t *mask, uint8_t mac[6], int *mtu); data/firejail-0.9.64/src/firejail/firejail.h:395:26: [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. int net_config_mac(const char *ifname, const unsigned char mac[6]); data/firejail-0.9.64/src/firejail/firejail.h:395:55: [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. int net_config_mac(const char *ifname, const unsigned char mac[6]); data/firejail-0.9.64/src/firejail/firejail.h:396:23: [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. int net_get_mac(const char *ifname, unsigned char mac[6]); data/firejail-0.9.64/src/firejail/firejail.h:396:46: [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. int net_get_mac(const char *ifname, unsigned char mac[6]); data/firejail-0.9.64/src/firejail/fs.c:404:6: [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 newname[strlen(path) + fname_len + 1]; data/firejail-0.9.64/src/firejail/fs.c:999:12: [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). basefd = open(basedir, O_PATH|O_DIRECTORY|O_NOFOLLOW|O_CLOEXEC); data/firejail-0.9.64/src/firejail/fs_dev.c:122:17: [2] (misc) fopen: 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). FILE *fp = fopen(dev[i].dev_fname, "w"); data/firejail-0.9.64/src/firejail/fs_dev.c:218:14: [2] (misc) fopen: 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). FILE *fp = fopen(RUN_DEVLOG_FILE, "w"); data/firejail-0.9.64/src/firejail/fs_dev.c:239:14: [2] (misc) fopen: 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). FILE *fp = fopen("/dev/log", "w"); data/firejail-0.9.64/src/firejail/fs_etc.c:54:13: [2] (misc) fopen: 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). FILE *fp = fopen(RUN_MACHINEID, "w"); data/firejail-0.9.64/src/firejail/fs_home.c:133:14: [2] (misc) fopen: 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). FILE *fp = fopen(dest, "w"); data/firejail-0.9.64/src/firejail/fs_home.c:181:14: [2] (misc) fopen: 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). FILE *fp = fopen(dest, "w"); data/firejail-0.9.64/src/firejail/fs_hostname.c:50:15: [2] (misc) fopen: 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). FILE *fp1 = fopen("/etc/hosts", "r"); data/firejail-0.9.64/src/firejail/fs_hostname.c:54:15: [2] (misc) fopen: 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). FILE *fp2 = fopen(RUN_HOSTS_FILE, "w"); data/firejail-0.9.64/src/firejail/fs_hostname.c:60: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[4096]; data/firejail-0.9.64/src/firejail/fs_hostname.c:168:13: [2] (misc) fopen: 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). FILE *fp = fopen("/etc/resolv.conf", "w"); data/firejail-0.9.64/src/firejail/fs_lib.c:123:13: [2] (misc) fopen: 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). FILE *fp = fopen(RUN_LIB_FILE, "r"); data/firejail-0.9.64/src/firejail/fs_lib.c:127:2: [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[MAXBUF]; data/firejail-0.9.64/src/firejail/fs_logger.c:95:13: [2] (misc) fopen: 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). FILE *fp = fopen(RUN_FSLOGGER_FILE, "a"); data/firejail-0.9.64/src/firejail/fs_logger.c:149:13: [2] (misc) fopen: 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). FILE *fp = fopen(fname, "r"); data/firejail-0.9.64/src/firejail/fs_logger.c:155:2: [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[MAXBUF]; data/firejail-0.9.64/src/firejail/fs_trace.c:37:14: [2] (misc) fopen: 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). FILE *fp = fopen("/etc/ld.so.preload", "w"); data/firejail-0.9.64/src/firejail/fs_trace.c:51: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). int fd = open(arg_tracefile, O_CREAT|O_WRONLY|O_CLOEXEC, S_IRUSR | S_IWRITE | S_IRGRP | S_IROTH); data/firejail-0.9.64/src/firejail/fs_trace.c:67:13: [2] (misc) fopen: 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). FILE *fp = fopen(RUN_TRACE_FILE, "w"); data/firejail-0.9.64/src/firejail/fs_trace.c:91:13: [2] (misc) fopen: 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). FILE *fp = fopen(RUN_LDPRELOAD_FILE, "w"); data/firejail-0.9.64/src/firejail/fs_var.c:130:14: [2] (misc) fopen: 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). FILE *fp = fopen("/var/log/wtmp", "w"); data/firejail-0.9.64/src/firejail/fs_var.c:138:8: [2] (misc) fopen: 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). fp = fopen("/var/log/btmp", "w"); data/firejail-0.9.64/src/firejail/fs_var.c:161:14: [2] (misc) fopen: 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). FILE *fp = fopen("/var/lib/dhcp/dhcpd.leases", "w"); data/firejail-0.9.64/src/firejail/fs_var.c:299:13: [2] (misc) fopen: 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). FILE *fp = fopen(RUN_UTMP_FILE, "w"); data/firejail-0.9.64/src/firejail/fs_whitelist.c:67: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). int parentfd = open("/", O_PATH|O_DIRECTORY|O_CLOEXEC); data/firejail-0.9.64/src/firejail/join.c:72: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). int fd = open(fname, O_RDONLY|O_CLOEXEC); data/firejail-0.9.64/src/firejail/join.c:77:4: [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[BUFLEN]; data/firejail-0.9.64/src/firejail/join.c:102:13: [2] (misc) fopen: 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). FILE *fp = fopen(fname, "r"); data/firejail-0.9.64/src/firejail/join.c:218:13: [2] (misc) fopen: 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). FILE *fp = fopen(file, "r"); data/firejail-0.9.64/src/firejail/join.c:222:2: [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[BUFLEN]; data/firejail-0.9.64/src/firejail/join.c:265:13: [2] (misc) fopen: 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). FILE *fp = fopen(uidmap, "r"); data/firejail-0.9.64/src/firejail/join.c:289:13: [2] (misc) fopen: 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). FILE *fp = fopen(fname, "re"); data/firejail-0.9.64/src/firejail/join.c:311: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). int fd = open(fname, O_RDONLY|O_CLOEXEC); data/firejail-0.9.64/src/firejail/ls.c:223:13: [2] (misc) fopen: 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). FILE *fp = fopen(path, "r"); data/firejail-0.9.64/src/firejail/ls.c:336:12: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). int fd = mkstemp(tmp_fname); data/firejail-0.9.64/src/firejail/ls.c:417:12: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). int fd = mkstemp(tmp_fname); data/firejail-0.9.64/src/firejail/macros.c:28:2: [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 *translation[MAX_TRANSLATIONS]; data/firejail-0.9.64/src/firejail/macros.c:102:13: [2] (misc) fopen: 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). FILE *fp = fopen(fname, "r"); data/firejail-0.9.64/src/firejail/macros.c:109:2: [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[MAXBUF]; data/firejail-0.9.64/src/firejail/main.c:61:8: [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. static char child_stack[STACK_SIZE] __attribute__((aligned(STACK_ALIGNMENT))); // space for child's stack data/firejail-0.9.64/src/firejail/main.c:159: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 *fullargv[MAX_ARGS]; // expanded argv for restricted shell data/firejail-0.9.64/src/firejail/main.c:280: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). int nfd = open(file, flags); data/firejail-0.9.64/src/firejail/main.c:447:13: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). down = atoi(argv[i + 3]); data/firejail-0.9.64/src/firejail/main.c:452:11: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). up = atoi(argv[i + 4]); data/firejail-0.9.64/src/firejail/main.c:540:14: [2] (misc) fopen: 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). FILE *fp = fopen(fname, "r"); data/firejail-0.9.64/src/firejail/main.c:546: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[MAXBUF]; data/firejail-0.9.64/src/firejail/main.c:1042: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). lockfd_directory = open(RUN_DIRECTORY_LOCK_FILE, O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR); data/firejail-0.9.64/src/firejail/main.c:1144:16: [2] (misc) fopen: 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). FILE *fp = fopen("/firelog", "w"); data/firejail-0.9.64/src/firejail/main.c:1163:19: [2] (misc) fopen: 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). FILE *fp = fopen("/firelog", "a"); data/firejail-0.9.64/src/firejail/main.c:1193:15: [2] (misc) fopen: 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). FILE *fp = fopen("/firelog", "a"); data/firejail-0.9.64/src/firejail/main.c:1215:15: [2] (misc) fopen: 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). FILE *fp = fopen("/firelog", "a"); data/firejail-0.9.64/src/firejail/main.c:1503:15: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). cfg.nice = atoi(argv[i] + 7); data/firejail-0.9.64/src/firejail/main.c:2846: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). lockfd_network = open(RUN_NETWORK_LOCK_FILE, O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR); data/firejail-0.9.64/src/firejail/main.c:2886: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). lockfd_directory = open(RUN_DIRECTORY_LOCK_FILE, O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR); data/firejail-0.9.64/src/firejail/main.c:3014:4: [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 gidmap[1024]; data/firejail-0.9.64/src/firejail/main.c:3020:4: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(ptr, "%d %d 1\n", gid, gid); data/firejail-0.9.64/src/firejail/main.c:3027:6: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(ptr, "%d %d 1\n", g, g); data/firejail-0.9.64/src/firejail/main.c:3034:6: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(ptr, "%d %d 1\n", g, g); data/firejail-0.9.64/src/firejail/main.c:3041:6: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(ptr, "%d %d 1\n", g, g); data/firejail-0.9.64/src/firejail/main.c:3048:6: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(ptr, "%d %d 1\n", g, g); data/firejail-0.9.64/src/firejail/mountinfo.c:30:8: [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. static char mbuf[MAX_BUF]; data/firejail-0.9.64/src/firejail/mountinfo.c:91:20: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). output->mountid = atoi(ptr); data/firejail-0.9.64/src/firejail/mountinfo.c:134:13: [2] (misc) fopen: 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). FILE *fp = fopen("/proc/self/mountinfo", "re"); data/firejail-0.9.64/src/firejail/mountinfo.c:158: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). int fd = open(path, O_PATH|O_CLOEXEC); data/firejail-0.9.64/src/firejail/mountinfo.c:165:13: [2] (misc) fopen: 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). FILE *fp = fopen(fdinfo, "re"); data/firejail-0.9.64/src/firejail/mountinfo.c:171:2: [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[MAX_BUF]; data/firejail-0.9.64/src/firejail/mountinfo.c:184:11: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). return atoi(ptr); data/firejail-0.9.64/src/firejail/mountinfo.c:204:13: [2] (misc) fopen: 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). FILE *fp = fopen("/proc/self/mountinfo", "re"); data/firejail-0.9.64/src/firejail/mountinfo.c:219:2: [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[MAX_BUF]; data/firejail-0.9.64/src/firejail/netns.c:73: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). int nsfd = open(control_file, O_RDONLY|O_CLOEXEC); data/firejail-0.9.64/src/firejail/network.c:48:14: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). int mask = atoi(ptr); data/firejail-0.9.64/src/firejail/network.c:117:27: [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. int net_get_if_addr(const char *bridge, uint32_t *ip, uint32_t *mask, uint8_t mac[6], int *mtu) { data/firejail-0.9.64/src/firejail/network.c:220:13: [2] (misc) fopen: 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). FILE *fp = fopen("/proc/self/net/route", "r"); data/firejail-0.9.64/src/firejail/network.c:224:2: [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[BUFSIZE]; data/firejail-0.9.64/src/firejail/network.c:249:26: [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. int net_config_mac(const char *ifname, const unsigned char mac[6]) { data/firejail-0.9.64/src/firejail/network.c:249:55: [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. int net_config_mac(const char *ifname, const unsigned char mac[6]) { data/firejail-0.9.64/src/firejail/network.c:262:23: [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. int net_get_mac(const char *ifname, unsigned char mac[6]) { data/firejail-0.9.64/src/firejail/network.c:262:46: [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. int net_get_mac(const char *ifname, unsigned char mac[6]) { data/firejail-0.9.64/src/firejail/network.c:276:2: [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(mac, ifr.ifr_hwaddr.sa_data, 6); data/firejail-0.9.64/src/firejail/network_main.c:36:2: [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 sysbridge[30 + strlen(br->dev)]; data/firejail-0.9.64/src/firejail/network_main.c:295:14: [2] (misc) fopen: 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). FILE *fp = fopen("/etc/resolv.conf", "r"); data/firejail-0.9.64/src/firejail/network_main.c:301: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[MAXBUF]; data/firejail-0.9.64/src/firejail/no_sandbox.c:50:13: [2] (misc) fopen: 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). FILE *fp = fopen("/proc/1/environ", "r"); data/firejail-0.9.64/src/firejail/no_sandbox.c:55:4: [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[MAX_BUF]; data/firejail-0.9.64/src/firejail/no_sandbox.c:119:14: [2] (misc) fopen: 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). FILE *fp = fopen(fname, "r"); data/firejail-0.9.64/src/firejail/no_sandbox.c:127: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[100]; data/firejail-0.9.64/src/firejail/output.c:98: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 *args[3]; data/firejail-0.9.64/src/firejail/paths.c:127:3: [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(scratch, dir, dlen); data/firejail-0.9.64/src/firejail/paths.c:132:3: [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(scratch + dlen, program, proglen+1); data/firejail-0.9.64/src/firejail/preproc.c:167:13: [2] (misc) fopen: 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). FILE *fp = fopen("/proc/sys/kernel/pid_max", "r"); data/firejail-0.9.64/src/firejail/profile.c:1094:14: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). cfg.nice = atoi(ptr + 5); data/firejail-0.9.64/src/firejail/profile.c:1667:13: [2] (misc) fopen: 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). FILE *fp = fopen(fname, "r"); data/firejail-0.9.64/src/firejail/profile.c:1680:2: [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[MAX_READ + 1]; data/firejail-0.9.64/src/firejail/protocol.c:26:13: [2] (misc) fopen: 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). FILE *fp = fopen(RUN_PROTOCOL_CFG, "w"); data/firejail-0.9.64/src/firejail/protocol.c:38:13: [2] (misc) fopen: 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). FILE *fp = fopen(fname, "r"); data/firejail-0.9.64/src/firejail/protocol.c:43:2: [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[MAXBUF]; data/firejail-0.9.64/src/firejail/pulseaudio.c:106:13: [2] (misc) fopen: 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). FILE *fp = fopen(pulsecfg, "a"); data/firejail-0.9.64/src/firejail/restrict_users.c:201:9: [2] (misc) fopen: 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). fpin = fopen("/etc/passwd", "r"); data/firejail-0.9.64/src/firejail/restrict_users.c:204:10: [2] (misc) fopen: 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). fpout = fopen(RUN_PASSWD_FILE, "w"); data/firejail-0.9.64/src/firejail/restrict_users.c:209:2: [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[MAXBUF]; data/firejail-0.9.64/src/firejail/restrict_users.c:336:9: [2] (misc) fopen: 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). fpin = fopen("/etc/group", "r"); data/firejail-0.9.64/src/firejail/restrict_users.c:339:10: [2] (misc) fopen: 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). fpout = fopen(RUN_GROUP_FILE, "w"); data/firejail-0.9.64/src/firejail/restrict_users.c:344:2: [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[MAXBUF]; data/firejail-0.9.64/src/firejail/restricted_shell.c:35:13: [2] (misc) fopen: 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). FILE *fp = fopen(fname, "r"); data/firejail-0.9.64/src/firejail/restricted_shell.c:41:2: [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[MAX_READ]; data/firejail-0.9.64/src/firejail/restricted_shell.c:99:16: [2] (misc) fopen: 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). FILE *fp = fopen("/firelog", "a"); data/firejail-0.9.64/src/firejail/run_files.c:104:13: [2] (misc) fopen: 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). FILE *fp = fopen(fname, "w"); data/firejail-0.9.64/src/firejail/run_files.c:123:13: [2] (misc) fopen: 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). FILE *fp = fopen(fname, "w"); data/firejail-0.9.64/src/firejail/run_files.c:142:13: [2] (misc) fopen: 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). FILE *fp = fopen(runfile, "w"); data/firejail-0.9.64/src/firejail/run_symlink.c:103:2: [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[3 + argc]; data/firejail-0.9.64/src/firejail/sandbox.c:70:15: [2] (misc) fopen: 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). FILE *fp = fopen(monfile, "r"); data/firejail-0.9.64/src/firejail/sandbox.c:165:13: [2] (misc) fopen: 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). FILE *fp = fopen(RUN_GROUPS_CFG, "w"); data/firejail-0.9.64/src/firejail/sandbox.c:181:13: [2] (misc) fopen: 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). FILE *fp = fopen(RUN_NONEWPRIVS_CFG, "wxe"); data/firejail-0.9.64/src/firejail/sandbox.c:194:13: [2] (misc) fopen: 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). FILE *fp = fopen(RUN_UMASK_FILE, "wxe"); data/firejail-0.9.64/src/firejail/sandbox.c:207: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). int fd = open(RUN_JOIN_FILE, O_RDWR|O_CREAT|O_EXCL|O_CLOEXEC, S_IRUSR | S_IWRITE | S_IRGRP | S_IROTH); data/firejail-0.9.64/src/firejail/sandbox.c:548: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 *arg[5]; data/firejail-0.9.64/src/firejail/sbox.c:37:2: [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 *new_environment[256] = { NULL }; data/firejail-0.9.64/src/firejail/sbox.c:55:12: [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(SBOX_STDIN_FILE, O_RDONLY)) == -1) { data/firejail-0.9.64/src/firejail/sbox.c:64:12: [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). int fd = open("/dev/null",O_RDWR, 0); data/firejail-0.9.64/src/firejail/sbox.c:217:12: [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). int fd = open(arg[0], O_PATH | O_CLOEXEC); data/firejail-0.9.64/src/firejail/seccomp.c:89:13: [2] (misc) fopen: 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). FILE *fp = fopen(RUN_SECCOMP_LIST, "a+"); data/firejail-0.9.64/src/firejail/seccomp.c:102:13: [2] (misc) fopen: 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). FILE *fp = fopen(RUN_SECCOMP_LIST, "r"); data/firejail-0.9.64/src/firejail/seccomp.c:107:2: [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[MAXBUF]; data/firejail-0.9.64/src/firejail/seccomp.c:125: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). int fd = open(fname, O_RDONLY); data/firejail-0.9.64/src/firejail/seccomp.c:417:13: [2] (misc) fopen: 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). FILE *fp = fopen(fname, "r"); data/firejail-0.9.64/src/firejail/seccomp.c:422:2: [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[MAXBUF]; data/firejail-0.9.64/src/firejail/selinux.c:38:2: [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 procfs_path[64]; data/firejail-0.9.64/src/firejail/selinux.c:56:7: [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(path, O_NOFOLLOW|O_CLOEXEC|O_PATH); data/firejail-0.9.64/src/firejail/selinux.c:63:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(procfs_path, "/proc/self/fd/%i", fd); data/firejail-0.9.64/src/firejail/shutdown.c:67:14: [2] (misc) fopen: 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). FILE *fp = fopen(monfile, "r"); data/firejail-0.9.64/src/firejail/util.c:237:2: [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 msg[len + 1]; data/firejail-0.9.64/src/firejail/util.c:274:11: [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. unsigned char buf[BUFLEN]; data/firejail-0.9.64/src/firejail/util.c:295:12: [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). int src = open(srcname, O_RDONLY); data/firejail-0.9.64/src/firejail/util.c:302:12: [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). int dst = open(destname, O_CREAT|O_WRONLY|O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); data/firejail-0.9.64/src/firejail/util.c:345:12: [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). int dst = open(destname, O_CREAT|O_WRONLY|O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); data/firejail-0.9.64/src/firejail/util.c:358: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). int src = open(srcname, O_RDONLY); data/firejail-0.9.64/src/firejail/util.c:391:14: [2] (misc) fopen: 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). FILE *fp = fopen(fname, "wx"); data/firejail-0.9.64/src/firejail/util.c:633:14: [2] (misc) fopen: 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). FILE *fp = fopen(file, "r"); data/firejail-0.9.64/src/firejail/util.c:640: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[BUFLEN]; data/firejail-0.9.64/src/firejail/util.c:651:19: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). if (parent == atoi(ptr)) { data/firejail-0.9.64/src/firejail/util.c:739:7: [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(map_file, O_RDWR); data/firejail-0.9.64/src/firejail/util.c:758:2: [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 childstr[BUFLEN + 1]; data/firejail-0.9.64/src/firejail/util.c:842:13: [2] (misc) fopen: 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). FILE *fp = fopen(file, "r"); data/firejail-0.9.64/src/firejail/util.c:851:2: [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[PIDS_BUFLEN]; data/firejail-0.9.64/src/firejail/util.c:863:9: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). rv = atoi(ptr); data/firejail-0.9.64/src/firejail/util.c:1057:14: [2] (misc) fopen: 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). FILE *fp = fopen(fname, "w"); data/firejail-0.9.64/src/firejail/util.c:1169: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). int parentfd = open("/", O_PATH|O_DIRECTORY|O_CLOEXEC); data/firejail-0.9.64/src/firejail/util.c:1227:14: [2] (misc) fopen: 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). FILE *fp = fopen(fname, "re"); data/firejail-0.9.64/src/firejail/util.c:1231:4: [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[BUFLEN]; data/firejail-0.9.64/src/firejail/x11.c:87:13: [2] (misc) fopen: 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). FILE *fp = fopen("/proc/net/unix", "r"); data/firejail-0.9.64/src/firejail/x11.c:236:2: [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 *server_argv[256] = { // rest initialized to NULL data/firejail-0.9.64/src/firejail/x11.c:300:2: [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 *jail_argv[argc+2]; data/firejail-0.9.64/src/firejail/x11.c:455:2: [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 *server_argv[256] = { // rest initialized to NULL data/firejail-0.9.64/src/firejail/x11.c:530:2: [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 *jail_argv[argc+2]; data/firejail-0.9.64/src/firejail/x11.c:693:2: [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 *server_argv[256] = { // rest initialized to NULL data/firejail-0.9.64/src/firejail/x11.c:764: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_null = open("/dev/null", O_RDWR); data/firejail-0.9.64/src/firejail/x11.c:841:2: [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 *firejail_argv[argc+2]; data/firejail-0.9.64/src/firejail/x11.c:930:2: [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 *server_argv[256] = { // rest initialized to NULL data/firejail-0.9.64/src/firejail/x11.c:938:2: [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 *firejail_argv[argc+2]; data/firejail-0.9.64/src/firejail/x11.c:1035: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_null = open("/dev/null", O_RDWR); data/firejail-0.9.64/src/firejail/x11.c:1173:11: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). int fd = mkstemp(tmpfname); data/firejail-0.9.64/src/firejail/x11.c:1329: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). int fd = open(x11file, O_RDONLY|O_CREAT|O_EXCL, S_IRUSR | S_IWUSR); data/firejail-0.9.64/src/firemon/arp.c:24:13: [2] (misc) fopen: 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). FILE *fp = fopen(fname, "r"); data/firejail-0.9.64/src/firemon/arp.c:29:2: [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[MAXBUF]; data/firejail-0.9.64/src/firemon/arp.c:48: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 ip[64]; data/firejail-0.9.64/src/firemon/arp.c:49: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 type[64]; data/firejail-0.9.64/src/firemon/arp.c:50: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 flags[64]; data/firejail-0.9.64/src/firemon/arp.c:51: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 mac[64]; data/firejail-0.9.64/src/firemon/arp.c:52: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 mask[64]; data/firejail-0.9.64/src/firemon/arp.c:53: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 device[64]; data/firejail-0.9.64/src/firemon/caps.c:29:13: [2] (misc) fopen: 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). FILE *fp = fopen(file, "r"); data/firejail-0.9.64/src/firemon/caps.c:36:2: [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[MAXBUF]; data/firejail-0.9.64/src/firemon/cgroup.c:30:13: [2] (misc) fopen: 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). FILE *fp = fopen(file, "r"); data/firejail-0.9.64/src/firemon/cgroup.c:37:2: [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[MAXBUF]; data/firejail-0.9.64/src/firemon/cpu.c:30:13: [2] (misc) fopen: 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). FILE *fp = fopen(file, "r"); data/firejail-0.9.64/src/firemon/cpu.c:37:2: [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[MAXBUF]; data/firejail-0.9.64/src/firemon/interface.c:116:4: [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 host[NI_MAXHOST]; data/firejail-0.9.64/src/firemon/netstats.c:71:13: [2] (misc) fopen: 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). FILE *fp = fopen(fname, "r"); data/firejail-0.9.64/src/firemon/netstats.c:77:2: [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[MAXBUF]; data/firejail-0.9.64/src/firemon/netstats.c:164:2: [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 pidstr[11]; data/firejail-0.9.64/src/firemon/netstats.c:177:2: [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 ptrrx[15]; data/firejail-0.9.64/src/firemon/netstats.c:178:2: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(ptrrx, "%.03f", rx_kbps); data/firejail-0.9.64/src/firemon/netstats.c:181:2: [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 ptrtx[15]; data/firejail-0.9.64/src/firemon/netstats.c:182:2: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(ptrtx, "%.03f", tx_kbps); data/firejail-0.9.64/src/firemon/netstats.c:184:2: [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[1024 + 1]; data/firejail-0.9.64/src/firemon/procevent.c:49:13: [2] (misc) fopen: 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). FILE *fp = fopen(file, "r"); data/firejail-0.9.64/src/firemon/procevent.c:56:2: [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[PIDS_BUFLEN]; data/firejail-0.9.64/src/firemon/procevent.c:71: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). if ((fd = open(fname, O_RDONLY)) < 0) { data/firejail-0.9.64/src/firemon/procevent.c:82:12: [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. unsigned char buffer[BUFLEN]; data/firejail-0.9.64/src/firemon/procevent.c:238: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 __attribute__ ((aligned(NLMSG_ALIGNTO)))buf[BUFFSIZE]; data/firejail-0.9.64/src/firemon/procevent.c:297:4: [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 line[PIDS_BUFLEN]; data/firejail-0.9.64/src/firemon/procevent.c:299:4: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(lineptr, "%2.2d:%2.2d:%2.2d", tm.tm_hour, tm.tm_min, tm.tm_sec); data/firejail-0.9.64/src/firemon/procevent.c:325:6: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(lineptr, " fork"); data/firejail-0.9.64/src/firemon/procevent.c:335:6: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(lineptr, " exec"); data/firejail-0.9.64/src/firemon/procevent.c:348:6: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(lineptr, " exit"); data/firejail-0.9.64/src/firemon/procevent.c:364:7: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(lineptr, " uid (%d:%d)", data/firejail-0.9.64/src/firemon/procevent.c:380:7: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(lineptr, " gid (%d:%d)", data/firejail-0.9.64/src/firemon/procevent.c:392:6: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(lineptr, " sid "); data/firejail-0.9.64/src/firemon/procevent.c:418:4: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(lineptr, " %u", pid); data/firejail-0.9.64/src/firemon/procevent.c:438:6: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(lineptr, " NEW SANDBOX\n"); data/firejail-0.9.64/src/firemon/procevent.c:444:5: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(lineptr, " EXIT SANDBOX\n"); data/firejail-0.9.64/src/firemon/route.c:30:8: [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. static char last_start[MAXBUF + 1]; data/firejail-0.9.64/src/firemon/route.c:52:13: [2] (misc) fopen: 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). FILE *fp = fopen(fname, "r"); data/firejail-0.9.64/src/firemon/route.c:56:2: [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[MAXBUF]; data/firejail-0.9.64/src/firemon/route.c:115:13: [2] (misc) fopen: 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). FILE *fp = fopen(fname, "r"); data/firejail-0.9.64/src/firemon/route.c:120:2: [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[MAXBUF]; data/firejail-0.9.64/src/firemon/route.c:139: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 ifname[64]; data/firejail-0.9.64/src/firemon/route.c:140: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 destination[64]; data/firejail-0.9.64/src/firemon/route.c:141: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 gateway[64]; data/firejail-0.9.64/src/firemon/route.c:142: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 flags[64]; data/firejail-0.9.64/src/firemon/route.c:143: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 refcnt[64]; data/firejail-0.9.64/src/firemon/route.c:144: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 use[64]; data/firejail-0.9.64/src/firemon/route.c:145: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 metric[64]; data/firejail-0.9.64/src/firemon/route.c:146: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 mask[64]; data/firejail-0.9.64/src/firemon/seccomp.c:28:13: [2] (misc) fopen: 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). FILE *fp = fopen(file, "r"); data/firejail-0.9.64/src/firemon/seccomp.c:35:2: [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[MAXBUF]; data/firejail-0.9.64/src/firemon/top.c:67:2: [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 procdir[20]; data/firejail-0.9.64/src/firemon/top.c:105: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 pidstr[10]; data/firejail-0.9.64/src/firemon/top.c:133: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 rss[10]; data/firejail-0.9.64/src/firemon/top.c:135: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 shared[10]; data/firejail-0.9.64/src/firemon/top.c:151: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 uptime_str[50]; data/firejail-0.9.64/src/firemon/top.c:160: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 cpu_str[10]; data/firejail-0.9.64/src/firemon/top.c:164: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 prcs_str[10]; data/firejail-0.9.64/src/firemon/top.c:307:14: [2] (misc) fopen: 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). FILE *fp = fopen("/proc/uptime", "r"); data/firejail-0.9.64/src/firemon/x11.c:40:15: [2] (misc) fopen: 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). FILE *fp = fopen(x11file, "r"); data/firejail-0.9.64/src/fldd/main.c:88: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). f = open(exe, O_RDONLY); data/firejail-0.9.64/src/fldd/main.c:324: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(argv[2], O_CREAT | O_TRUNC | O_WRONLY, 0644); data/firejail-0.9.64/src/fnet/arp.c:68:2: [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 (mac, ifr.ifr_hwaddr.sa_data, 6); data/firejail-0.9.64/src/fnet/arp.c:126:4: [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 (addr.sll_addr, mac, 6); data/firejail-0.9.64/src/fnet/arp.c:137:4: [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(hdr.sender_mac, mac, 6); data/firejail-0.9.64/src/fnet/arp.c:138:4: [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(hdr.sender_ip, (uint8_t *)&src, 4); data/firejail-0.9.64/src/fnet/arp.c:140:4: [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(hdr.target_ip, (uint8_t *)&dst, 4); data/firejail-0.9.64/src/fnet/arp.c:146:4: [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(frame + 6, mac, 6); data/firejail-0.9.64/src/fnet/arp.c:149:4: [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 (frame + 14, &hdr, sizeof(hdr)); data/firejail-0.9.64/src/fnet/arp.c:174:4: [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(&hdr, frame + 14, sizeof(ArpHdr)); data/firejail-0.9.64/src/fnet/arp.c:181: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(&ip, hdr.target_ip, 4); data/firejail-0.9.64/src/fnet/arp.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(&ip, hdr.sender_ip, 4); data/firejail-0.9.64/src/fnet/fnet.h:46:23: [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. int net_get_mac(const char *ifname, unsigned char mac[6]); data/firejail-0.9.64/src/fnet/fnet.h:46:46: [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. int net_get_mac(const char *ifname, unsigned char mac[6]); data/firejail-0.9.64/src/fnet/fnet.h:48:22: [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. int net_if_mac(const char *ifname, const unsigned char mac[6]); data/firejail-0.9.64/src/fnet/fnet.h:48:51: [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. int net_if_mac(const char *ifname, const unsigned char mac[6]); data/firejail-0.9.64/src/fnet/interface.c:198:4: [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 ipstr[30]; data/firejail-0.9.64/src/fnet/interface.c:199:4: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(ipstr, "%d.%d.%d.%d", PRINT_IP(ip)); data/firejail-0.9.64/src/fnet/interface.c:200:4: [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 maskstr[30]; data/firejail-0.9.64/src/fnet/interface.c:201:4: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(maskstr, "%d.%d.%d.%d", PRINT_IP(mask)); data/firejail-0.9.64/src/fnet/interface.c:204: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. unsigned char mac[6]; data/firejail-0.9.64/src/fnet/interface.c:206:4: [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 macstr[30]; data/firejail-0.9.64/src/fnet/interface.c:210:5: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(macstr, "%02x:%02x:%02x:%02x:%02x:%02x", PRINT_MAC(mac)); data/firejail-0.9.64/src/fnet/interface.c:233:23: [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. int net_get_mac(const char *ifname, unsigned char mac[6]) { data/firejail-0.9.64/src/fnet/interface.c:233:46: [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. int net_get_mac(const char *ifname, unsigned char mac[6]) { data/firejail-0.9.64/src/fnet/interface.c:248:2: [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(mac, ifr.ifr_hwaddr.sa_data, 6); data/firejail-0.9.64/src/fnet/interface.c:288:22: [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. int net_if_mac(const char *ifname, const unsigned char mac[6]) { data/firejail-0.9.64/src/fnet/interface.c:288:51: [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. int net_if_mac(const char *ifname, const unsigned char mac[6]) { data/firejail-0.9.64/src/fnet/interface.c:299:2: [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(ifr.ifr_hwaddr.sa_data, mac, 6); data/firejail-0.9.64/src/fnet/interface.c:325:12: [2] (integer) atol: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). prefix = atol(ptr + 1); data/firejail-0.9.64/src/fnet/interface.c:367:2: [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((char *) &ifr6.ifr6_addr, (char *) &sin6.sin6_addr, sizeof(struct in6_addr)); data/firejail-0.9.64/src/fnet/interface.c:413: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[16384]; data/firejail-0.9.64/src/fnet/main.c:91:37: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). net_create_veth(argv[3], argv[4], atoi(argv[6])); data/firejail-0.9.64/src/fnet/main.c:114:41: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). net_create_macvlan(argv[3], argv[4], atoi(argv[5])); data/firejail-0.9.64/src/fnet/main.c:121:41: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). net_create_ipvlan(argv[3], argv[4], atoi(argv[5])); data/firejail-0.9.64/src/fnet/main.c:123:42: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). net_create_macvlan(argv[3], argv[4], atoi(argv[5])); data/firejail-0.9.64/src/fnet/main.c:130:13: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). int mtu = atoi(argv[6]); data/firejail-0.9.64/src/fnet/main.c:137:12: [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. unsigned char mac[6]; data/firejail-0.9.64/src/fnet/main.c:144:31: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). net_move_interface(argv[2], atoi(argv[3])); data/firejail-0.9.64/src/fnet/veth.c:64:2: [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[1024]; data/firejail-0.9.64/src/fnetfilter/main.c:25:8: [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. static char *args[MAXARGS] = {0}; data/firejail-0.9.64/src/fnetfilter/main.c:61:14: [2] (misc) fopen: 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). FILE *fp1 = fopen(src, "r"); data/firejail-0.9.64/src/fnetfilter/main.c:65:14: [2] (misc) fopen: 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). FILE *fp2 = fopen(dest, "w"); data/firejail-0.9.64/src/fnetfilter/main.c:69:2: [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[MAXBUF]; data/firejail-0.9.64/src/fnetfilter/main.c:114:14: [2] (misc) fopen: 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). FILE *fp1 = fopen(src, "r"); data/firejail-0.9.64/src/fnetfilter/main.c:118:14: [2] (misc) fopen: 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). FILE *fp2 = fopen(dest, "w"); data/firejail-0.9.64/src/fnetfilter/main.c:123:2: [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[MAXBUF]; data/firejail-0.9.64/src/fnetfilter/main.c:200:14: [2] (misc) fopen: 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). FILE *fp = fopen(destfile, "w"); data/firejail-0.9.64/src/fsec-optimize/main.c:56: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). int fd = open(fname, O_RDONLY); data/firejail-0.9.64/src/fsec-optimize/main.c:81:7: [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(argv[1], O_WRONLY | O_TRUNC | O_CREAT, 0755); data/firejail-0.9.64/src/fsec-optimize/optimizer.c:83:4: [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(&filter_step2[j], &filter[i], sizeof(struct sock_filter)); data/firejail-0.9.64/src/fsec-optimize/optimizer.c:84:4: [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(&action_step2[j], &action[i], sizeof(Action)); data/firejail-0.9.64/src/fsec-optimize/optimizer.c:106:2: [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(filter, filter_step2, entries * sizeof(struct sock_filter)); data/firejail-0.9.64/src/fsec-optimize/optimizer.c:133:2: [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(rv, filter, len); data/firejail-0.9.64/src/fsec-print/main.c:72: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). int fd = open(fname, O_RDONLY); data/firejail-0.9.64/src/fseccomp/protocol.c:143:2: [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(ptr, &filter_start[0], sizeof(filter_start)); data/firejail-0.9.64/src/fseccomp/protocol.c:176:3: [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(ptr, domain, whitelist_len * sizeof(struct sock_filter)); data/firejail-0.9.64/src/fseccomp/protocol.c:202:2: [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(ptr, &filter_end[0], sizeof(filter_end)); data/firejail-0.9.64/src/fseccomp/protocol.c:219:12: [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). int dst = open(fname, O_CREAT|O_WRONLY|O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); data/firejail-0.9.64/src/fseccomp/seccomp.c:53: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). int fd = open(fname, O_CREAT|O_WRONLY|O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); data/firejail-0.9.64/src/fseccomp/seccomp.c:75: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). int fd = open(fname1, O_CREAT|O_WRONLY|O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); data/firejail-0.9.64/src/fseccomp/seccomp.c:102:7: [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(fname2, O_CREAT|O_WRONLY|O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); data/firejail-0.9.64/src/fseccomp/seccomp.c:126: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). int fd = open(fname1, O_CREAT|O_WRONLY|O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); data/firejail-0.9.64/src/fseccomp/seccomp.c:156:7: [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(fname2, O_CREAT|O_WRONLY|O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); data/firejail-0.9.64/src/fseccomp/seccomp.c:178: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). int fd = open(fname1, O_CREAT|O_WRONLY|O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); data/firejail-0.9.64/src/fseccomp/seccomp.c:238: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). int fd = open(fname, O_CREAT|O_WRONLY|O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); data/firejail-0.9.64/src/fseccomp/seccomp.c:309: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). int fd = open(fname, O_CREAT|O_WRONLY|O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); data/firejail-0.9.64/src/fseccomp/seccomp_secondary.c:27:12: [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). int dst = open(fname, O_CREAT|O_WRONLY|O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); data/firejail-0.9.64/src/ftee/main.c:27:17: [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. static unsigned char buf[MAXBUF]; data/firejail-0.9.64/src/ftee/main.c:52:2: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(name1 + index, ".5"); data/firejail-0.9.64/src/ftee/main.c:60:2: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(name2 + index, ".4"); data/firejail-0.9.64/src/ftee/main.c:67:2: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(name1 + index, ".3"); data/firejail-0.9.64/src/ftee/main.c:74:2: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(name2 + index, ".2"); data/firejail-0.9.64/src/ftee/main.c:82:2: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(name1 + index, ".1"); data/firejail-0.9.64/src/ftee/main.c:108:12: [2] (misc) fopen: 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). out_fp = fopen(fname, "w"); data/firejail-0.9.64/src/ftee/main.c:124:12: [2] (misc) fopen: 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). out_fp = fopen(fname, "w"); data/firejail-0.9.64/src/ftee/main.c:217:13: [2] (misc) fopen: 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). FILE *fp = fopen(fname, "a"); data/firejail-0.9.64/src/include/common.h:39:30: [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. #define errExit(msg) do { char msgout[500]; snprintf(msgout, 500, "Error %s: %s:%d %s", msg, __FILE__, __LINE__, __FUNCTION__); perror(msgout); exit(1);} while (0) data/firejail-0.9.64/src/include/common.h:93:26: [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. static inline int atomac(char *str, unsigned char macAddr[6]) { data/firejail-0.9.64/src/include/common.h:93:46: [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. static inline int atomac(char *str, unsigned char macAddr[6]) { data/firejail-0.9.64/src/include/common.h:111:47: [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. static inline int mac_not_zero(const unsigned char mac[6]) { data/firejail-0.9.64/src/include/libnetlink.h:115:2: [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(&tmp, RTA_DATA(rta), sizeof(__u64)); data/firejail-0.9.64/src/lib/common.c:41: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). int fd = open(path, O_RDONLY); data/firejail-0.9.64/src/lib/common.c:100:14: [2] (misc) fopen: 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). FILE *fp = fopen(fname, "r"); data/firejail-0.9.64/src/lib/common.c:102:4: [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[BUFLEN]; data/firejail-0.9.64/src/lib/common.c:134:12: [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(fname, O_RDONLY)) < 0) { data/firejail-0.9.64/src/lib/common.c:141:2: [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[BUFLEN]; data/firejail-0.9.64/src/lib/common.c:172:12: [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(fname, O_RDONLY)) < 0) { data/firejail-0.9.64/src/lib/common.c:179:11: [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. unsigned char buffer[BUFLEN]; data/firejail-0.9.64/src/lib/common.c:223:12: [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(fname, O_RDONLY)) < 0) { data/firejail-0.9.64/src/lib/common.c:230:11: [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. unsigned char buffer[BUFLEN]; data/firejail-0.9.64/src/lib/common.c:271:13: [2] (misc) fopen: 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). FILE *fp = fopen("/proc/mounts", "r"); data/firejail-0.9.64/src/lib/common.c:275:2: [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[BUFLEN]; data/firejail-0.9.64/src/lib/firejail_user.c:45:13: [2] (misc) fopen: 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). FILE *fp = fopen("/etc/login.defs", "r"); data/firejail-0.9.64/src/lib/firejail_user.c:47:8: [2] (misc) fopen: 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). fp = fopen("/usr/etc/login.defs", "r"); // openSUSE data/firejail-0.9.64/src/lib/firejail_user.c:52:2: [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[MAXBUF]; data/firejail-0.9.64/src/lib/firejail_user.c:127:13: [2] (misc) fopen: 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). FILE *fp = fopen(fname, "r"); data/firejail-0.9.64/src/lib/firejail_user.c:135:2: [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[MAXBUF]; data/firejail-0.9.64/src/lib/firejail_user.c:181:13: [2] (misc) fopen: 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). FILE *fp = fopen(fname, "a+"); data/firejail-0.9.64/src/lib/ldd_utils.c:43: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). int fd = open(exe, O_RDONLY); data/firejail-0.9.64/src/lib/ldd_utils.c:47:11: [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. unsigned char buf[EI_NIDENT]; data/firejail-0.9.64/src/lib/libnetlink.c:149:2: [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 resp[1024]; data/firejail-0.9.64/src/lib/libnetlink.c:213:2: [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[16384]; data/firejail-0.9.64/src/lib/libnetlink.c:326:2: [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[16384]; data/firejail-0.9.64/src/lib/libnetlink.c:397: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. memcpy(answer, h, h->nlmsg_len); data/firejail-0.9.64/src/lib/libnetlink.c:407: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(answer, h, h->nlmsg_len); data/firejail-0.9.64/src/lib/libnetlink.c:442:2: [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[8192]; data/firejail-0.9.64/src/lib/libnetlink.c:508:2: [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[8192]; data/firejail-0.9.64/src/lib/libnetlink.c:633:3: [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(RTA_DATA(rta), data, alen); data/firejail-0.9.64/src/lib/libnetlink.c:647:2: [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(NLMSG_TAIL(n), data, len); data/firejail-0.9.64/src/lib/libnetlink.c:698:2: [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(RTA_DATA(subrta), &data, 4); data/firejail-0.9.64/src/lib/libnetlink.c:716:2: [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(RTA_DATA(subrta), data, alen); data/firejail-0.9.64/src/lib/pid.c:42:13: [2] (misc) fopen: 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). FILE *fp = fopen(file, "r"); data/firejail-0.9.64/src/lib/pid.c:66:13: [2] (misc) fopen: 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). FILE *fp = fopen(file, "r"); data/firejail-0.9.64/src/lib/pid.c:73:2: [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 line[PIDS_BUFLEN]; data/firejail-0.9.64/src/lib/pid.c:99:13: [2] (misc) fopen: 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). FILE *fp = fopen(file, "r"); data/firejail-0.9.64/src/lib/pid.c:106:2: [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 line[PIDS_BUFLEN]; data/firejail-0.9.64/src/lib/pid.c:143:13: [2] (misc) fopen: 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). FILE *fp = fopen(file, "r"); data/firejail-0.9.64/src/lib/pid.c:150:2: [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[PIDS_BUFLEN]; data/firejail-0.9.64/src/lib/pid.c:160:9: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). rv = atoi(ptr); data/firejail-0.9.64/src/lib/pid.c:184:2: [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 indent[(pids[index].level - 1) * 2 + 1]; data/firejail-0.9.64/src/lib/pid.c:202:14: [2] (misc) fopen: 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). FILE *fp = fopen(fname, "r"); data/firejail-0.9.64/src/lib/pid.c:307:14: [2] (misc) fopen: 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). FILE *fp = fopen("/proc/sys/kernel/pid_max", "r"); data/firejail-0.9.64/src/lib/pid.c:352:14: [2] (misc) fopen: 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). FILE *fp = fopen(file, "r"); data/firejail-0.9.64/src/lib/pid.c:359: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[PIDS_BUFLEN]; data/firejail-0.9.64/src/lib/pid.c:396:23: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). unsigned parent = atoi(ptr); data/firejail-0.9.64/src/lib/pid.c:412:21: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). pids[pid].uid = atoi(ptr); data/firejail-0.9.64/src/libpostexecseccomp/libpostexecseccomp.c:31: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). int fd = open(RUN_SECCOMP_POSTEXEC, O_RDONLY); data/firejail-0.9.64/src/libtrace/libtrace.c:59:8: [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. static char myname[MAXNAME] = "unknown"; data/firejail-0.9.64/src/libtrace/libtrace.c:101:5: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(myname, "unknown"); data/firejail-0.9.64/src/libtrace/libtrace.c:267: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 str[INET6_ADDRSTRLEN]; data/firejail-0.9.64/src/libtrace/libtrace.c:290:5: [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). int open(const char *pathname, int flags, mode_t mode) { data/firejail-0.9.64/src/libtrace/libtrace.c:335:7: [2] (misc) fopen: 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). FILE *fopen(const char *pathname, const char *mode) { data/firejail-0.9.64/src/libtrace/libtrace.c:527:8: [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. static char socketbuf[1024]; data/firejail-0.9.64/src/libtrace/libtrace.c:537:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. ptr += sprintf(ptr, "%d ", domain); data/firejail-0.9.64/src/libtrace/libtrace.c:550:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. ptr += sprintf(ptr, "%d ", type); data/firejail-0.9.64/src/libtrace/libtrace.c:559:4: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(ptr, "%d", protocol); data/firejail-0.9.64/src/libtrace/libtrace.c:709: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. static char buf[PATH_MAX + 1]; data/firejail-0.9.64/src/libtracelog/libtracelog.c:183:2: [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[MAXBUF]; data/firejail-0.9.64/src/libtracelog/libtracelog.c:272:8: [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. static char myname[MAXNAME]; data/firejail-0.9.64/src/libtracelog/libtracelog.c:317:5: [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). int open(const char *pathname, int flags, mode_t mode) { data/firejail-0.9.64/src/libtracelog/libtracelog.c:393:7: [2] (misc) fopen: 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). FILE *fopen(const char *pathname, const char *mode) { data/firejail-0.9.64/src/profstats/main.c:103:13: [2] (misc) fopen: 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). FILE *fp = fopen(fname, "r"); data/firejail-0.9.64/src/profstats/main.c:110:2: [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[MAXBUF]; data/firejail-0.9.64/test/filters/memwrexe.c:32:12: [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). int fd = open("memwrexe.c", O_RDONLY); data/firejail-0.9.64/test/filters/memwrexe.c:55:12: [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). int fd = open("memwrexe.c", O_RDWR); data/firejail-0.9.64/test/network/tcpserver.c:37:15: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). int portno = atoi(argv[1]); data/firejail-0.9.64/test/network/tcpserver.c:86:4: [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[MAXBUF]; data/firejail-0.9.64/src/faudit/dbus.c:40:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(remote.sun_path, sockfile, sizeof(remote.sun_path) - 1); data/firejail-0.9.64/src/faudit/dbus.c:41: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). int len = strlen(remote.sun_path) + sizeof(remote.sun_family); data/firejail-0.9.64/src/faudit/pid.c:70:35: [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(buf, kern_proc[j], strlen(kern_proc[j])) == 0) { data/firejail-0.9.64/src/fbuilder/build_fs.c:29:16: [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). int dir_len = strlen(dir); data/firejail-0.9.64/src/fbuilder/build_home.c:174:17: [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). int home_len = strlen(home); data/firejail-0.9.64/src/fbuilder/filedb.c:26: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). int len = strlen(fname); data/firejail-0.9.64/src/fbuilder/filedb.c:67:15: [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). entry->len = strlen(entry->fname); data/firejail-0.9.64/src/fbuilder/utils.c:33: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). if (fname[strlen(fname) - 1] == '/') data/firejail-0.9.64/src/fcopy/main.c:127:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((len = read(src, buf, BUFLEN)) > 0) { data/firejail-0.9.64/src/fcopy/main.c:220:53: [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 (asprintf(&outfname, "%s%s", outpath, infname + strlen(inpath)) == -1) data/firejail-0.9.64/src/fcopy/main.c:421: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 (src[strlen(src) - 1] == '/') data/firejail-0.9.64/src/fcopy/main.c:422:7: [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). src[strlen(src) - 1] = '\0'; data/firejail-0.9.64/src/fcopy/main.c:423: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). if (dest[strlen(dest) - 1] == '/') data/firejail-0.9.64/src/fcopy/main.c:424: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). dest[strlen(dest) - 1] = '\0'; data/firejail-0.9.64/src/fcopy/main.c:427: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). int len = strlen(src); data/firejail-0.9.64/src/fcopy/main.c:435: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 = strlen(dest); data/firejail-0.9.64/src/firecfg/desktop_files.c:69: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). int len = strlen(tmpfname); data/firejail-0.9.64/src/firecfg/desktop_files.c:166:58: [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 (strstr(entry->d_name,".desktop") != (entry->d_name+strlen(entry->d_name)-8)) data/firejail-0.9.64/src/firecfg/desktop_files.c:216:15: [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 (!ptr || strlen(ptr) < 7) { data/firejail-0.9.64/src/firecfg/main.c:392:4: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(022); data/firejail-0.9.64/src/firecfg/main.c:419:23: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). mode_t orig_umask = umask(022); // temporarily set the umask data/firejail-0.9.64/src/firecfg/main.c:437:3: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(orig_umask); data/firejail-0.9.64/src/firecfg/main.c:450:23: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). mode_t orig_umask = umask(022); data/firejail-0.9.64/src/firecfg/main.c:452:3: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(orig_umask); data/firejail-0.9.64/src/firejail/arp.c:50:6: [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(dev) > IFNAMSIZ) { data/firejail-0.9.64/src/firejail/arp.c:69:2: [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, IFNAMSIZ - 1); data/firejail-0.9.64/src/firejail/arp.c:121:6: [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(dev) > IFNAMSIZ) { data/firejail-0.9.64/src/firejail/arp.c:140:2: [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, IFNAMSIZ - 1); data/firejail-0.9.64/src/firejail/bandwidth.c:59: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). int len = strlen(dev); data/firejail-0.9.64/src/firejail/bandwidth.c:189: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). if (strlen(buf) == 0) data/firejail-0.9.64/src/firejail/bandwidth.c:317:13: [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). int len = strlen(dev); data/firejail-0.9.64/src/firejail/checkcfg.c:81:38: [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). else if (strncmp(ptr, string " ", strlen(string)+1) == 0) { \ data/firejail-0.9.64/src/firejail/checkcfg.c:82: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). if (strcmp(ptr + strlen(string) + 1, "yes") == 0) \ data/firejail-0.9.64/src/firejail/checkcfg.c:84: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). else if (strcmp(ptr + strlen(string) + 1, "no") == 0) \ data/firejail-0.9.64/src/firejail/chroot.c:49:30: [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(rpath, overlay, strlen(overlay)) == 0) { data/firejail-0.9.64/src/firejail/chroot.c:201:30: [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). char *orig_pulse = pulse + strlen(cfg.chrootdir); data/firejail-0.9.64/src/firejail/cmdline.c:39:19: [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 (j = 0; j < strlen(argv[i + index]); j++) { data/firejail-0.9.64/src/firejail/cmdline.c:58:7: [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(argv[i + index]) == 0) { data/firejail-0.9.64/src/firejail/cmdline.c:82:19: [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 (j = 0; j < strlen(argv[i + index]); j++) { data/firejail-0.9.64/src/firejail/cmdline.c:100:13: [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). ptr1 += strlen(ptr1); data/firejail-0.9.64/src/firejail/cmdline.c:122:7: [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(argv[i + index]) == 0) { data/firejail-0.9.64/src/firejail/cmdline.c:124: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). ptr1 += strlen(ptr1); data/firejail-0.9.64/src/firejail/cmdline.c:127:3: [1] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source is a constant character. sprintf(ptr1, " "); data/firejail-0.9.64/src/firejail/cmdline.c:128: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). ptr1 += strlen(ptr1); data/firejail-0.9.64/src/firejail/cmdline.c:131: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). ptr2 += strlen(ptr2); data/firejail-0.9.64/src/firejail/cmdline.c:134: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). assert((unsigned) len == strlen(command_line)); data/firejail-0.9.64/src/firejail/cpu.c:27:6: [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(str) == 0) data/firejail-0.9.64/src/firejail/dbus.c:53:25: [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). unsigned long length = strlen(name); data/firejail-0.9.64/src/firejail/dbus.c:84:25: [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). unsigned long length = strlen(path); data/firejail-0.9.64/src/firejail/dbus.c:129:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buf, rule, (size_t) name_length); data/firejail-0.9.64/src/firejail/dbus.c:141:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buf, name_end, interface_length); data/firejail-0.9.64/src/firejail/dbus.c:169:25: [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 prefix_length = strlen(prefix); data/firejail-0.9.64/src/firejail/dbus.c:219:25: [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 prefix_length = strlen(prefix); data/firejail-0.9.64/src/firejail/dbus.c:374:24: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ssize_t read_bytes = read(status_pipe[0], buf, 1); data/firejail-0.9.64/src/firejail/dbus.c:443:5: [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(DBUS_SOCKET_PATH_PREFIX)) == 0) data/firejail-0.9.64/src/firejail/dbus.c:444:18: [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 value + strlen(DBUS_SOCKET_PATH_PREFIX); data/firejail-0.9.64/src/firejail/dhcp.c:95:4: [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(100000); data/firejail-0.9.64/src/firejail/env.c:80:7: [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(ptr) != 6) data/firejail-0.9.64/src/firejail/fs.c:398: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). size_t fname_len = strlen(fname); data/firejail-0.9.64/src/firejail/fs.c:404:19: [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). char newname[strlen(path) + fname_len + 1]; data/firejail-0.9.64/src/firejail/fs.c:568:15: [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 len = strlen(path); data/firejail-0.9.64/src/firejail/fs_bin.c:68:17: [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 (ptr && strlen(ptr) == strlen("/firejail")) { data/firejail-0.9.64/src/firejail/fs_bin.c:68:32: [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 (ptr && strlen(ptr) == strlen("/firejail")) { data/firejail-0.9.64/src/firejail/fs_bin.c:128:13: [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). int len = strlen(paths[i]); data/firejail-0.9.64/src/firejail/fs_home.c:173:33: [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(rp, cfg.homedir, strlen(cfg.homedir)) != 0 || rp[strlen(cfg.homedir)] != '/') { data/firejail-0.9.64/src/firejail/fs_home.c:173: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). if (strncmp(rp, cfg.homedir, strlen(cfg.homedir)) != 0 || rp[strlen(cfg.homedir)] != '/') { data/firejail-0.9.64/src/firejail/fs_home.c:302:15: [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 len = strlen(homedir); data/firejail-0.9.64/src/firejail/fs_home.c:468:35: [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(fname, cfg.homedir, strlen(cfg.homedir)) != 0 || fname[strlen(cfg.homedir)] != '/') data/firejail-0.9.64/src/firejail/fs_home.c:468:70: [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(fname, cfg.homedir, strlen(cfg.homedir)) != 0 || fname[strlen(cfg.homedir)] != '/') data/firejail-0.9.64/src/firejail/fs_home.c:483:45: [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 (!rname || strncmp(rname, cfg.homedir, strlen(cfg.homedir)) != 0) data/firejail-0.9.64/src/firejail/fs_home.c:486:23: [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). char *ptr = rname + strlen(cfg.homedir); data/firejail-0.9.64/src/firejail/fs_home.c:509: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). assert(strncmp(fname, cfg.homedir, strlen(cfg.homedir)) == 0); data/firejail-0.9.64/src/firejail/fs_lib.c:203: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). int len = strlen(lib); data/firejail-0.9.64/src/firejail/fs_lib2.c:72:23: [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). libc_list[i].len = strlen(libc_list[i].name); data/firejail-0.9.64/src/firejail/fs_lib2.c:241:17: [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). ptr->len = strlen(ptr->library); data/firejail-0.9.64/src/firejail/fs_mkdir.c:35:34: [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(fname, cfg.homedir, strlen(cfg.homedir)) != 0 && data/firejail-0.9.64/src/firejail/fs_mkdir.c:37:30: [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). strncmp(fname, runuser, strlen(runuser)) != 0) { data/firejail-0.9.64/src/firejail/fs_whitelist.c:311:20: [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 path_len = strlen(path); data/firejail-0.9.64/src/firejail/fs_whitelist.c:389:16: [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). runuser_len = strlen(runuser); data/firejail-0.9.64/src/firejail/fs_whitelist.c:390:16: [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). homedir_len = strlen(cfg.homedir); data/firejail-0.9.64/src/firejail/join.c:78:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ssize_t rv = read(fd, buf, sizeof(buf) - 1); data/firejail-0.9.64/src/firejail/join.c:324:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, &status, 1) == 1 && status == SANDBOX_DONE) { data/firejail-0.9.64/src/firejail/join.c:341:3: [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(SNOOZE); data/firejail-0.9.64/src/firejail/ls.c:108: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). int len = strlen(username); data/firejail-0.9.64/src/firejail/ls.c:141: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 = strlen(groupname); data/firejail-0.9.64/src/firejail/ls.c:241:14: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((c = fgetc(fp)) != EOF) { data/firejail-0.9.64/src/firejail/macros.c:85: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). int len = strlen(name); data/firejail-0.9.64/src/firejail/macros.c:98:18: [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 length = strlen(var); data/firejail-0.9.64/src/firejail/macros.c:125:9: [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(ptr1) != 0) { data/firejail-0.9.64/src/firejail/macros.c:269:15: [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 len = strlen(fname); data/firejail-0.9.64/src/firejail/main.c:903:35: [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(argv[i], argument, strlen(argument)) == 0) { data/firejail-0.9.64/src/firejail/main.c:930:2: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(orig_umask); data/firejail-0.9.64/src/firejail/main.c:979:15: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). orig_umask = umask(022); data/firejail-0.9.64/src/firejail/main.c:989:28: [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 (argc == 0 || !argv || strlen(argv[0]) == 0) { data/firejail-0.9.64/src/firejail/main.c:1003:7: [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(argv[i]) >= MAX_ARG_LEN) { data/firejail-0.9.64/src/firejail/main.c:1015:7: [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(*ptr) >= MAX_ENV_LEN) { data/firejail-0.9.64/src/firejail/main.c:1172:8: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(orig_umask); data/firejail-0.9.64/src/firejail/main.c:2028: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). if (strlen(cfg.name) == 0) { data/firejail-0.9.64/src/firejail/main.c:2035: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). if (strlen(cfg.hostname) == 0) { data/firejail-0.9.64/src/firejail/main.c:2589: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). if (strlen(argv[i] + 8) == 0) { data/firejail-0.9.64/src/firejail/main.c:2673: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). if (strlen(cfg.name) == 0) { data/firejail-0.9.64/src/firejail/main.c:3021: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). ptr += strlen(ptr); data/firejail-0.9.64/src/firejail/main.c:3028:13: [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). ptr += strlen(ptr); data/firejail-0.9.64/src/firejail/main.c:3035:13: [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). ptr += strlen(ptr); data/firejail-0.9.64/src/firejail/main.c:3042:13: [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). ptr += strlen(ptr); data/firejail-0.9.64/src/firejail/mountinfo.c:218:19: [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 pathlen = strlen(path); data/firejail-0.9.64/src/firejail/mountinfo.c:234:33: [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(mntp.dir, path, strlen(mntp.dir)) || data/firejail-0.9.64/src/firejail/network.c:68:6: [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(ifname) > IFNAMSIZ) { data/firejail-0.9.64/src/firejail/network.c:81:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ifr.ifr_name, ifname, IFNAMSIZ - 1); data/firejail-0.9.64/src/firejail/network.c:93:6: [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(ifname) > IFNAMSIZ) { data/firejail-0.9.64/src/firejail/network.c:109:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ifr.ifr_name, ifname, IFNAMSIZ - 1); data/firejail-0.9.64/src/firejail/network.c:159:6: [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(ifname) > IFNAMSIZ) { data/firejail-0.9.64/src/firejail/network.c:271:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ifr.ifr_name, ifname, IFNAMSIZ - 1); data/firejail-0.9.64/src/firejail/network_main.c:36: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). char sysbridge[30 + strlen(br->dev)]; data/firejail-0.9.64/src/firejail/no_sandbox.c:57:16: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((c = fgetc(fp)) != EOF) { data/firejail-0.9.64/src/firejail/no_sandbox.c:142:35: [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(buf, kern_proc[j], strlen(kern_proc[j])) == 0) { data/firejail-0.9.64/src/firejail/paths.c:59:9: [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 = strlen(elt); data/firejail-0.9.64/src/firejail/paths.c:111:19: [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 proglen = strlen(program); data/firejail-0.9.64/src/firejail/paths.c:121: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). dlen = strlen(dir); data/firejail-0.9.64/src/firejail/profile.c:103:13: [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). int len = strlen(cfg.profile_ignore[i]); data/firejail-0.9.64/src/firejail/profile.c:192:32: [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(ptr, cond->name, strlen(cond->name)) != 0) { data/firejail-0.9.64/src/firejail/profile.c:196: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). ptr += strlen(cond->name); data/firejail-0.9.64/src/firejail/profile.c:304:7: [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(cfg.name) == 0) { data/firejail-0.9.64/src/firejail/profile.c:1512: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). if (strlen(cfg.name) == 0) { data/firejail-0.9.64/src/firejail/profile.c:1631:6: [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(fname) == 0 || is_dir(fname)) { data/firejail-0.9.64/src/firejail/profile.c:1640: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). if (ptr && strlen(ptr) == 6 && errsv != EACCES) data/firejail-0.9.64/src/firejail/run_symlink.c:93:2: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(orig_umask); data/firejail-0.9.64/src/firejail/sandbox.c:57:2: [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(10000); // don't race to print a message data/firejail-0.9.64/src/firejail/sandbox.c:311:3: [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(20000); data/firejail-0.9.64/src/firejail/sandbox.c:343:6: [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(100000); data/firejail-0.9.64/src/firejail/sandbox.c:406:3: [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(1000); data/firejail-0.9.64/src/firejail/sandbox.c:482:2: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(orig_umask); data/firejail-0.9.64/src/firejail/sandbox.c:637:33: [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 (sethostname(cfg.hostname, strlen(cfg.hostname)) < 0) data/firejail-0.9.64/src/firejail/sbox.c:81:2: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(027); data/firejail-0.9.64/src/firejail/seccomp.c:36:6: [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(str) == 0) { data/firejail-0.9.64/src/firejail/seccomp.c:41: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). int len = strlen(str) + 1; data/firejail-0.9.64/src/firejail/util.c:234: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). len += strlen(argv[i]) + 1; // + ' ' data/firejail-0.9.64/src/firejail/util.c:241: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). ptr += strlen(ptr); data/firejail-0.9.64/src/firejail/util.c:275:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((len = read(src, buf, BUFLEN)) > 0) { data/firejail-0.9.64/src/firejail/util.c:415: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). if (fname[strlen(fname) - 1] == '/') data/firejail-0.9.64/src/firejail/util.c:489:15: [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 len = strlen(buf); data/firejail-0.9.64/src/firejail/util.c:557:15: [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 len = strlen(path); data/firejail-0.9.64/src/firejail/util.c:654:48: [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(cmdline, XDG_DBUS_PROXY_PATH, strlen(XDG_DBUS_PROXY_PATH)) != 0) data/firejail-0.9.64/src/firejail/util.c:734: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). map_len = strlen(mapping); data/firejail-0.9.64/src/firejail/util.c:1280:15: [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 (!name || strlen(name) == 0) { data/firejail-0.9.64/src/firejail/x11.c:251:25: [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 (i = 0; i < (int) strlen(xvfb_extra_params); i++) { data/firejail-0.9.64/src/firejail/x11.c:274:25: [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 (i = 0; i < (int) strlen(xvfb_extra_params)-1; i++) { data/firejail-0.9.64/src/firejail/x11.c:399: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). int len = strlen(argument); data/firejail-0.9.64/src/firejail/x11.c:475:25: [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 (i = 0; i < (int) strlen(xephyr_extra_params); i++) { data/firejail-0.9.64/src/firejail/x11.c:498:25: [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 (i = 0; i < (int) strlen(xephyr_extra_params)-1; i++) { data/firejail-0.9.64/src/firejail/x11.c:641:29: [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 ((cfg.name != NULL) && (strlen(cfg.name) > 0)) { data/firejail-0.9.64/src/firejail/x11.c:643:26: [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). title_arg_str = malloc(strlen(title_start) + strlen(title_sep) + strlen(cfg.name) + 1); data/firejail-0.9.64/src/firejail/x11.c:643:48: [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). title_arg_str = malloc(strlen(title_start) + strlen(title_sep) + strlen(cfg.name) + 1); data/firejail-0.9.64/src/firejail/x11.c:643:68: [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). title_arg_str = malloc(strlen(title_start) + strlen(title_sep) + strlen(cfg.name) + 1); data/firejail-0.9.64/src/firejail/x11.c:655:42: [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). else if ((cfg.home_private != NULL) && (strlen(cfg.home_private) > 0)) { data/firejail-0.9.64/src/firejail/x11.c:659:26: [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). title_arg_str = malloc(strlen(title_start) + strlen(title_sep) + strlen(base_out) + 1); data/firejail-0.9.64/src/firejail/x11.c:659:48: [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). title_arg_str = malloc(strlen(title_start) + strlen(title_sep) + strlen(base_out) + 1); data/firejail-0.9.64/src/firejail/x11.c:659:68: [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). title_arg_str = malloc(strlen(title_start) + strlen(title_sep) + strlen(base_out) + 1); data/firejail-0.9.64/src/firejail/x11.c:672:26: [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). title_arg_str = malloc(strlen(title_start) + 1); data/firejail-0.9.64/src/firejail/x11.c:709:25: [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 (i = 0; i < (int) strlen(xpra_extra_params); i++) { data/firejail-0.9.64/src/firejail/x11.c:732:25: [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 (i = 0; i < (int) strlen(xpra_extra_params)-1; i++) { data/firejail-0.9.64/src/firejail/x11.c:945:19: [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). total_length += strlen(argv[i]); data/firejail-0.9.64/src/firejail/x11.c:950:38: [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). start_child = malloc(total_length + strlen(start_child_prefix) + fpos + 2); data/firejail-0.9.64/src/firejail/x11.c:960:4: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat(start_child," "); data/firejail-0.9.64/src/firejail/x11.c:978:25: [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 (i = 0; i < (int) strlen(xpra_extra_params); i++) { data/firejail-0.9.64/src/firejail/x11.c:1001:25: [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 (i = 0; i < (int) strlen(xpra_extra_params)-1; i++) { data/firejail-0.9.64/src/firemon/arp.c:54:12: [1] (buffer) sscanf: It's unclear if the %s limit in the format string is small enough (CWE-120). Check that the limit is sufficiently small, or use a different input function. int rv = sscanf(start, "%63s %63s %63s %63s %63s %63s\n", ip, type, flags, mac, mask, device); data/firejail-0.9.64/src/firemon/firemon.c:75:46: [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(cmdline, XDG_DBUS_PROXY_PATH, strlen(XDG_DBUS_PROXY_PATH)) == 0) { data/firejail-0.9.64/src/firemon/firemon.c:125:3: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). getchar(); data/firejail-0.9.64/src/firemon/interface.c:65:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ifr.ifr_name, ifa->ifa_name, IFNAMSIZ - 1); data/firejail-0.9.64/src/firemon/netstats.c:133:23: [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). firejail_exec_len = strlen(firejail_exec); data/firejail-0.9.64/src/firemon/netstats.c:134:30: [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). firejail_exec_prefix_len = strlen(PREFIX) + 5; data/firejail-0.9.64/src/firemon/netstats.c:231:7: [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(header) > (size_t)col) data/firejail-0.9.64/src/firemon/procevent.c:84:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((len = read(fd, buffer, sizeof(buffer) - 1)) <= 0) { data/firejail-0.9.64/src/firemon/procevent.c:300:15: [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). lineptr += strlen(lineptr); data/firejail-0.9.64/src/firemon/procevent.c:360:7: [1] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source is a constant character. sprintf(lineptr, "\n"); data/firejail-0.9.64/src/firemon/procevent.c:376:7: [1] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source is a constant character. sprintf(lineptr, "\n"); data/firejail-0.9.64/src/firemon/procevent.c:399:6: [1] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source is a constant character. sprintf(lineptr, "\n"); data/firejail-0.9.64/src/firemon/procevent.c:417:15: [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). lineptr += strlen(lineptr); data/firejail-0.9.64/src/firemon/procevent.c:419:15: [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). lineptr += strlen(lineptr); data/firejail-0.9.64/src/firemon/procevent.c:427:16: [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). lineptr += strlen(lineptr); data/firejail-0.9.64/src/firemon/procevent.c:441:16: [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). lineptr += strlen(lineptr); data/firejail-0.9.64/src/firemon/procevent.c:445:16: [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). lineptr += strlen(lineptr); data/firejail-0.9.64/src/firemon/procevent.c:454:6: [1] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source is a constant character. sprintf(lineptr, "\n"); data/firejail-0.9.64/src/firemon/procevent.c:459:16: [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). lineptr += strlen(lineptr); data/firejail-0.9.64/src/firemon/route.c:85:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(last_start, start, MAXBUF); data/firejail-0.9.64/src/firemon/route.c:147:12: [1] (buffer) sscanf: It's unclear if the %s limit in the format string is small enough (CWE-120). Check that the limit is sufficiently small, or use a different input function. int rv = sscanf(start, "%63s %63s %63s %63s %63s %63s %63s %63s\n", ifname, destination, gateway, flags, refcnt, use, metric, mask); data/firejail-0.9.64/src/firemon/top.c:99:23: [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). firejail_exec_len = strlen(firejail_exec); data/firejail-0.9.64/src/firemon/top.c:100:30: [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). firejail_exec_prefix_len = strlen(PREFIX) + 5; data/firejail-0.9.64/src/firemon/top.c:247:7: [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(ptr->line) > (size_t)col) data/firejail-0.9.64/src/firemon/top.c:299:7: [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(header) > (size_t)col) data/firejail-0.9.64/src/fnet/arp.c:52:6: [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(dev) > IFNAMSIZ) { data/firejail-0.9.64/src/fnet/arp.c:63:2: [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, IFNAMSIZ - 1); data/firejail-0.9.64/src/fnet/interface.c:35:6: [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(ifname) > IFNAMSIZ) { data/firejail-0.9.64/src/fnet/interface.c:63:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ifr.ifr_name, bridge, IFNAMSIZ - 1); data/firejail-0.9.64/src/fnet/interface.c:95:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ifr.ifr_name, ifname, IFNAMSIZ - 1); data/firejail-0.9.64/src/fnet/interface.c:116:3: [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(10000); // sleep 10ms data/firejail-0.9.64/src/fnet/interface.c:140:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ifr.ifr_name, ifname, IFNAMSIZ - 1); data/firejail-0.9.64/src/fnet/interface.c:159:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ifr.ifr_name, ifname, IFNAMSIZ - 1); data/firejail-0.9.64/src/fnet/interface.c:243:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ifr.ifr_name, ifname, IFNAMSIZ - 1); data/firejail-0.9.64/src/fnet/interface.c:263:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ifr.ifr_name, ifname, IFNAMSIZ - 1); data/firejail-0.9.64/src/fnet/interface.c:284:2: [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(10000); // sleep 10ms data/firejail-0.9.64/src/fnet/interface.c:297:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ifr.ifr_name, ifname, IFNAMSIZ - 1); data/firejail-0.9.64/src/fnet/interface.c:355:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ifr.ifr_name, ifname, IFNAMSIZ - 1); data/firejail-0.9.64/src/fnet/interface.c:467:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ifr.ifr_name, ifname, IFNAMSIZ - 1); data/firejail-0.9.64/src/fnet/interface.c:488:4: [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(500000); data/firejail-0.9.64/src/fnet/veth.c:90:9: [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 = strlen(dev) + 1; data/firejail-0.9.64/src/fnet/veth.c:96:57: [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). addattr_l(&req.n, sizeof(req), IFLA_INFO_KIND, "veth", strlen("veth")); data/firejail-0.9.64/src/fnet/veth.c:109:13: [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). int len = strlen(nsdev) + 1; data/firejail-0.9.64/src/fnet/veth.c:156: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 = strlen(dev) + 1; data/firejail-0.9.64/src/fnet/veth.c:166:60: [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). addattr_l(&req.n, sizeof(req), IFLA_INFO_KIND, "macvlan", strlen("macvlan")); data/firejail-0.9.64/src/fnet/veth.c:215: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 = strlen(dev) + 1; data/firejail-0.9.64/src/fnet/veth.c:225: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). addattr_l(&req.n, sizeof(req), IFLA_INFO_KIND, "ipvlan", strlen("ipvlan")); data/firejail-0.9.64/src/fnetfilter/main.c:95:13: [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). int len = strlen(token); data/firejail-0.9.64/src/fnetfilter/main.c:193: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). int len = strlen(destfile); data/firejail-0.9.64/src/ftee/main.c:42: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). int index = strlen(fname); data/firejail-0.9.64/src/ftee/main.c:147: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). if (fname[strlen(fname) - 1] == '/') data/firejail-0.9.64/src/ftee/main.c:228:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int n = read(0, buf, sizeof(buf)); data/firejail-0.9.64/src/lib/common.c:143:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((len = read(fd, buffer, sizeof(buffer) - 1)) <= 0) { data/firejail-0.9.64/src/lib/common.c:159:6: [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(rv) == 0) { data/firejail-0.9.64/src/lib/common.c:181:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((len = read(fd, buffer, sizeof(buffer) - 1)) <= 0) { data/firejail-0.9.64/src/lib/common.c:199:6: [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(rv) == 0) { data/firejail-0.9.64/src/lib/common.c:232:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((len = read(fd, buffer, sizeof(buffer) - 1)) <= 0) { data/firejail-0.9.64/src/lib/common.c:263: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). i += strlen(arg); data/firejail-0.9.64/src/lib/common.c:307:3: [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(1000); // sleep 1 ms data/firejail-0.9.64/src/lib/ldd_utils.c:50:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ssize_t sz = read(fd, buf, EI_NIDENT); data/firejail-0.9.64/src/lib/libnetlink.c:584:41: [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 addattr_l(n, maxlen, type, str, strlen(str)+1); data/firejail-0.9.64/src/lib/pid.c:230: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). int len = strlen(out); data/firejail-0.9.64/src/lib/syscall.c:1505:6: [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(name) == 0) data/firejail-0.9.64/src/lib/syscall.c:1520:6: [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(syscall_name) == 0) { data/firejail-0.9.64/src/libtrace/libtrace.c:555:3: [1] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source is a constant character. sprintf(ptr, "0"); data/firejail-0.9.64/test/network/tcpserver.c:89:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int rcv = read(newfd, buf, MAXBUF - 1); ANALYSIS SUMMARY: Hits = 923 Lines analyzed = 43230 in approximately 1.41 seconds (30639 lines/second) Physical Source Lines of Code (SLOC) = 32466 Hits@level = [0] 1807 [1] 232 [2] 472 [3] 93 [4] 112 [5] 14 Hits@level+ = [0+] 2730 [1+] 923 [2+] 691 [3+] 219 [4+] 126 [5+] 14 Hits/KSLOC@level+ = [0+] 84.088 [1+] 28.4297 [2+] 21.2838 [3+] 6.74552 [4+] 3.88098 [5+] 0.43122 Symlinks skipped = 2 (--allowlink overrides but see doc for security issue) Dot directories skipped = 2 (--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.