Arcade.xyz - zaevlad's results

The first of its kind Web3 platform to enable liquid lending markets for NFTs.

General Information

Platform: Code4rena

Start Date: 21/07/2023

Pot Size: $90,500 USDC

Total HM: 8

Participants: 60

Period: 7 days

Judge: 0xean

Total Solo HM: 2

Id: 264

League: ETH

Arcade.xyz

Findings Distribution

Researcher Performance

Rank: 23/60

Findings: 1

Award: $471.90

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: Juntao

Also found by: Jiamin, Juntao, UniversalCrypto, auditsea, circlelooper, crunch, lanrebayode77, vangrim, zaevlad

Labels

bug
2 (Med Risk)
satisfactory
duplicate-58

Awards

471.8972 USDC - $471.90

External Links

Lines of code

https://github.com/code-423n4/2023-07-arcade/blob/main/contracts/ArcadeTreasury.sol#L117 https://github.com/code-423n4/2023-07-arcade/blob/main/contracts/ArcadeTreasury.sol#L198 https://github.com/code-423n4/2023-07-arcade/blob/main/contracts/ArcadeTreasury.sol#L303

Vulnerability details

Impact

GSC is not able to get approve back if it was issued to the wrong user. And it can cause time problems for the GSC itself.

Proof of Concept

Contract admin can set an allowance for GSC one time per 7 days:

uint48 public constant SET_ALLOWANCE_COOL_DOWN = 7 days; function setGSCAllowance(address token, uint256 newAllowance) external onlyRole(ADMIN_ROLE) { ... if (uint48(block.timestamp) < lastAllowanceSet[token] + SET_ALLOWANCE_COOL_DOWN) { revert T_CoolDownPeriod(block.timestamp, lastAllowanceSet[token] + SET_ALLOWANCE_COOL_DOWN); } ... lastAllowanceSet[token] = uint48(block.timestamp); gscAllowance[token] = newAllowance; }

And it cannot be more than thresholds.small. So, for example, it grats an allowance to spend 1000 tokens.

GSC can spend it by itself via gscSpend() or allow other user to transfer tokens via gscApprove(). Both of these functions reduce the allovance for GSC.

If by any chance GSC gives an approve to an invalid or wrong user, there is no way to get the approve back or zero it. Moreover that "bad user" will have approve for the later period.

And GSC will not able to save tokens and transfer the full amount of it because of their allowance was already reduced.

Also they will have to wait for 7 days when admin will be able to reset the allowance for GSC.

Tools Used

Manual review

Provide an additional function to disapprove or zero "bad users" for GSC.

Assessed type

Governance

#0 - c4-pre-sort

2023-07-29T16:38:35Z

141345 marked the issue as duplicate of #263

#1 - c4-pre-sort

2023-08-01T07:57:19Z

141345 marked the issue as not a duplicate

#2 - c4-pre-sort

2023-08-01T07:57:30Z

141345 marked the issue as duplicate of #58

#3 - c4-judge

2023-08-11T01:40:42Z

0xean marked the issue as satisfactory

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