code-423n4 / 2021-04-maple-findings

0 stars 0 forks source link

Incorrect require error message string in LoanFactory.sol #62

Open code423n4 opened 3 years ago

code423n4 commented 3 years ago

Handle

0xRajeev

Vulnerability details

Impact

The error message string for the require statement on L153 of LoanFactory.sol incorrectly uses PoolFactory as the source contract for this message instead of LoanFactory, which could be confusing when this error is hit.

require(msg.sender == globals.governor(), "PoolFactory:INVALID_GOVERNOR");

Proof of Concept

https://github.com/maple-labs/maple-core/blob/355141befa89c7623150a83b7d56a5f5820819e9/contracts/LoanFactory.sol#L153

Tools Used

Manual Analysis

Recommended Mitigation Steps

Change error message to: require(msg.sender == globals.governor(), “LoanFactory:INVALID_GOVERNOR");

lucas-manuel commented 3 years ago

Informational, will address