alpine 3.6
format weakness #100

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:

libinput/src/libinput-1.7.2/tools/event-gui.c

Context:

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

 		double x_in, y_in;
		double x_down, y_down;
		double x_up, y_up;
		double pressure;
		double distance;
		double tilt_x, tilt_y;

		/* these are for the delta coordinates, but they're not
		 * deltas, they are converted into abs positions */
		size_t ndeltas;
		struct point deltas[64];
	} tool;

	struct libinput_device *devices[50];
};

LIBINPUT_ATTRIBUTE_PRINTF(1, 2)
static int
error(const char *fmt, ...)
{
	va_list args;
	fprintf(stderr, "error: ");

	va_start(args, fmt);
	vfprintf(stderr, fmt, args);
	va_end(args);

	return EXIT_FAILURE;
}

LIBINPUT_ATTRIBUTE_PRINTF(1, 2)
static void
msg(const char *fmt, ...)
{
	va_list args;
	printf("info: ");

	va_start(args, fmt);
	vprintf(fmt, args);
	va_end(args);
}

static inline void
draw_gestures(struct window *w, cairo_t *cr)
{
	int i;
	int offset;

	/* swipe */
	cairo_save(cr); 

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.