Platform: Code4rena
Start Date: 25/01/2023
Pot Size: $36,500 USDC
Total HM: 11
Participants: 173
Period: 5 days
Judge: kirk-baird
Total Solo HM: 1
Id: 208
League: ETH
Rank: 45/173
Findings: 3
Award: $54.60
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: carlitox477
Also found by: 0xRobocop, 0xbepresent, ArmedGoose, Atarpara, IllIllI, Tointer, UdarTeam, adriro, betweenETHlines, cryptojedi88, evan, glcanvas, gzeon, horsefacts, ladboy233, libratus, lukris02, luxartvinsec, manikantanynala97, minhquanym, mookimgo, p4st13r4, simon135, thekmj, trustindistrust
18.6976 USDC - $18.70
If the claim
function runs out of gas, the caller can never claim any rewards without transferring the nfts to another address first
Currently, the claim
function loops over the msg.sender
s NFT's. If this list ever becomes too large, the function will run out of gas.
VSCode
Consider implementing pagination for reward claiming.
#0 - c4-judge
2023-02-06T23:10:02Z
kirk-baird marked the issue as duplicate of #135
#1 - c4-judge
2023-02-14T09:17:02Z
kirk-baird marked the issue as satisfactory
🌟 Selected for report: AkshaySrivastav
Also found by: KIntern_NA, SovaSlava, Tointer, Tricko, V_B, __141345__, betweenETHlines, bin2chen, cccz, critical-or-high, glcanvas, halden, hihen, jesusrod15, ladboy233, libratus, m9800, minhquanym, omis, peakbolt, rbserver, romand, rvierdiiev, wait, zaskoh
18.6976 USDC - $18.70
A replay attack could lead to undesired minting of NFTS from other privileged contracts and on other chains
Currently, the mintReceipt
function mints one NFT to the msg.sender if the signature is valid. However, since the signature only consists of msg.sender
and _questId
, it becomes vulnerable for a replay attack.
Consider the following scenario:
The Rabbithole team decides to go crosschain with the same contracts. Alice got an approved signature for questId 1 on the origin chain. However, this signature is now also valid on the new chain.
Furthermore, this issue would also be present if a new QuestFactory
is deployed and used.
VSCode
Consider simply add the chainId and address(this) to the signature in order to reduce the risk of replay attacks. Moreover it might make sense to implement an expire timestamp.
#0 - c4-judge
2023-02-06T23:04:39Z
kirk-baird marked the issue as duplicate of #45
#1 - c4-judge
2023-02-14T09:57:54Z
kirk-baird marked the issue as satisfactory