alpine 3.6
format weakness #13


Weakness Breakdown


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:



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

	if (ef != NULL) {
		if (optind < argc) {
			if (optind + 1 < argc) {
				fprintf(stderr, catgets(catd, CATSET, 205,
					"More than one file given with -f\n"));
				goto usage;
			ef = argv[optind];
	} else {
		for (i = optind; argv[i]; i++)
			to = checkaddrs(cat(to, extract(argv[i], GTO|GFULL)));
	 * Check for inconsistent arguments.
	if (ef != NULL && to != NULL) {
		fprintf(stderr, catgets(catd, CATSET, 137,
			"Cannot give -f and people to send to.\n"));
		goto usage;
	if (sendflag && !tflag && to == NULL) {
		fprintf(stderr, catgets(catd, CATSET, 138,
			"Send options without primary recipient specified.\n"));
		goto usage;
	if (Rflag && to != NULL) {
		fprintf(stderr, "The -R option is meaningless in send mode.\n");
		goto usage;
	if (Iflag && ef == NULL) {
		fprintf(stderr, catgets(catd, CATSET, 204,
					"Need -f with -I.\n"));
		goto usage;
	if (value("interactive"))
		if (safe_signal(SIGWINCH, SIG_IGN) != SIG_IGN)
			safe_signal(SIGWINCH, setscreensize);
#endif	/* SIGWINCH */
	input = stdin;
	rcvmode = !to && !tflag;
	if (!nosrc)

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.