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/kscreenlocker-5.19.5/waylandlocker.cpp
Examining data/kscreenlocker-5.19.5/waylandserver.h
Examining data/kscreenlocker-5.19.5/powermanagement_inhibition.h
Examining data/kscreenlocker-5.19.5/kscreensaversettings.h
Examining data/kscreenlocker-5.19.5/waylandserver.cpp
Examining data/kscreenlocker-5.19.5/powermanagement_inhibition.cpp
Examining data/kscreenlocker-5.19.5/greeter/kwinglplatform.cpp
Examining data/kscreenlocker-5.19.5/greeter/kwinglplatform.h
Examining data/kscreenlocker-5.19.5/greeter/lnf_integration.cpp
Examining data/kscreenlocker-5.19.5/greeter/seccomp_filter.cpp
Examining data/kscreenlocker-5.19.5/greeter/lnf_integration.h
Examining data/kscreenlocker-5.19.5/greeter/noaccessnetworkaccessmanagerfactory.h
Examining data/kscreenlocker-5.19.5/greeter/main.cpp
Examining data/kscreenlocker-5.19.5/greeter/greeterapp.h
Examining data/kscreenlocker-5.19.5/greeter/authenticator.h
Examining data/kscreenlocker-5.19.5/greeter/authenticator.cpp
Examining data/kscreenlocker-5.19.5/greeter/autotests/killtest.cpp
Examining data/kscreenlocker-5.19.5/greeter/autotests/authenticatortest.cpp
Examining data/kscreenlocker-5.19.5/greeter/autotests/seccomp_test.cpp
Examining data/kscreenlocker-5.19.5/greeter/autotests/fakekcheckpass.c
Examining data/kscreenlocker-5.19.5/greeter/noaccessnetworkaccessmanagerfactory.cpp
Examining data/kscreenlocker-5.19.5/greeter/greeterapp.cpp
Examining data/kscreenlocker-5.19.5/greeter/wallpaper_integration.h
Examining data/kscreenlocker-5.19.5/greeter/wallpaper_integration.cpp
Examining data/kscreenlocker-5.19.5/greeter/seccomp_filter.h
Examining data/kscreenlocker-5.19.5/globalaccel.cpp
Examining data/kscreenlocker-5.19.5/powermanagement.h
Examining data/kscreenlocker-5.19.5/ksldapp.h
Examining data/kscreenlocker-5.19.5/kscreensaversettings.cpp
Examining data/kscreenlocker-5.19.5/ksldapp.cpp
Examining data/kscreenlocker-5.19.5/waylandlocker.h
Examining data/kscreenlocker-5.19.5/autotests/pointergrabber.cpp
Examining data/kscreenlocker-5.19.5/autotests/x11lockertest.cpp
Examining data/kscreenlocker-5.19.5/autotests/fakelogind.h
Examining data/kscreenlocker-5.19.5/autotests/fakelogind.cpp
Examining data/kscreenlocker-5.19.5/autotests/noscreens.cpp
Examining data/kscreenlocker-5.19.5/autotests/logindtest.cpp
Examining data/kscreenlocker-5.19.5/autotests/ksldtest.cpp
Examining data/kscreenlocker-5.19.5/autotests/keyboardgrabber.cpp
Examining data/kscreenlocker-5.19.5/powermanagement.cpp
Examining data/kscreenlocker-5.19.5/interface.cpp
Examining data/kscreenlocker-5.19.5/tests/powermanagementtest.cpp
Examining data/kscreenlocker-5.19.5/tests/kcheckpass_test.cpp
Examining data/kscreenlocker-5.19.5/tests/kscreenlocker_main.cpp
Examining data/kscreenlocker-5.19.5/abstractlocker.h
Examining data/kscreenlocker-5.19.5/abstractlocker.cpp
Examining data/kscreenlocker-5.19.5/kcm/kcm.cpp
Examining data/kscreenlocker-5.19.5/kcm/kcm.h
Examining data/kscreenlocker-5.19.5/x11locker.h
Examining data/kscreenlocker-5.19.5/logind.h
Examining data/kscreenlocker-5.19.5/kcheckpass/checkpass_pam.c
Examining data/kscreenlocker-5.19.5/kcheckpass/kcheckpass-enums.h
Examining data/kscreenlocker-5.19.5/kcheckpass/kcheckpass.h
Examining data/kscreenlocker-5.19.5/kcheckpass/checkpass_shadow.c
Examining data/kscreenlocker-5.19.5/kcheckpass/kcheckpass.c
Examining data/kscreenlocker-5.19.5/x11locker.cpp
Examining data/kscreenlocker-5.19.5/interface.h
Examining data/kscreenlocker-5.19.5/globalaccel.h
Examining data/kscreenlocker-5.19.5/logind.cpp

