alpine 3.6
access weakness #296


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.

	case CALSW:
		ccto = cccc = ccme = ccflag;

static void
replout(FILE *inb, char *drft, struct msgs *mp,
	int mime, char *form, char *filter)
	enum state state;
	struct field f = {{0}};
	int i;
	struct comp *cptr;
	char **ap;
	int char_read = 0, format_len, mask;
	char *scanl;
	unsigned char *cp;
	FILE *out;

	mask = umask(~m_gmprot());
	if ((out = fopen(drft, "w")) == NULL)
		adios(EX_CANTCREAT, drft, "unable to create");


	/* get new format string */
	cp = new_fs(form, NULL);
	format_len = strlen(cp);

	/* compile format string */
	ncomps = fmt_compile(cp, &fmt) + 1;

	for (ap = addrcomps; *ap; ap++) {
		FINDCOMP(cptr, *ap);
		if (cptr)
			cptr->c_type |= CT_ADDR;

	** ignore any components killed by command line switches
	if (!ccto) {
		FINDCOMP(cptr, "to");
		if (cptr)
			cptr->c_name = ""; 

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.