Vader Protocol contest - gpersoon's results

Capital efficient liquidity protocol

General Information

Platform: Code4rena

Start Date: 22/04/2021

Pot Size: $120,000 USDC

Total HM: 41

Participants: 10

Period: 7 days

Judge: LSDan

Total Solo HM: 28

Id: 5

League: ETH

Vader Protocol

Findings Distribution

Researcher Performance

Rank: 10/10

Findings: 6

Award: $1,759.15

🌟 Selected for report: 7

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: 0xRajeev

Also found by: gpersoon, pauliax

Labels

bug
duplicate
2 (Med Risk)
sponsor confirmed
filed
addressed

Awards

2.6398 VETH - $137.27

0.0634 ETH - $158.39

External Links

Handle

gpersoon

Vulnerability details

Impact

The function deploySynth of Pools.sol has the following require: require(token != VADER || token != USDV); This require never stops execution because the following statement is always true: (token != VADER || token != USDV)

  • suppose token==VADER => (VADER != VADER || VADER != USDV) ==> false || true ==> true
  • suppose token==USDV => (USDV != VADER || USDV != USDV) ==> true || false ==> true So this means a synth token for both VADER and USDV can be create which is probably unwanted

Proof of Concept

Pools.sol: function deploySynth(address token) external { require(token != VADER || token != USDV); iFACTORY(FACTORY).deploySynth(token); }

Tools Used

Editor

The statement should be: require(token != VADER && token != USDV);

#1 - dmvt

2021-05-26T22:49:04Z

duplicate of #124

Findings Information

🌟 Selected for report: gpersoon

Also found by: 0xRajeev, cmichel, jvaqa

Labels

bug
2 (Med Risk)
sponsor confirmed

Awards

1.7819 VETH - $92.66

0.0428 ETH - $106.91

External Links

Handle

gpersoon

Vulnerability details

Impact

Most of the solidity contracts have an init function that everyone can call. This could lead to a race condition when the contract is deployed. At that moment a hacker could call the init function and make the deployed contracts useless. Then it would have to be redeployed, costing a lot of gas.

Proof of Concept

DAO.sol: function init(address _vader, address _usdv, address _vault) public { Factory.sol: function init(address _pool) public { Pools.sol: function init(address _vader, address _usdv, address _router, address _factory) public { Router.sol: function init(address _vader, address _usdv, address _pool) public { USDV.sol: function init(address _vader, address _vault, address _router) external { Utils.sol: function init(address _vader, address _usdv, address _router, address _pools, address _factory) public { Vader.sol: function init(address _vether, address _USDV, address _utils) external { Vault.sol: function init(address _vader, address _usdv, address _router, address _factory, address _pool) public {

Tools Used

Editor

Add a check to the init function, for example that only the deployer can call the function.

#0 - strictly-scarce

2021-04-26T15:05:59Z

Yes, but only once. Could add a deployer check tho

#1 - dmvt

2021-05-25T10:42:47Z

After considerable evaluation and seeing the wide range of threat factors that were put forward by wardens related to this issue, I've decided that the potential threat here does extend beyond gas.

A worst case scenario could cause significant damage.

It is extremely unlikely that an attacker could successfully time this type of attack.

An attacker would have to successfully intercept more than one init due to the highly coupled nature of the contract. If they did so incorrectly, the entire system would not function. Presuming they succeeded, the team would also have to overlook the failure of or forget to make multiple critical transaction calls in their deployment scripts. To realize significant financial gains, the attacker would have to leave their exploit code in place for an extended period of time.

The likelihood is extremely low, but the impact would be critical. For this reason, I'm normalizing all of these reports to a Medium 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