alpine 3.6
access weakness #137


Weakness Breakdown


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:



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

 int nofork_session = 0;

static char *Title;
static int TitleLen;

static SIGVAL ChildNotify (int n);

static long StorePid (void);
static void RemovePid (void);

static pid_t parent_pid = -1; 	/* PID of parent xdm process */

main (int argc, char **argv)
    int	oldpid;
    mode_t oldumask;
    char cmdbuf[1024];

    /* make sure at least world write access is disabled */
    if (((oldumask = umask(022)) & 002) == 002)
	(void) umask (oldumask);
    Title = argv[0];
    TitleLen = (argv[argc - 1] + strlen(argv[argc - 1])) - Title;

    set_auth_parameters (argc, argv);

     * Step 1 - load configuration parameters
    InitResources (argc, argv);
    SetConfigFileTime ();
    LoadDMResources ();
     * Only allow root to run in non-debug mode to avoid problems
    if (debugLevel == 0 && getuid() != 0)
	fprintf (stderr, "Only root wants to run %s\n", argv[0]);
	exit (1);
    if (debugLevel == 0 && daemonMode) 

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.