Vader Protocol contest - jvaqa'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: 4/10

Findings: 10

Award: $6,202.78

🌟 Selected for report: 7

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: cmichel

Also found by: jvaqa

Labels

bug
duplicate
disagree with severity
3 (High Risk)
sponsor acknowledged

Awards

14.6655 VETH - $762.61

0.352 ETH - $879.93

External Links

Handle

jvaqa

Vulnerability details

Impact

transferTo() When Used By A Smart Contract Wallet Tranfers The Relayer's Funds Rather Than The Wallet's Funds.

The transferTo pattern used in Vader.sol, USDV.sol, Synth.sol, Token1.sol, and Token2.sol utilizes tx.origin to determine the sender of tokens. However, smart contract wallets often have a completely unnrelated "relayer" as the actual initiator of the transaction. As written, transferTo would steal the relayer's funds, rather than the smart wallet's funds.

Proof of Concept

Any time a smart contract relayer owns any Vader, USDV, VaderSynths, or other Vader tokens, Alice can call the following line of code from her smart contract wallet that uses that relayer:

transferTo(aliceEOAAddress, balanceOf(relayer));

And Alice will receive the tokens owned by the relayer at her EOA address.

Remove transferTo() from Vader.sol, USDV.sol, Synth.sol, Token1.sol, and Token2.sol.

#0 - strictly-scarce

2021-05-01T10:32:13Z

The protocol is not designed to be used by relayers.

#1 - dmvt

2021-05-26T18:40:44Z

duplicate of #217

Findings Information

🌟 Selected for report: jvaqa

Also found by: JMukesh

Labels

bug
disagree with severity
3 (High Risk)

Awards

14.6655 VETH - $762.61

0.352 ETH - $879.93

External Links

Handle

jvaqa

Vulnerability details

Impact

Anyone Can Avoid All Vether Transfer Fees By Adding Their Address to the Vether ExcludedAddresses List.

Vether.sol implements a fee on every token transfer, unless either the sender or the recipient exists on a list of excluded addresses (mapAddress_Excluded). However, the addExcluded() function in Vether.sol has no restrictions on who can call it. So any user can call addExcluded with their own address as the argument, and bypass all transfer fees.

Proof of Concept

Alice calls:

(1) Vether.addExcluded(aliceAddress), which adds Alice's address to mapAddress_Excluded. (2) Alice can now freely transfer Vether with no fees.

Add restrictions to who can call addExcluded, perhaps by restricting it to a caller set by DAO.sol

#0 - strictly-scarce

2021-05-01T10:31:12Z

Vether contract is outside of contest

#1 - dmvt

2021-05-26T22:27:05Z

https://github.com/code-423n4/2021-04-vader-findings/issues/3#issuecomment-849043144

The warden should be paid out on this issue, in my opinion, because the code was included in the repo to be reviewed. The work to review the contract was done despite the fact that the team has addressed the issue and has already deployed vether.sol. I do not think that any issues related to Vether.sol should be included in the final report generated by @code423n4.

It was unclear to me (and obviously most of the wardens) that Vether.sol was considered out of scope.

Findings Information

🌟 Selected for report: 0xRajeev

Also found by: jvaqa

Labels

bug
duplicate
3 (High Risk)

Awards

14.6655 VETH - $762.61

0.352 ETH - $879.93

External Links

Handle

jvaqa

Vulnerability details

Impact

Vader.sol secondsPerEra Is Currently Initialized To One Second Instead Of One Day

Vader comments and documentation describe an "era" as taking one calendar day, which is 86400 seconds. However, in Vader.sol, secondsPerEra is currently initialized to one second. This will cause the first call of every single block to Vader._transfer() to make the gas-intensive subcall to _checkEmission(). This will also increment the currentEra counter incredibly quickly.

Proof of Concept

Vader.sol's constructor includes this line of code: secondsPerEra = 1; //86400;

Change this: secondsPerEra = 1; //86400;

To this: secondsPerEra = 86400;

#0 - dmvt

2021-05-25T12:57:34Z

duplicate of #155

Findings Information

🌟 Selected for report: gpersoon

Also found by: 0xRajeev, cmichel, jvaqa

Labels

bug
duplicate
2 (Med Risk)

Awards

1.7819 VETH - $92.66

0.0428 ETH - $106.91

External Links

Handle

jvaqa

Vulnerability details

Impact

Anyone Can Call Init() and Lock It Forever For Attack.sol, DAO.sol, Factory.sol, Pools.sol, Router.sol, Vault.sol, and Vader.sol

When trying to deploy vader contracts, an attacker could call init() on each deployed contract and lock it, wasting the deployer's gas and time. If the attacker calls init() on a contract that has already been referenced by a previous contract, the attacker causes that contract to be rendered useless as well. Since init() can only be called once, and then is locked forever, a successful attack leaves the entire contract useless, and wastes Vader's funds.

Proof of Concept

Alice sees that the Vader team is in the process of deploying their contracts. Alice calls init() on each contract as it is deployed, supplying junk data to the arguments. This wastes Vader's time and money.

Either move init() functionality to the constructor of each contract, or add a restriction to who can call init().

#0 - dmvt

2021-05-26T22:50:41Z

duplicate of #18

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