Yeti Finance contest - jayjonah8's results

Portfolio borrowing. 11x leverage. 0% interest.

General Information

Platform: Code4rena

Start Date: 16/12/2021

Pot Size: $100,000 USDC

Total HM: 21

Participants: 25

Period: 7 days

Judge: alcueca

Total Solo HM: 12

Id: 66

League: ETH

Yeti Finance

Findings Distribution

Researcher Performance

Rank: 2/25

Findings: 7

Award: $13,963.80

🌟 Selected for report: 5

πŸš€ Solo Findings: 2

Findings Information

🌟 Selected for report: jayjonah8

Also found by: dalgarim, kenzo

Labels

bug
3 (High Risk)
sponsor confirmed

Awards

1434.4958 USDC - $1,434.50

External Links

Handle

jayjonah8

Vulnerability details

Impact

In StabilityPool.sol, the receiveCollateral() function should be called by ActivePool per comments, but anyone can call it passing in _tokens and _amounts args to update stability pool balances.

Proof of Concept

https://github.com/code-423n4/2021-12-yetifinance/blob/main/packages/contracts/contracts/StabilityPool.sol#L1143

Tools Used

Manual code review

Allow only the ActivePool to call the receiveCollateral() function: require(msg.sender = address(active pool address), "Can only be called by ActivePool")

#0 - kingyetifinance

2022-01-05T03:34:08Z

@LilYeti: This was also caught by our official auditor, but good catch.

Findings Information

🌟 Selected for report: heiho1

Also found by: jayjonah8

Labels

bug
duplicate
2 (Med Risk)
sponsor confirmed

Awards

717.2479 USDC - $717.25

External Links

Handle

jayjonah8

Vulnerability details

Impact

The README.md makes the point that reentrancy attacks are a cause for concern, but the protocol makes no use of reentrancy guards in any file or in the functions users interact with.

Proof of Concept

The are no Reentrancy guards in the entire code base.

Tools Used

Manual code review

Make use of the Open Zeppelin ReentrancyGuard.sol

https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/security/ReentrancyGuard.sol

#0 - 0xtruco

2022-01-12T01:12:46Z

#1 - alcueca

2022-01-15T06:46:23Z

Duplicate of #183

Findings Information

🌟 Selected for report: jayjonah8

Labels

bug
3 (High Risk)
sponsor confirmed

Awards

5312.9473 USDC - $5,312.95

External Links

Handle

jayjonah8

Vulnerability details

Impact

In WJLP.sol, the wrap() function pulls in _amount base tokens from _from, then stakes them to mint WAssets which it sends to _to. It then updates _rewardOwner's reward tracking such that it now has the right to future yields from the newly minted WAssets. But the function does not make sure that _from and _to are not the same address and failure to make this check in functions with transfer functionality has lead to severe bugs in other protocols since users rewards are updated on such transfers this can be used to manipulate the system.

Proof of Concept

https://github.com/code-423n4/2021-12-yetifinance/blob/main/packages/contracts/contracts/AssetWrappers/WJLP/WJLP.sol#L126

https://medium.com/@Knownsec_Blockchain_Lab/knownsec-blockchain-lab-i-kill-myself-monox-finance-security-incident-analysis-2dcb4d5ac8f

Tools Used

Manual code review

require(address(_from) != address(_to), "_from and _to cannot be the same")

#0 - kingyetifinance

2022-01-07T06:46:10Z

@LilYeti : Originally disputed since we had different wJLP on our main where this is already removed. part of this functionality is intended but the ability to frontrun the approve / wrap call is where the liability is.

Findings Information

🌟 Selected for report: csanuragjain

Also found by: hyh, jayjonah8

Labels

bug
duplicate
2 (Med Risk)
disagree with severity
sponsor confirmed

Awards

430.3487 USDC - $430.35

External Links

Handle

jayjonah8

Vulnerability details

Impact

In WJLP.sol a user can call the claimReward() function to claim the JOE rewards they are owed. This eventually calls the _safeJoeTransfer() function which will check if the _amount to send is greater than the joeBal of the contract. If the _amount is greater than the contract balance, the joeBal of the contract is sent to the user instead. This would mean that they are receiving less JOE than they should since their unclaimedJOEReward is not updated again to refund them the difference of the _amount and joeBal

Proof of Concept

https://github.com/code-423n4/2021-12-yetifinance/blob/main/packages/contracts/contracts/AssetWrappers/WJLP/WJLP.sol#L268

Tools Used

Manual code review

In the _safeJoeTransfer() function, If the joeBal of the contract is less than the amount owed to the user, then the users unclaimedJOEReward should be updated to reflect this refunding them the difference between the joeBal and _amount

#0 - kingyetifinance

2022-01-03T06:33:41Z

Bug which would produce some dust lost, probably severity 1.

#1 - kingyetifinance

2022-01-05T06:13:39Z

#109 has better description

#2 - kingyetifinance

2022-01-07T07:30:14Z

@LilYeti : MasterChef is a decently well trusted contract and all JLP rewards are distributed there. Fundamentally the number should not be off by any, if any will be dust, and this exists to protect in the worst case so at least some users can get JOE out. However it is a backstop and extra safety measure. In #137 the reward being off by 10 would require an additional bug somewhere else, or a failure of MasterChef.

#3 - alcueca

2022-01-15T06:38:13Z

Duplicate of #137

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