The SmartCommitmentForwarder smart contract isn't compatible with FlashRolloverLoan_G5.sol
Summary
As per the code, invoking SmartCommitmentForwarder.acceptCommitmentWithRecipient() from FlashRolloverLoan_G5 will result in the DOS.
Vulnerability Detail
The issue lies in the fact that SmartCommitmentForwarder operates with msg.sender, which in our case is FlashRolloverLoan_G5, and not the borrower directly:
So, when FlashRolloverLoan_G5 calls the acceptCommitmentWithRecipient function, it triggers the internal _submitBidWithCollateral function in SmartCommitmentForwarder.sol and pass _msgSender(FlashRolloverLoan_G5) as the borrower:
Consider overriding the _msgSender() function in SmartCommitmentForwarder.sol and implementing it in the same way as in LenderCommitmentForwarder_G3 using ExtensionsContextUpgradeable.sol:
merlin
medium
The SmartCommitmentForwarder smart contract isn't compatible with FlashRolloverLoan_G5.sol
Summary
As per the code, invoking
SmartCommitmentForwarder.acceptCommitmentWithRecipient()
fromFlashRolloverLoan_G5
will result in the DOS.Vulnerability Detail
The issue lies in the fact that
SmartCommitmentForwarder
operates with msg.sender, which in our case isFlashRolloverLoan_G5
, and not the borrower directly:So, when
FlashRolloverLoan_G5
calls theacceptCommitmentWithRecipient
function, it triggers the internal_submitBidWithCollateral
function inSmartCommitmentForwarder.sol
and pass_msgSender(FlashRolloverLoan_G5)
as the borrower:This causes a revert in
TellerV2Context
because_msgSender == FlashRolloverLoan_G5
, leading to the error messageSender must approve market forwarder
:Impact
The borrower can't interact with the
acceptCommitmentWithRecipient
function inSmartCommitmentForwarder.sol
throughFlashRolloverLoan_G5.sol
.Code Snippet
contracts/contracts/LenderCommitmentForwarder/extensions/FlashRolloverLoan_G5.sol#L287-L305 contracts/contracts/LenderCommitmentForwarder/SmartCommitmentForwarder.sol#L106
Tool used
Manual Review
Recommendation
Consider overriding the
_msgSender()
function inSmartCommitmentForwarder.sol
and implementing it in the same way as inLenderCommitmentForwarder_G3
usingExtensionsContextUpgradeable.sol
:Duplicate of #138