Mimo August 2022 contest - 8olidity's results

Bridging the chasm between the DeFi world and the world of regulated financial institutions.

General Information

Platform: Code4rena

Start Date: 02/08/2022

Pot Size: $50,000 USDC

Total HM: 12

Participants: 69

Period: 5 days

Judge: gzeon

Total Solo HM: 5

Id: 150

League: ETH

Mimo DeFi

Findings Distribution

Researcher Performance

Rank: 17/69

Findings: 2

Award: $683.42

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: peritoflores

Also found by: 8olidity, vlad_bochok

Labels

bug
duplicate
2 (Med Risk)

Awards

615.9148 USDC - $615.91

External Links

Lines of code

https://github.com/code-423n4/2022-08-mimo/blob/main/contracts/libraries/BoringBatchable.sol#L36

Vulnerability details

Impact

Detect the use of delegatecall inside a loop in a payable function.

Proof of Concept

contracts\libraries\BoringBatchable.sol: 36 function batch(bytes[] calldata calls, bool revertOnFail) external payable { 37: for (uint256 i = 0; i < calls.length; i++) { 38 (bool success, bytes memory result) = address(this).delegatecall(calls[i]);

When calling bad the same msg.value amount will be accredited multiple times.

Tools Used

vscode

Carefully check that the function called by delegatecall is not payable/doesn't use msg.value.

#0 - horsefacts

2022-08-08T23:25:04Z

#1 - RayXpub

2022-08-10T13:14:47Z

Duplicate of #153

Lines of code

https://github.com/code-423n4/2022-08-mimo/blob/main/contracts/proxy/MIMOProxy.sol#L133

Vulnerability details

Impact

The lack of a contract existence check when executing transactions in MIMOProxy might lead to incorrectly assuming that external code was executed.

Proof of Concept

contracts\proxy\MIMOProxy.sol: 132 for (uint256 i = 0; i < targets.length; i++) { 133: (bool success, bytes memory response) = targets[i].call(data[i]); 134 if (!success) {

poc

describe("--- MIMOMulticall Integration Tests ---", () => { it("should be able to deposit", async () => { const { mimoProxy, wmatic, vaultsCore, vaultsDataProvider, owner } = await setup(); const result = await mimoProxy.multicall( [wmatic.address, wmatic.address, vaultsCore.address,'0xxxxxx'],// [ wmatic.interface.encodeFunctionData("transferFrom", [owner.address, mimoProxy.address, DEPOSIT_AMOUNT]), wmatic.interface.encodeFunctionData("approve", [vaultsCore.address, DEPOSIT_AMOUNT]), vaultsCore.interface.encodeFunctionData("deposit", [wmatic.address, DEPOSIT_AMOUNT]), wmatic.interface.encodeFunctionData("approve", ['0xxxxx', DEPOSIT_AMOUNT]), ], ); console.log(result);

The function does not check for token code existence. The Solidity documentation warns:

The low-level call, delegatecall and callcode will return success if the called account is non-existent, as part of the design of EVM. Existence must be checked prior to calling if desired.

Tools Used

vscode

#0 - RayXpub

2022-08-10T13:16:03Z

Duplicate of #41

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