Closed c4-bot-9 closed 2 months ago
This is expected behaviour. No parameter of a market should be adjustable once a market is closed.
Once a market is closed the protocol fee stops accruing regardless of whatever level it was at prior to the market closure. Borrowers incur no more or less in fees than were already present, and lenders don't see the impact of a protocol fee shift at all since it's not borne by them. There is no risk at all to any users here.
The only people that would get irritated by this happening would be the protocol operators, wondering why their transaction reverted: and even then, it would be incredibly simple to grab a list of markets to push an update to and filter by !state.isClosed
prior to execution.
3docSec marked the issue as unsatisfactory: Invalid
Lines of code
https://github.com/code-423n4/2024-08-wildcat/blob/main/src/HooksFactory.sol#L553 https://github.com/code-423n4/2024-08-wildcat/blob/main/src/market/WildcatMarketConfig.sol#L170
Vulnerability details
Impact
Batch calls to pushProtocolFeeBipsUpdates() will unexpectedly revert, because the setProtocolFeeBips() function will revert whenever a market is closed. This can occur due to the following reasons:
Proof of Concept
Whenever there is a protocol fee bips update in a template, this can be pushed to the corresponding markets. The function takes a range of markets to apply the update to and calls
market.setProtocolFeeBips(protocolFeeBips)
as described in the comments:https://github.com/code-423n4/2024-08-wildcat/blob/main/src/HooksFactory.sol#L553
The called setProtocolFeeBips() function will revert if the market is closed:
https://github.com/code-423n4/2024-08-wildcat/blob/main/src/market/WildcatMarketConfig.sol#L170
As a result transactions will unexpectedly revert. Consider the following scenario:
Recommended Mitigation Steps
Do not revert the tranasction but just return without changes and continue the iteration for the next market without.
Assessed type
Error