alpine 3.7
format weakness #4

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, and note that sprintf variations do not always 0-terminate.

File Name:

acpica/src/acpica-unix-20170303/source/include/platform/accygwin.h

Context:

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

 #define ACPI_USE_NATIVE_DIVIDE
#endif

#ifndef __cdecl
#define __cdecl
#endif

#define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) if (GLptr) Acq=1; else Acq=0;
#define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Pending) Pending = 1

/* On Cygwin, pthread_t is a pointer */

#define ACPI_CAST_PTHREAD_T(pthread) ((ACPI_THREAD_ID) ACPI_TO_INTEGER (pthread))


/*
 * The vsnprintf/snprintf functions are defined by c99, but cygwin/gcc
 * does not enable this prototype when the -ansi flag is set. Also related
 * to __STRICT_ANSI__. So, we just declare the prototype here.
 */
int
vsnprintf (char *s, size_t n, const char *format, va_list ap);

int
snprintf (char *s, size_t n, const char *format, ...);

#endif /* __ACCYGWIN_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.