fedora 24
tmpfile weakness #15


Weakness Breakdown


A temporary file weakness occurs when a temporary file that is created and used by a high-privilege process is accidentally shared with a low-privilege process, on account of it being temporary and generated after all security controls have been applied. This allows the low-privilege process to read data from the high-privilege process (information leakage), or worse, influence the high-privilege process by modifying the shared temporary file.

Warning code(s):

Temporary file race condition.

File Name:



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

 #define STOCK_MOVE "nip-move"
#define STOCK_LOCK "nip-lock"
#define STOCK_ALERT "nip-alert"
#define STOCK_SELECT "nip-select"
#define STOCK_LED_RED "nip-led-red"
#define STOCK_LED_GREEN "nip-led-green"
#define STOCK_LED_BLUE "nip-led-blue"
#define STOCK_LED_YELLOW "nip-led-yellow"
#define STOCK_LED_CYAN "nip-led-cyan"
#define STOCK_LED_OFF "nip-led-off"

/* How much we decompile for error messages.
#define MAX_ERROR_FRAG (100)

/* win32 adds '_', sometimes. 
#ifdef OS_WIN32
#ifndef popen
#define popen(b,m) _popen(b,m)
#endif /*popen*/
#ifndef pclose
#define pclose(f) _pclose(f)
#endif /*pclose*/
#define mktemp(f) _mktemp(f)
#endif /*OS_WIN32*/

/* Fwd ref these.
typedef struct _Watch Watch;
typedef struct _Toolitem Toolitem;
typedef struct _BuiltinInfo BuiltinInfo;
typedef struct _Classmodel Classmodel;
typedef struct _Colour Colour;
typedef struct _Column Column;
typedef struct _Columnview Columnview;
typedef struct _Compile Compile;
typedef struct _Conversion Conversion;
typedef struct _Conversionview Conversionview;
typedef struct _Expr Expr;
typedef struct _Filemodel Filemodel;
typedef struct _Heap Heap;
typedef struct _HeapBlock HeapBlock;
typedef struct _Heapmodel Heapmodel;
typedef struct _iArrow iArrow;
typedef struct _iImage iImage;
typedef struct _Imagedisplay Imagedisplay;
typedef struct _Managed Managed;
typedef struct _Managedfile Managedfile;
typedef struct _Managedgvalue Managedgvalue; 

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.