FINAL RESULTS:

data/kscreenlocker-5.19.5/greeter/seccomp_filter.cpp:118:63:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
    seccomp_rule_add(context, SCMP_ACT_ERRNO(EPERM), SCMP_SYS(chmod), 0);
data/kscreenlocker-5.19.5/greeter/authenticator.cpp:139:9:  [4] (shell) execlp:
  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.
        execlp(QFile::encodeName(QStringLiteral(KCHECKPASS_BIN)).data(),
data/kscreenlocker-5.19.5/greeter/autotests/fakekcheckpass.c:47:57:  [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.
# define ATTR_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
data/kscreenlocker-5.19.5/greeter/autotests/fakekcheckpass.c:204: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(stderr, fmt, ap);
data/kscreenlocker-5.19.5/greeter/autotests/seccomp_test.cpp:243:14:  [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.
    QCOMPARE(execl(existingFileChar, "fakekcheckpass", (char*)nullptr), -1);
data/kscreenlocker-5.19.5/kcheckpass/checkpass_shadow.c:69:17:  [4] (crypto) crypt:
  The crypt functions use a poor one-way hashing algorithm; since they only
  accept passwords of 8 characters or fewer and only a two-byte salt, they
  are excessively vulnerable to dictionary attacks given today's faster
  computing equipment (CWE-327). Use a different algorithm, such as SHA-256,
  with a larger, non-repeating salt.
  crpt_passwd = crypt(typed_in_password, password);
data/kscreenlocker-5.19.5/kcheckpass/kcheckpass.c:238: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(stderr, fmt, ap);
data/kscreenlocker-5.19.5/kcheckpass/kcheckpass.h:75:57:  [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.
# define ATTR_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
data/kscreenlocker-5.19.5/greeter/autotests/fakekcheckpass.c:238:15:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
  while ((c = getopt(argc, argv, "hm:S:")) != -1) {
data/kscreenlocker-5.19.5/interface.cpp:62:30:  [3] (random) random:
  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.
    m_next_cookie = KRandom::random() % 20000;
data/kscreenlocker-5.19.5/kcheckpass/checkpass_pam.c:156:11:  [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.
    tty = getenv ("DISPLAY");
data/kscreenlocker-5.19.5/kcheckpass/kcheckpass.c:321:15:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
  while ((c = getopt(argc, argv, "hm:S:")) != -1) {
data/kscreenlocker-5.19.5/kcheckpass/kcheckpass.c:344: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.
  if (!(p = getenv("LOGNAME")) || !(pw = getpwnam(p)) || pw->pw_uid != uid)
data/kscreenlocker-5.19.5/kcheckpass/kcheckpass.c:345: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.
    if (!(p = getenv("USER")) || !(pw = getpwnam(p)) || pw->pw_uid != uid)
data/kscreenlocker-5.19.5/greeter/authenticator.cpp:122: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 fdbuf[16];
data/kscreenlocker-5.19.5/greeter/authenticator.cpp:138:9:  [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(fdbuf, "%d", sfd[1]);
data/kscreenlocker-5.19.5/greeter/autotests/fakekcheckpass.c:225:18:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
      if ((nfd = open("/dev/null", O_WRONLY)) < 0) {
data/kscreenlocker-5.19.5/greeter/autotests/fakekcheckpass.c:244: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).
      sfd = atoi(optarg);
data/kscreenlocker-5.19.5/greeter/autotests/seccomp_test.cpp:85:19:  [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).
    QVERIFY(!file.open());
data/kscreenlocker-5.19.5/greeter/autotests/seccomp_test.cpp:95:19:  [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).
    QVERIFY(!file.open(QIODevice::WriteOnly));
data/kscreenlocker-5.19.5/greeter/autotests/seccomp_test.cpp:96:19:  [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).
    QVERIFY(!file.open(QIODevice::ReadWrite));
data/kscreenlocker-5.19.5/greeter/autotests/seccomp_test.cpp:97:18:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    QVERIFY(file.open(QIODevice::ReadOnly));
data/kscreenlocker-5.19.5/greeter/autotests/seccomp_test.cpp:102: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).
    QVERIFY(open(createPathChar, O_RDONLY | O_CREAT, 0) == -1 && errno == EPERM);
data/kscreenlocker-5.19.5/greeter/autotests/seccomp_test.cpp:120: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).
    QVERIFY(open(existingFileChar, O_RDWR) == -1 && errno == EPERM);
data/kscreenlocker-5.19.5/greeter/autotests/seccomp_test.cpp:223:18:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    QVERIFY(file.open(QIODevice::ReadOnly));
data/kscreenlocker-5.19.5/greeter/seccomp_filter.cpp:86:67:  [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).
        seccomp_rule_add(context, SCMP_ACT_ERRNO(EPERM), SCMP_SYS(open), 1, SCMP_A1(SCMP_CMP_MASKED_EQ, O_WRONLY, O_WRONLY));
data/kscreenlocker-5.19.5/greeter/seccomp_filter.cpp:87:67:  [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).
        seccomp_rule_add(context, SCMP_ACT_ERRNO(EPERM), SCMP_SYS(open), 1, SCMP_A1(SCMP_CMP_MASKED_EQ, O_RDWR, O_RDWR));
data/kscreenlocker-5.19.5/greeter/seccomp_filter.cpp:94:67:  [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).
        seccomp_rule_add(context, SCMP_ACT_ERRNO(EPERM), SCMP_SYS(open), 1, SCMP_A1(SCMP_CMP_MASKED_EQ, O_CREAT, O_CREAT));
data/kscreenlocker-5.19.5/greeter/seccomp_filter.cpp:128:63:  [2] (race) vfork:
  On some old systems, vfork() permits race conditions, and it's very
  difficult to use correctly (CWE-362). Use fork() instead.
    seccomp_rule_add(context, SCMP_ACT_ERRNO(EPERM), SCMP_SYS(vfork), 0);
data/kscreenlocker-5.19.5/kcheckpass/checkpass_pam.c:137: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		pservb[64];
data/kscreenlocker-5.19.5/kcheckpass/checkpass_pam.c:144: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(pservb, "%.31s-%.31s", KSCREENSAVER_PAM_SERVICE, method);
data/kscreenlocker-5.19.5/kcheckpass/kcheckpass.c:308:18:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
      if ((nfd = open("/dev/null", O_WRONLY)) < 0) {
data/kscreenlocker-5.19.5/kcheckpass/kcheckpass.c:330: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).
      sfd = atoi(optarg);
data/kscreenlocker-5.19.5/greeter/authenticator.cpp:160:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        ret = ::read(m_fd, (void *)((char *)buf + rlen), count - rlen);
data/kscreenlocker-5.19.5/greeter/authenticator.cpp:192: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).
    int len = buf ? ::strlen (buf) + 1 : 0;
data/kscreenlocker-5.19.5/greeter/autotests/fakekcheckpass.c:61:15:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        ret = read (sfd, (void *)((char *)buf + rlen), count - rlen);
data/kscreenlocker-5.19.5/greeter/autotests/fakekcheckpass.c:103: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).
    unsigned len = buf ? strlen (buf) + 1 : 0;
data/kscreenlocker-5.19.5/kcheckpass/kcheckpass.c:89:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	ret = read (sfd, (void *)((char *)buf + rlen), count - rlen);
data/kscreenlocker-5.19.5/kcheckpass/kcheckpass.c:131: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).
    unsigned len = buf ? strlen (buf) + 1 : 0;
data/kscreenlocker-5.19.5/kcheckpass/kcheckpass.c:409:23:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        sigReadSize = read(signalFd, &fdsi, sizeof(struct signalfd_siginfo));
data/kscreenlocker-5.19.5/kcheckpass/kcheckpass.c:515: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).
    memset(str, 0, strlen(str));
data/kscreenlocker-5.19.5/x11locker.cpp:106:49:  [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 char *) version, strlen(version));

ANALYSIS SUMMARY:

Hits = 42
Lines analyzed = 10836 in approximately 0.99 seconds (10945 lines/second)
Physical Source Lines of Code (SLOC) = 7370
Hits@level = [0]   1 [1]   9 [2]  19 [3]   6 [4]   7 [5]   1
Hits@level+ = [0+]  43 [1+]  42 [2+]  33 [3+]  14 [4+]   8 [5+]   1
Hits/KSLOC@level+ = [0+] 5.83446 [1+] 5.69878 [2+] 4.47761 [3+] 1.89959 [4+] 1.08548 [5+] 0.135685
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.