alpine 3.6
access weakness #211

1

Weakness Breakdown


Definition:

An access weakness occurs when software does not properly implement permissions that could have unintended consequences if exploited by malicious actors. An example of this weakness is when a default username and password are set by the developer but do not get changed by the system administrator.

Warning code(s):

Ensure that umask is given most restrictive possible setting.

File Name:

dircproxy/src/dircproxy-RELEASE-1_2_0-BETA/src/main.c

Context:

The highlighted line of code below is the trigger point of this particular Alpine 3.6 access weakness.

   switch (fork()) {
    case -1:
      syscall_fail("fork", "first", 0);
      return -1;
    case 0:
      break;
    default:
      return 1;
  }

  /* Become process group leader */
  setsid();

  switch (fork()) {
    case -1:
      syscall_fail("fork", "second", 0);
      return -1;
    case 0:
      break;
    default:
      return 2;
  }
  
  /* Set our umask */    
  umask(0);

  /* Okay, we're in the background now */
  in_background = 1;
  return 0;
} 

The registered trademark Linux® is used pursuant to a sublicense from the Linux Foundation, the exclusive licensee of Linus Torvalds, owner of the mark on a world­wide basis.