Mitigate Baron SameEdit (CVE-2021-3156) vulnerability

sles 15.1
format weakness #14

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:

fwupdate-12/linux/error.h

Context:

The highlighted line of code below is the trigger point of this particular Sles 15.1 format weakness.

 }

static inline void
__attribute__((__unused__))
warning(const char *fmt, ...)
{
	int saved_errno = errno;
	va_list ap;

	va_start(ap, fmt);
	vprintf(fmt, ap);
	errno = saved_errno;
	printf(": %m\n");
	conditional_error_reporter(verbose >= 2, 1);
	va_end(ap);
}

static inline void
__attribute__((__unused__))
warningx(const char *fmt, ...)
{
	va_list ap;

	va_start(ap, fmt);
	vprintf(fmt, ap);
	printf("\n");
	conditional_error_reporter(verbose >= 2, 1);
	va_end(ap);
}
#endif /* EFIBOOTMGR_ERROR_H__ */ 

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.