Popcorn contest - DevTimSch's results

A multi-chain regenerative yield-optimizing protocol.

General Information

Platform: Code4rena

Start Date: 31/01/2023

Pot Size: $90,500 USDC

Total HM: 47

Participants: 169

Period: 7 days

Judge: LSDan

Total Solo HM: 9

Id: 211

League: ETH

Popcorn

Findings Distribution

Researcher Performance

Rank: 140/169

Findings: 1

Award: $35.48

QA:
grade-b

🌟 Selected for report: 0

🚀 Solo Findings: 0

[L-01] Anyone can let AdminProxy call arbitrary contracts

Targets

Impact

There are no security checks in VaultController.changeVaultFees(address[] calldata vaults) and VaultController.changeVaultAdapters(address[] calldata vaults). This means that anyone can call these functions with arbitrary addresses. This will let the AdminProxy execute a call on those addresses with IVault.proposeFees.selector or IVault.changeAdapter.selector. Low severity because I can't think of a critical attack vector through this, but should the adminProxy ever get more functions, this might cause trouble.

Proof of Concept

Let's use the following contract as an example:

pragma solidity ^0.8.15;

import {console} from "forge-std/console.sol";

contract AnyContract {

    function changeAdapter() external {
        console.log("Should never reach here");
    }
}

Now we can add a test case to VaultController.t.sol:

    import {AnyContract} from "../AnyContract.sol";

    function test__callAnyContract() public {
        address[] memory targets = new address[](1);
        targets[0] = address(new AnyContract());
        controller.changeVaultAdapters(targets);
    }

Which should display the console message "Should never reach here".

Tools Used

VS Code, Manual review, Foundry

Consider putting restrictions on who can call changeAdapter and changeFees in VaultController.

#0 - c4-judge

2023-02-28T13:17:16Z

dmvt marked the issue as grade-b

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