Submitted by egjlmn1, also found by itsmeSTYJ, toastedsteaksandwich, and WatchPug
A user can steal another users tokens if he frontrun before he changes the allowance.
The approve() function receives an amount to change to.
Lets say user A approved user B to take N tokens, and now he wants to change from N to M, if he calls approve(M) the attacker can frontrun, take the N tokens, wait until after the approve transaction, and take another M tokens. And taking N tokens more than the user wanted.
Manual code review
Change the approve function to either accept the old amount of allowance and require the current allowance to be equal to that, or change to two different functions that increase and decrease the allowance instead of straight on changing it.
brockelmore (Streaming Protocol) acknowledged and disagreed with severity
0xean (judge) commented:
