Vader Protocol contest - jayjonah8's results

Liquidity Protocol anchored by Native Stablecoin with Slip-Based Fees AMM, IL protection and Synthetics.

General Information

Platform: Code4rena

Start Date: 09/11/2021

Pot Size: $75,000 USDC

Total HM: 57

Participants: 27

Period: 7 days

Judge: alcueca

Total Solo HM: 49

Id: 52

League: ETH

Vader Protocol

Findings Distribution

Researcher Performance

Rank: 14/27

Findings: 2

Award: $764.62

🌟 Selected for report: 4

πŸš€ Solo Findings: 0

Findings Information

🌟 Selected for report: jayjonah8

Also found by: rfa, shri4net, xYrYuYx

Labels

bug
3 (High Risk)
sponsor acknowledged
Vader
XVader

Awards

295.0764 USDC - $295.08

External Links

Handle

jayjonah8

Vulnerability details

Impact

The whitepaper says that the Vader token contains a Fee-On-Transfer so in XVader.sol, an attacker may be able to keep calling enter() and leave() while being credited more tokens than the contract actually receives eventually draining it.

Proof of Concept

  1. Attacker deposits 500 Vader
  2. Attacker receives credit for 500 while the xVader contract gets the 500 - fee.
  3. Attacker calls leave() leaving the contract with a difference of the fee.

https://www.financegates.net/2021/07/28/another-polygon-yield-farm-crashes-to-zero-after-exploit/

https://github.com/code-423n4/2021-11-vader/blob/main/contracts/x-vader/XVader.sol

https://www.vaderprotocol.io/whitepaper

Tools Used

Manually code review

There should be pre and post checks on balances to get the real amount

#0 - 0xstormtrooper

2021-11-16T00:41:48Z

Vader fee on transfer will be removed

Findings Information

🌟 Selected for report: jayjonah8

Also found by: hack3r-0m

Labels

bug
1 (Low Risk)
disagree with severity
resolved
sponsor confirmed
ProtocolConstants

Awards

72.8584 USDC - $72.86

External Links

Handle

jayjonah8

Vulnerability details

Impact

In the Vader white paper it says that Vader is minted if VETH is burnt 10,000:1, but in the ProtocolConstants.sol it shows 1000:1. Not sure if this is a typo in the whitepaper or if it's a bug.

// Vader -> Vether Conversion Rate (1000:1) uint256 internal constant _VADER_VETHER_CONVERSION_RATE = 1000;

Proof of Concept

https://github.com/vetherasset/vaderprotocol-whitepaper/blob/main/Vader%20Protocol%20Whitepaper%20V2.pdf

https://github.com/code-423n4/2021-11-vader/blob/main/contracts/shared/ProtocolConstants.sol

Tools Used

Manual code review

If the whitepaper is correct, the _VADER_VETHER_CONVERSION_RATE should be changed to 10000

#0 - SamSteinGG

2021-11-25T11:18:09Z

This is a simple constant that is meant to change prior to launch and does not constitute a high risk vulnerability

#1 - alcueca

2021-12-11T07:15:28Z

Function incorrect as to spec.

Findings Information

🌟 Selected for report: jayjonah8

Labels

bug
1 (Low Risk)
resolved
sponsor confirmed
XVader

Awards

161.9075 USDC - $161.91

External Links

Handle

jayjonah8

Vulnerability details

Impact

XVader.sol enter() and leave() functions should have a ReentrancyGuard modifier. It serves as an extra layer of security that can prevent possible future exploits

Proof of Concept

https://github.com/code-423n4/2021-11-vader/blob/main/contracts/x-vader/XVader.sol

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

Tools Used

Manual code review

Use Open Zeppelins ReentrancyGuard.sol import and add the modifier to enter() and leave() functions

Findings Information

🌟 Selected for report: jayjonah8

Labels

bug
1 (Low Risk)
sponsor acknowledged
StakingRewards

Awards

161.9075 USDC - $161.91

External Links

Handle

jayjonah8

Vulnerability details

Impact

In StakingRewards.sol the _totalSupply variable is manually updated and can be inaccurate if someone sends tokens directly to the contract. The _totalSupply variable is used in withdraw(), stake(), totalSupply(), and rewardPerToken(). This may introduce bugs in future versions as the _totalSupply variable can be different from the actual token balance.

Proof of Concept

https://github.com/code-423n4/2021-11-vader/blob/main/contracts/staking-rewards/StakingRewards.sol#L35

Tools Used

Manual code review

The totalSupply() function on line 53 should return stakingToken.balanceOf(address(this)) and this function should be used everywhere the _totalSupply variable is used.

#0 - 0xstormtrooper

2021-11-15T09:06:19Z

internal _totalSupply is used to protect against shared dilution by a malicious user directly sending token

Findings Information

🌟 Selected for report: Ruhum

Also found by: jayjonah8

Labels

bug
duplicate
1 (Low Risk)
VaderPoolV2

Awards

72.8584 USDC - $72.86

External Links

Handle

jayjonah8

Vulnerability details

Impact

By using _mint() an NFT can get stuck in a recipients contract if it's not designed to handle them. For this reason ERC721.sol has this warning regarding using _mint() "WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible". This works as an additional guardrail to protect the user from accidentally making a mistake.

Proof of Concept

https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/ERC721.sol#L271

Tools Used

Manual code review

Its is recommended to use _safeMint whenever possible.

#0 - SamSteinGG

2021-11-25T11:39:54Z

Duplicate of #27

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