You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Token approvals are vulnerable to front-running attacks
Summary
The approve() function in CToken.sol and Numa.sol is vulnerable to front-running attacks. A malicious spender can front-run an approval change transaction to spend both the old allowance and the new allowance, potentially resulting in the loss of user tokens.
Root Cause
In CToken.sol and Numa.sol there are no functions to safely increase and decrease allowance
Internal pre-conditions
No response
External pre-conditions
No response
Attack Path
Consider the following scenario:
Alice approves Bob to transfer 5 tokens
Alice decides to reduce this allowance to 3 tokens
Bob notices the allowance reduction tx in the mempool and frontruns it to spend the initial allowance of 5 tokens
Bob is granted a new allowance of 3 tokens, and spends it for a total of 8 tokens spent.
Impact
Malicious spender can front-run approve and spend more than intended
PoC
No response
Mitigation
Add increaseAllowance and decreaseAllowance functions to Numa and CToken
The text was updated successfully, but these errors were encountered:
Itchy Ultraviolet Monkey
Medium
Token approvals are vulnerable to front-running attacks
Summary
The
approve()
function inCToken.sol
andNuma.sol
is vulnerable to front-running attacks. A malicious spender can front-run an approval change transaction to spend both the old allowance and the new allowance, potentially resulting in the loss of user tokens.Root Cause
In CToken.sol and
Numa.sol
there are no functions to safely increase and decrease allowanceInternal pre-conditions
No response
External pre-conditions
No response
Attack Path
Consider the following scenario:
Impact
Malicious spender can front-run approve and spend more than intended
PoC
No response
Mitigation
Add
increaseAllowance
anddecreaseAllowance
functions to Numa and CTokenThe text was updated successfully, but these errors were encountered: