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

File Name:

gawk/src/gawk-4.2.0/protos.h

Context:

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

 
#endif /* STDC_HEADERS */


/* prototypes for missing functions defined in missing_d/ */

#ifndef HAVE_STRNCASECMP
extern int strcasecmp(const char *s1, const char *s2);
extern int strncasecmp(const char *s1, const char *s2, register size_t n);
#endif

#ifndef HAVE_STRTOUL
extern unsigned long int strtoul(const char *, char **endptr, int base);
#endif

#ifndef HAVE_TZSET
extern void tzset();
#endif

#ifndef HAVE_MKTIME
extern time_t mktime(struct tm *tp);
#endif

#ifndef HAVE_SNPRINTF
extern int snprintf(char *restrict buf, size_t len, const char *restrict fmt, ...);
#endif

#ifndef HAVE_USLEEP
extern int usleep(unsigned int);
#endif

#ifndef HAVE_SETENV
extern int setenv(const char *, const char *, int);
extern int unsetenv(const char *);
#endif

#if !defined(HAVE_STRCOLL)
extern int strcoll(const char *, const char *);
#endif
 

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.