alpine 3.7
format weakness #2

4

Weakness Breakdown


Definition:

A format string exploit occurs when the data of an input string is evaluated as a command by the program. This class of attacks is very similar to buffer overflows since an attacker could execute code, read the stack or cause new behaviors that compromise security. Learn more about format string attacks on OWASP attack index.

Warning code(s):

If format strings can be influenced by an attacker, they can be exploited.

File Name:

abook/src/abook-0.6.1/filter.c

Context:

The highlighted line of code below is the trigger point of this particular Alpine 3.7 format weakness.

 	}

	return 0;
}

/*
 * end of pine addressbook import filter
 */


/*
 * pine addressbook export filter
 *
 *  filter doesn't wrap the lines as it should but Pine seems to handle
 *  created files without problems - JH
 */

static int
pine_export_database(FILE *out, struct db_enumerator e)
{
	char *emails;

	db_enumerate_items(e) {
		emails = db_email_get(e.item);
		fprintf(out, strchr(emails, ',') /* multiple addresses? */ ?
				"%s\t%s\t(%s)\t\t%s\n" : "%s\t%s\t%s\t\t%s\n",
				safe_str(db_fget(e.item, NICK)),
				safe_str(db_name_get(e.item)),
				emails,
				safe_str(db_fget(e.item, NOTES))
				);
		free(emails);
	}

	return 0;
}

/*
 * end of pine addressbook export filter
 */


/*
 * csv import filter
 */

/* This is used by both allcsv_export_database() and csv_export_common()
   to distinguish between standard and defined fields.
   To avoid confusions this should stay > ITEM_FIELDS  */
#define CUSTOM_FIELD_START_INDEX       (ITEM_FIELDS + 10) 

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.