alpine 3.6
access weakness #84


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.

		if ((error = u_pipe(U->ts.fd, O_NONBLOCK|U_CLOEXEC)))
			return error;

		U-> = getpid();
	} else {
		mode_t mask;

		while (read(U->ts.fd[0], &mask, sizeof mask) > 0)

	return 0;
} /* ts_reset() */

static mode_t unixL_getumask(lua_State *L) {
	unixL_State *U = unixL_getstate(L);
	pid_t pid;
	mode_t mask;
	int error, status;
	ssize_t n;

#if 0
	if (ts_nthreads() == 1) {
		mask = umask(0);

		return mask;

	if ((error = ts_reset(U)))
		return luaL_error(L, "getumask: %s", unixL_strerror(L, error));

	switch ((pid = fork())) {
	case -1:
		return luaL_error(L, "getumask: %s", unixL_strerror(L, errno));
	case 0:
		mask = umask(0777);

		if (sizeof mask != write(U->ts.fd[1], &mask, sizeof mask))


		while (-1 == waitpid(pid, &status, 0)) {
			if (errno == ECHILD)
				break; /* somebody else caught it */ 

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.