fedora 23
race weakness #27

5

Weakness Breakdown


Definition:

A race condition exists when parallel code accesses shared data without proper coordination. An attack that uses a race-condition weakness takes advantage of the unsafe data access to manipulate how one of the parallel sections of code reacts. Even though each process runs as intended, the outcome is unexpected. For example, consider a bank service that depends on an encryption key that it reads from a known location. An independent cryptography service is responsible for generating the key and placing it where the bank is expected to read it in a timely manner. If the bank and cryptography services do not coordinate with each other, then the bank may read a blank encryption key before cryptography writes the key to the location. This can effectively turn off all encryption for the bank without either service, or the administrator, knowing that something has gone wrong.

Warning code(s):

This accepts filename arguments; if an attacker can move those files, a race condition results..

File Name:

arpwatch-2.1a15/lbl/os-sunos3.h

Context:

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

 int	setlinebuf(FILE *);
u_int	vfprintf(FILE *, const char *, char *);	/* arg 3 is really va_list */
#endif

#if __GNUC__ <= 1
int	read(int, const char *, u_int);
int	write(int, const char *, u_int);
#endif

__dead	void abort(void) __attribute__((volatile));
int	abs(int);
#ifdef	__STDC__
struct	sockaddr;
#endif
int	accept(int, struct sockaddr *, int *);
int	access(const char *, int);
u_int	alarm(u_int);
int	atoi(const char *);
long	atol(const char *);
int	bcmp(const void *, const void *, u_int);
void	bcopy(const void *, void *, u_int);
void	bzero(void *, u_int);
char	*calloc(u_int, u_int);
int	chdir(const char *);
int	chmod(const char *, int);
int	chown(const char *, int, int);
int	close(int);
int	connect(int, struct sockaddr *, int);
char	*crypt(const char *, const char *);
int	daemon(int, int);
void	endgrent(void);
void	endpwent(void);
void	endservent(void);
int	execl(const char *, ...);
int	execlp(const char *, ...);
int	execv(const char *, char * const *);
__dead	void exit(int) __attribute__((volatile));
__dead	void _exit(int) __attribute__((volatile));
int	fchmod(int, int);
int	fchown(int, int, int);
int	fcntl(int, int, int);
int	ffs(int);
int	flock(int, int);
int	fork(void);
void	free(void *);
#ifdef	__STDC__
struct	stat;
#endif
int	fstat(int, struct stat *);
int	ftruncate(int, u_long); 

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.