Platform: Code4rena
Start Date: 30/11/2021
Pot Size: $100,000 USDC
Total HM: 15
Participants: 36
Period: 7 days
Judge: 0xean
Total Solo HM: 4
Id: 62
League: ETH
Rank: 24/36
Findings: 2
Award: $1,246.40
π Selected for report: 1
π Solo Findings: 0
π Selected for report: egjlmn1
Also found by: WatchPug, itsmeSTYJ, toastedsteaksandwich
440.5795 USDC - $440.58
itsmeSTYJ
It is possible to frontrun the standard ERC20 token approve function.
Read this for more info.
Either require that allowance is 0 before approve can be called or use increase / decrease allowance e.g. openzeppelin's ERC20 token implementation
#0 - 0xean
2022-01-16T00:56:18Z
dupe of #55
π Selected for report: itsmeSTYJ
805.8152 USDC - $805.82
itsmeSTYJ
Some projects might rely on tx.origin to remove the need for calling approve()
for their token. When these tokens are used as a deposit, reward or incentive token, it is possible to steal these funds by sending in a malicious token that calls the vulnerable token internally.
Stream creators who cannot read code are more susceptible to this attack as they are not aware that the token is using tx.origin
instead of msg.sender
.
recoverTokens(B, attacker)
, it will send back B to the attacker but at the same time, it will also steal all of A.Here's an article of the rune token being attacked. https://www.adrianhetman.com/unboxing-tx-origin/
#0 - brockelmore
2021-12-03T23:14:15Z
While this is possible, the only way this is exploitable is:
I would consider the fact that its nonconforming and the stream creator has to intentionally enable a mechanism to rug pull this specific token as this being either low risk or invalid. The benchmark here is that uniswap would be vulnerable to this exact thing as well.
#1 - 0xean
2022-01-16T00:52:58Z
Marking down to low-risk