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/xfce4-session-4.15.1/xfce4-session-logout/main.c Examining data/xfce4-session-4.15.1/settings/xfce4-session-settings_ui.h Examining data/xfce4-session-4.15.1/settings/xfce4-session-marshal.h Examining data/xfce4-session-4.15.1/settings/xfae-model.c Examining data/xfce4-session-4.15.1/settings/xfae-window.h Examining data/xfce4-session-4.15.1/settings/xfsm-client-dbus-client.c Examining data/xfce4-session-4.15.1/settings/xfae-model.h Examining data/xfce4-session-4.15.1/settings/xfae-window.c Examining data/xfce4-session-4.15.1/settings/xfce4-session-settings-common.h Examining data/xfce4-session-4.15.1/settings/session-editor.c Examining data/xfce4-session-4.15.1/settings/xfsm-client-dbus-client.h Examining data/xfce4-session-4.15.1/settings/xfae-dialog.c Examining data/xfce4-session-4.15.1/settings/xfsm-manager-dbus-client.h Examining data/xfce4-session-4.15.1/settings/main.c Examining data/xfce4-session-4.15.1/settings/xfsm-manager-dbus-client.c Examining data/xfce4-session-4.15.1/settings/xfae-dialog.h Examining data/xfce4-session-4.15.1/settings/xfce4-session-marshal.c Examining data/xfce4-session-4.15.1/xfsm-shutdown-helper/main.c Examining data/xfce4-session-4.15.1/xfce4-session/xfsm-dns.c Examining data/xfce4-session-4.15.1/xfce4-session/xfsm-properties.h Examining data/xfce4-session-4.15.1/xfce4-session/xfsm-global.h Examining data/xfce4-session-4.15.1/xfce4-session/xfsm-properties.c Examining data/xfce4-session-4.15.1/xfce4-session/xfsm-consolekit.c Examining data/xfce4-session-4.15.1/xfce4-session/xfsm-error.c Examining data/xfce4-session-4.15.1/xfce4-session/xfsm-chooser-icon.h Examining data/xfce4-session-4.15.1/xfce4-session/xfsm-logout-dialog.h Examining data/xfce4-session-4.15.1/xfce4-session/xfsm-chooser.h Examining data/xfce4-session-4.15.1/xfce4-session/xfce-screensaver.h Examining data/xfce4-session-4.15.1/xfce4-session/xfsm-manager.c Examining data/xfce4-session-4.15.1/xfce4-session/sm-layer.c Examining data/xfce4-session-4.15.1/xfce4-session/xfsm-error.h Examining data/xfce4-session-4.15.1/xfce4-session/xfsm-systemd.h Examining data/xfce4-session-4.15.1/xfce4-session/xfsm-dns.h Examining data/xfce4-session-4.15.1/xfce4-session/sm-layer.h Examining data/xfce4-session-4.15.1/xfce4-session/xfsm-logout-dialog.c Examining data/xfce4-session-4.15.1/xfce4-session/xfsm-client.h Examining data/xfce4-session-4.15.1/xfce4-session/xfsm-consolekit.h Examining data/xfce4-session-4.15.1/xfce4-session/xfsm-shutdown-fallback.h Examining data/xfce4-session-4.15.1/xfce4-session/xfsm-manager-dbus.h Examining data/xfce4-session-4.15.1/xfce4-session/xfsm-manager.h Examining data/xfce4-session-4.15.1/xfce4-session/xfsm-startup.h Examining data/xfce4-session-4.15.1/xfce4-session/xfsm-compat-gnome.h Examining data/xfce4-session-4.15.1/xfce4-session/xfsm-chooser.c Examining data/xfce4-session-4.15.1/xfce4-session/xfce-screensaver.c Examining data/xfce4-session-4.15.1/xfce4-session/xfsm-shutdown.h Examining data/xfce4-session-4.15.1/xfce4-session/xfsm-manager-dbus.c Examining data/xfce4-session-4.15.1/xfce4-session/xfsm-client.c Examining data/xfce4-session-4.15.1/xfce4-session/xfsm-systemd.c Examining data/xfce4-session-4.15.1/xfce4-session/xfsm-startup.c Examining data/xfce4-session-4.15.1/xfce4-session/xfsm-legacy.h Examining data/xfce4-session-4.15.1/xfce4-session/xfsm-fadeout.h Examining data/xfce4-session-4.15.1/xfce4-session/xfsm-compat-kde.c Examining data/xfce4-session-4.15.1/xfce4-session/xfsm-compat-gnome.c Examining data/xfce4-session-4.15.1/xfce4-session/xfsm-marshal.c Examining data/xfce4-session-4.15.1/xfce4-session/xfsm-fadeout.c Examining data/xfce4-session-4.15.1/xfce4-session/xfsm-client-dbus.c Examining data/xfce4-session-4.15.1/xfce4-session/xfsm-shutdown-fallback.c Examining data/xfce4-session-4.15.1/xfce4-session/xfsm-shutdown.c Examining data/xfce4-session-4.15.1/xfce4-session/xfsm-legacy.c Examining data/xfce4-session-4.15.1/xfce4-session/xfsm-client-dbus.h Examining data/xfce4-session-4.15.1/xfce4-session/xfsm-global.c Examining data/xfce4-session-4.15.1/xfce4-session/main.c Examining data/xfce4-session-4.15.1/xfce4-session/ice-layer.h Examining data/xfce4-session-4.15.1/xfce4-session/ice-layer.c Examining data/xfce4-session-4.15.1/xfce4-session/xfsm-compat-kde.h Examining data/xfce4-session-4.15.1/xfce4-session/xfsm-marshal.h Examining data/xfce4-session-4.15.1/libxfsm/xfsm-util.c Examining data/xfce4-session-4.15.1/libxfsm/xfsm-shutdown-common.h Examining data/xfce4-session-4.15.1/libxfsm/xfsm-util.h FINAL RESULTS: data/xfce4-session-4.15.1/settings/xfae-model.c:794: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. if (access (dir, R_OK | W_OK | X_OK) < 0) data/xfce4-session-4.15.1/xfce4-session/ice-layer.c:353:7: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. if (system (command) != 0) data/xfce4-session-4.15.1/xfce4-session/ice-layer.c:374:7: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. if (system (command)) data/xfce4-session-4.15.1/xfce4-session/main.c:296:8: [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. if (!execvp ("dbus-launch", new_argv)) data/xfce4-session-4.15.1/xfce4-session/sm-layer.c:174:9: [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 (*failure_reason, error); data/xfce4-session-4.15.1/xfce4-session/xfsm-global.c:124:3: [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 (fp, format, valist); data/xfce4-session-4.15.1/xfce4-session/xfsm-global.c:199:17: [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. result = (access (exec, X_OK) == 0); data/xfce4-session-4.15.1/xfce4-session/xfsm-global.c:217:21: [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. result = (access (p, X_OK) == 0); data/xfce4-session-4.15.1/xfce4-session/xfsm-properties.c:99:5: [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 (t, s); data/xfce4-session-4.15.1/xfce4-session/xfsm-systemd.h:25:27: [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. #define LOGIND_RUNNING() (access ("/run/systemd/seats/", F_OK) >= 0) data/xfce4-session-4.15.1/settings/xfae-model.c:191:18: [3] (random) g_random_int: 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. model->stamp = g_random_int (); data/xfce4-session-4.15.1/xfce4-session/xfsm-global.c:157:44: [3] (random) g_random_int: 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. addr = g_strdup_printf ("0%.8x", g_random_int ()); data/xfce4-session-4.15.1/settings/session-editor.c:613:27: [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). gint new_prio_i = atoi(new_text); data/xfce4-session-4.15.1/xfce4-session/main.c:115: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 (authfile, O_RDWR | O_CREAT, 0600); data/xfce4-session-4.15.1/xfce4-session/sm-layer.c:110:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char error[2048]; data/xfce4-session-4.15.1/xfce4-session/xfsm-dns.c:92: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 buffer[256]; data/xfce4-session-4.15.1/xfce4-session/xfsm-global.c:111: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). fp = fopen (logfile, "w"); data/xfce4-session-4.15.1/xfce4-session/xfsm-startup.c:107: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). pid = atoi (fields[1]); data/xfce4-session-4.15.1/xfce4-session/xfsm-startup.c:122:10: [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 (ssh_agent_pid); data/xfce4-session-4.15.1/libxfsm/xfsm-util.c:184:21: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). bp = buffer + strlen (buffer); data/xfce4-session-4.15.1/libxfsm/xfsm-util.c:194: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). for (bp = buffer + strlen (buffer) - 1; *bp != ':'; --bp) data/xfce4-session-4.15.1/xfce4-session/ice-layer.c:227:10: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). mode = umask (0077); data/xfce4-session-4.15.1/xfce4-session/ice-layer.c:240:3: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask (mode); data/xfce4-session-4.15.1/xfce4-session/main.c:97:21: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (sm != NULL && strlen (sm) > 0) data/xfce4-session-4.15.1/xfce4-session/sm-layer.c:172: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). *failure_reason = (char *) malloc (strlen (error) + 1); data/xfce4-session-4.15.1/xfce4-session/xfsm-client.c:246: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). g_strcanon (client->object_path + strlen (XFSM_CLIENT_OBJECT_PATH_PREFIX), data/xfce4-session-4.15.1/xfce4-session/xfsm-manager.c:726: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). if (strlen (*name_return) == 0) data/xfce4-session-4.15.1/xfce4-session/xfsm-manager.c:2089: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). if (strlen (new_service_name) == 0) { data/xfce4-session-4.15.1/xfce4-session/xfsm-properties.c:97: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). t = (char *) malloc (strlen (s) + 1); data/xfce4-session-4.15.1/xfce4-session/xfsm-properties.c:137: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). prop->vals[argc].length = strlen (argv[argc]) + 1; data/xfce4-session-4.15.1/xfce4-session/xfsm-properties.c:156: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). prop->vals[0].length = strlen (value) + 1; ANALYSIS SUMMARY: Hits = 31 Lines analyzed = 35641 in approximately 0.77 seconds (46095 lines/second) Physical Source Lines of Code (SLOC) = 24780 Hits@level = [0] 14 [1] 12 [2] 7 [3] 2 [4] 10 [5] 0 Hits@level+ = [0+] 45 [1+] 31 [2+] 19 [3+] 12 [4+] 10 [5+] 0 Hits/KSLOC@level+ = [0+] 1.81598 [1+] 1.25101 [2+] 0.766747 [3+] 0.484262 [4+] 0.403551 [5+] 0 Dot directories skipped = 1 (--followdotdir overrides) Minimum risk level = 1 Not every hit is necessarily a security vulnerability. There may be other security vulnerabilities; review your code! See 'Secure Programming HOWTO' (https://dwheeler.com/secure-programs) for more information.