Skip to content
Business logic Audit finding Beginner

Due to inappropriately short votingPeriod and votingDelay , it is nearly impossible for the governance to function correctly.

Musaka Follow with josephdara, devival and 10 others

Originally disclosed on Code4rena

Submitted by Musaka, also found by josephdara, devival, devival, 0xhacksmithh, cccz, ktg, CrypticShepherd, squeaky_cactus, 0xnev, bytes032, LuchoLeonel1, and T1MOH

Proof of Concept

When making proposals with the Governor contract OZ uses votingPeriod.

        uint256 snapshot = currentTimepoint + votingDelay();
        uint256 duration = votingPeriod();

        _proposals[proposalId] = ProposalCore({
            proposer: proposer,
            voteStart: SafeCast.toUint48(snapshot),//@audit votingDelay() for when the voting starts
            voteDuration: SafeCast.toUint32(duration),//@audit votingPeriod() for the duration
            executed: false,
            canceled: false
        });

But currently, Lybra has implemented the wrong amounts for bolt votingPeriod and votingDelay, which means proposals from the governance will be nearly impossible to be voted on.

    function votingPeriod() public pure override returns (uint256){
         return 3;//@audit this should be time in blocks
    }

     function votingDelay() public pure override returns (uint256){
         return 1;//@audit this should be time in blocks
    }

HH PoC

https://gist.github.com/0x3b33/dfd5a29d5fa50a00a149080280569d12

Tools Used

Manual Review

Recommended Mitigation Steps

You can implement it as OZ suggests in their examples

    function votingDelay() public pure override returns (uint256) {
        return 7200; // 1 day
    }

    function votingPeriod() public pure override returns (uint256) {
        return 50400; // 1 week
    }

Assessed type

Governance

LybraFinance acknowledged

0xean (judge) decreased severity to Medium


The original report as published on Code4rena, by Musaka. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

What is known

A medium-severity business logic bug in Lybra Finance. Code4rena made it public on 21 August 2023. Found in the 2023-06-lybra audit contest (finding M-16), also found by 12 other wardens.

About Business logic

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

More by Musaka

View all

2 more disclosed reports, best first.

More from Lybra Finance

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.