Griefing (e.g. no profit motive for an attacker, but damage to the users or the protocol)
Description
Brief/Intro
When a user calls supplyWithPermit function, attacker can make the call revert by front-running. This happens because of a missing try-catch statement in the supplyWithPermit function.
Vulnerability Details
When supplyWithPermit is called, by passing a permit signature, the contract calls the permit function of the asset to get approval to spend on behalf of caller. It then calls the SupplyLogic.executeSupply function to supply the asset.
So an attacker sees the supplyWithPermit call in the mempool, and extracts the permit signature from the call's argument. Attacker then use this permit signature, to directly call the asset's permit function. This will give the approval to the contract address, but along with it will increase the user's nonce, thus making the signature invalid for any further use.
Due to this when the original supplyWithPermit gets mined, it will revert, as the signature has become invalid. Hence the user's transaction will revert.
Impact Details
Attacker can grief users by frontrunning the supplyWithPermit functions, making that functionality unusable by users. Apart from supplyWithPermit the repayWithPermit function is also vulnerable to this issue.
Remediation Details
Implement a try-catch statement. Inside the supplyWithPermit function, call the assets permit statement using a try statement, and catch any revert. That will resolve the issue.