fedora 24
format weakness #59


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

File Name:



The highlighted line of code below is the trigger point of this particular Fedora 24 format weakness.

    environ = new_environ;


void avahi_set_proc_title(const char *name, const char *fmt,...) {
    char t[256];

    va_list ap;
    va_start(ap, fmt);
    vsnprintf(t, sizeof(t), fmt, ap);

    setproctitle("-%s", t);
#elif defined(__linux__)
    size_t l;
    va_list ap;

    if (!argv_buffer)

    va_start(ap, fmt);
    vsnprintf(argv_buffer[0], argv_size, fmt, ap);

    l = strlen(argv_buffer[0]);

    memset(argv_buffer[0] + l, 0, argv_size - l);
    argv_buffer[1] = NULL;

#if defined(HAVE_SYS_PRCTL_H) && defined(PR_SET_NAME)

    if (name)
        prctl(PR_SET_NAME, (unsigned long) name, 0, 0, 0);


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.