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
0xean (judge) decreased severity to Medium
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.