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/xeus-python-0.9.0/include/xeus-python/xdebugger.hpp Examining data/xeus-python-0.9.0/include/xeus-python/xeus_python_config.hpp Examining data/xeus-python-0.9.0/include/xeus-python/xinterpreter.hpp Examining data/xeus-python-0.9.0/src/main.cpp Examining data/xeus-python-0.9.0/src/xdebugger.cpp Examining data/xeus-python-0.9.0/src/xdebugpy_client.cpp Examining data/xeus-python-0.9.0/src/xdebugpy_client.hpp Examining data/xeus-python-0.9.0/src/xdisplay.cpp Examining data/xeus-python-0.9.0/src/xdisplay.hpp Examining data/xeus-python-0.9.0/src/xinput.cpp Examining data/xeus-python-0.9.0/src/xinput.hpp Examining data/xeus-python-0.9.0/src/xinspect.cpp Examining data/xeus-python-0.9.0/src/xinspect.hpp Examining data/xeus-python-0.9.0/src/xinteractiveshell.cpp Examining data/xeus-python-0.9.0/src/xinteractiveshell.hpp Examining data/xeus-python-0.9.0/src/xinterpreter.cpp Examining data/xeus-python-0.9.0/src/xis_complete.cpp Examining data/xeus-python-0.9.0/src/xis_complete.hpp Examining data/xeus-python-0.9.0/src/xlinecache.cpp Examining data/xeus-python-0.9.0/src/xlinecache.hpp Examining data/xeus-python-0.9.0/src/xnullcontext.cpp Examining data/xeus-python-0.9.0/src/xnullcontext.hpp Examining data/xeus-python-0.9.0/src/xpaths.cpp Examining data/xeus-python-0.9.0/src/xpaths.hpp Examining data/xeus-python-0.9.0/src/xpython_extension.cpp Examining data/xeus-python-0.9.0/src/xpython_kernel.cpp Examining data/xeus-python-0.9.0/src/xpython_kernel.hpp Examining data/xeus-python-0.9.0/src/xpythonhome.cpp Examining data/xeus-python-0.9.0/src/xpythonhome.hpp Examining data/xeus-python-0.9.0/src/xstream.cpp Examining data/xeus-python-0.9.0/src/xstream.hpp Examining data/xeus-python-0.9.0/src/xtraceback.cpp Examining data/xeus-python-0.9.0/src/xtraceback.hpp Examining data/xeus-python-0.9.0/src/xutils.cpp Examining data/xeus-python-0.9.0/src/xutils.hpp Examining data/xeus-python-0.9.0/test/test_debugger.cpp Examining data/xeus-python-0.9.0/test/xeus_client.cpp Examining data/xeus-python-0.9.0/test/xeus_client.hpp FINAL RESULTS: data/xeus-python-0.9.0/src/xpaths.cpp:45:13: [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. if (readlink("/proc/self/exe", buffer, sizeof(buffer)) != -1) data/xeus-python-0.9.0/src/xinput.cpp:53:25: [4] (misc) getpass: This function is obsolete and not portable. It was in SUSv2 but removed by POSIX.2. What it does exactly varies considerably between systems, particularly in where its prompt is displayed and where it gets its data (e.g., /dev/tty, stdin, stderr, etc.). In addition, some implementations overflow buffers. (CWE-676, CWE-120, CWE-20). Make the specific calls to do exactly what you want. If you continue to use it, or write your own, be sure to zero the password as soon as possible to avoid leaving the cleartext password visible in the process' address space. m_sys_getpass = getpass.attr("getpass"); data/xeus-python-0.9.0/src/xinput.cpp:54:9: [4] (misc) getpass: This function is obsolete and not portable. It was in SUSv2 but removed by POSIX.2. What it does exactly varies considerably between systems, particularly in where its prompt is displayed and where it gets its data (e.g., /dev/tty, stdin, stderr, etc.). In addition, some implementations overflow buffers. (CWE-676, CWE-120, CWE-20). Make the specific calls to do exactly what you want. If you continue to use it, or write your own, be sure to zero the password as soon as possible to avoid leaving the cleartext password visible in the process' address space. getpass.attr("getpass") = allow_stdin ? py::cpp_function(&cpp_getpass, py::arg("prompt") = "") data/xeus-python-0.9.0/src/xinput.cpp:66:9: [4] (misc) getpass: This function is obsolete and not portable. It was in SUSv2 but removed by POSIX.2. What it does exactly varies considerably between systems, particularly in where its prompt is displayed and where it gets its data (e.g., /dev/tty, stdin, stderr, etc.). In addition, some implementations overflow buffers. (CWE-676, CWE-120, CWE-20). Make the specific calls to do exactly what you want. If you continue to use it, or write your own, be sure to zero the password as soon as possible to avoid leaving the cleartext password visible in the process' address space. getpass.attr("getpass") = m_sys_getpass; data/xeus-python-0.9.0/src/xinteractiveshell.cpp:102:36: [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. py::object xinteractive_shell::system(py::str cmd) data/xeus-python-0.9.0/src/xinteractiveshell.hpp:42:20: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. py::object system(py::str cmd); data/xeus-python-0.9.0/src/xpython_kernel.cpp:310:49: [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. .def("system", &xinteractive_shell::system) data/xeus-python-0.9.0/test/test_debugger.cpp:838:25: [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 ret2 = std::system(cmd.c_str()); data/xeus-python-0.9.0/src/main.cpp:90: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. if (std::getenv("JPY_PARENT_PID") != NULL) data/xeus-python-0.9.0/src/main.cpp:92:19: [3] (random) setstate: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. std::clog.setstate(std::ios_base::failbit); data/xeus-python-0.9.0/src/xpythonhome.cpp:28:51: [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* pythonhome_environment = std::getenv("PYTHONHOME"); data/xeus-python-0.9.0/src/main.cpp:77:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char mbstr[1024]; data/xeus-python-0.9.0/src/xpaths.cpp:42:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[1024]; data/xeus-python-0.9.0/src/xpython_kernel.cpp:82:16: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). m_comm.open( data/xeus-python-0.9.0/test/test_debugger.cpp:40:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buff[FILENAME_MAX]; ANALYSIS SUMMARY: Hits = 15 Lines analyzed = 6388 in approximately 0.17 seconds (38248 lines/second) Physical Source Lines of Code (SLOC) = 4509 Hits@level = [0] 4 [1] 0 [2] 4 [3] 3 [4] 7 [5] 1 Hits@level+ = [0+] 19 [1+] 15 [2+] 15 [3+] 11 [4+] 8 [5+] 1 Hits/KSLOC@level+ = [0+] 4.21379 [1+] 3.32668 [2+] 3.32668 [3+] 2.43957 [4+] 1.77423 [5+] 0.221779 Dot directories skipped = 1 (--followdotdir overrides) Minimum risk level = 1 Not every hit is necessarily a security vulnerability. There may be other security vulnerabilities; review your code! See 'Secure Programming HOWTO' (https://dwheeler.com/secure-programs) for more information.