alpine 3.6
access weakness #292

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/mhlistsbr.c

Context:

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

 /*
** Top level entry point to list group of messages
*/
void
list_all_messages(CT *cts, int verbose, int debug)
{
	CT ct, *ctp;

	printf(LSTFMT1, "msg", "part", "type/subtype", "size", "description");
	for (ctp = cts; *ctp; ctp++) {
		ct = *ctp;
		list_single_message(ct, verbose, debug);
	}
	flush_errors();
}


/*
** Entry point to list a single message
*/
static void
list_single_message(CT ct, int verbose, int debug)
{
	if (type_ok(ct, 1)) {
		umask(ct->c_umask);
		list_switch(ct, 1, verbose, debug);
		if (ct->c_fp) {
			fclose(ct->c_fp);
			ct->c_fp = NULL;
		}
		if (ct->c_ceclosefnx)
			(*ct->c_ceclosefnx) (ct);
	}
}


/*
** Primary switching routine to list information about a content
*/
int
list_switch(CT ct, int toplevel, int verbose, int debug)
{
	switch (ct->c_type) {
	case CT_MULTIPART:
		return list_multi(ct, toplevel, verbose, debug);
		break;

	case CT_MESSAGE:
		if (ct->c_subtype == MESSAGE_PARTIAL) {
			return list_partial(ct, toplevel, verbose, debug); 

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.