fedora 23
format weakness #1

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:

FUR-0.4.6/macros.h

Context:

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

 /*

    Useful macros for FUR.
    FUR is Copyright (C) Riccardo Di Meo <riccardo@infis.univ.trieste.it>

    This program can be distributed under the terms of the GNU GPL.
    See the file COPYING.

    FUSE is Copyright of Miklos Szeredi <miklos@szeredi.hu>
*/
#ifndef MACROS_H
#define MACROS_H


#ifdef VERBOSE
#include <stdio.h>

extern FILE *logfile;
#endif


// FIXME put __LINE__ and __FILE__ in a decent way
#ifdef VERBOSE
#define VERB(...) {fprintf(logfile,__VA_ARGS__);fflush(logfile);}
#else
#define VERB(...) 
#endif

#define ERR(...) {fprintf(stderr,"ERROR: "__VA_ARGS__);fflush(stderr);}


#ifdef VERBOSE_CACHE
#define CVERB(...) {fprintf(logfile,__VA_ARGS__);fflush(logfile);}
#define CPRT(INDEX) {print_cache_entry(INDEX);fflush(logfile);}
#else
#define CVERB(...)
#define CPRT(INDEX)
#endif

#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.