RabbitHole Quest Protocol contest - ubermensch's results

A protocol to distribute token rewards for completing on-chain tasks.

General Information

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

RabbitHole

Findings Distribution

Researcher Performance

Rank: 146/173

Findings: 1

Award: $7.05

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

7.046 USDC - $7.05

Labels

bug
2 (Med Risk)
downgraded by judge
satisfactory
duplicate-528

External Links

Lines of code

https://github.com/rabbitholegg/quest-protocol/blob/8c4c1f71221570b14a0479c216583342bd652d8d/contracts/Erc1155Quest.sol#L54-L63

Vulnerability details

Impact

In the Erc20Quest contract, the withdrawRemainingTokens function allows the owner to withdraw the remaining tokens after the end of the quest, the transferred amount is the balance of the contract minus the unclaimed tokens. However, the Erc1155Quest contract mismatches this logic, the withdrawRemainingTokens function transfers all the contract balance of the token id stored in rewardAmountInWeiOrTokenId. This represents a significant risk on the users' unclaimed Erc1155 tokens after the end of the quest.

Proof of Concept

https://github.com/rabbitholegg/quest-protocol/blob/8c4c1f71221570b14a0479c216583342bd652d8d/contracts/Erc1155Quest.sol#L54-L63

Tools Used

Manual Code Review

It is recommended to adjust the withdrawRemainingTokens function to prevent the owner from withdrawing the users' unclaimed ERC1155 tokens.

#0 - c4-judge

2023-02-06T22:34:22Z

kirk-baird marked the issue as duplicate of #42

#1 - c4-judge

2023-02-10T05:03:11Z

kirk-baird changed the severity to QA (Quality Assurance)

#2 - c4-judge

2023-02-10T05:12:14Z

This previously downgraded issue has been upgraded by kirk-baird

#3 - c4-judge

2023-02-14T09:27:47Z

kirk-baird marked the issue as satisfactory

#4 - c4-judge

2023-02-23T23:49:21Z

kirk-baird changed the severity to 2 (Med Risk)

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter