alpine 3.6
access weakness #294

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:

mmh/src/mmh-0.3/uip/mhstore.c

Context:

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

 	*/
	if ((cp = context_find(nmhstorage)) && *cp)
		dir = mh_xstrdup(cp);
	else
		dir = mh_xstrdup(cwd);

	for (ctp = cts; *ctp; ctp++) {
		ct = *ctp;
		store_single_message(ct);
	}

	flush_errors();
}


/*
** Entry point to store the content
** in a (single) message
*/

static void
store_single_message(CT ct)
{
	if (type_ok(ct, 1)) {
		umask(ct->c_umask);
		store_switch(ct);
		if (ct->c_fp) {
			fclose(ct->c_fp);
			ct->c_fp = NULL;
		}
		if (ct->c_ceclosefnx)
			(*ct->c_ceclosefnx) (ct);
	}
}


/*
** Switching routine to store different content types
*/

static int
store_switch(CT ct)
{
	switch (ct->c_type) {
	case CT_MULTIPART:
		return store_multi(ct);
		break;

	case CT_MESSAGE:
		switch (ct->c_subtype) { 

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.