Closed howlbot-integration[bot] closed 1 month ago
https://github.com/code-423n4/2024-08-wildcat-findings/issues/70
This warden is just playing word-games and filing highs without caring if protocol functionality is actually impinged upon.
We have to allow this: the alternative is that funds are in the void with a sanctioned borrower in perpetuity, constantly gaining interest. It's a legal issue in the sense that funds returned are going to have re-originated from a tainted party, but we aren't interested in taking the position as a protocol that your money is gone with zero recourse: as the warden has pointed out elsewhere, a sanctioned party could just repay from a different address anyway.
Afuera.
3docSec marked the issue as duplicate of #70
3docSec changed the severity to QA (Quality Assurance)
3docSec marked the issue as grade-b
Lines of code
https://github.com/code-423n4/2024-08-wildcat/blob/fe746cc0fbedc4447a981a50e6ba4c95f98b9fe1/src/market/WildcatMarket.sol#L226
Vulnerability details
Description
The WildcatMarket contract allows sanctioned entities to close markets, violating the sponsor's invariant that sanctioned accounts should not modify the market state. The closeMarket() function lacks a sanction check, contrary to other state-modifying functions like borrow().
Let's take a look at the
closeMarket()
implementations fromWildcatMarket.sol
:Impact
This lack of restriction allows sanctioned entities to interact with the market and modify its state by closing it, effectively circumventing financial regulations. This violates a key invariant stated in the guidelines:
Proof of Concept
Unlike the
deposit()
andborrow()
functions, which include the necessary check, a sanctioned entity can bypass the sanction check by directly calling the closeMarket() function.‹‹Test output logs›› :
Create a new NewTest.t.sol file under ./test to run the POC code below with
forge test --match-path test/NewTest.t.sol -vvvv
Tools used
Foundry
Recommendation:
Implement a sanction check in the
closeMarket()
function, similar to the check in theborrow()
function:Assessed type
Access Control