Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inability to Override Erroneous Chainalysis Sanction Flag for Borrowers in WildcatMarket.borrow Function #124

Closed
howlbot-integration bot opened this issue Oct 15, 2024 · 3 comments
Labels
bug Something isn't working downgraded by judge Judge downgraded the risk level of this issue grade-b primary issue Highest quality submission among a set of duplicates QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax 🤖_04_group AI based duplicate group recommendation sufficient quality report This report is of sufficient quality

Comments

@howlbot-integration
Copy link

Lines of code

https://github.com/code-423n4/2024-08-wildcat/blob/main/src/market/WildcatMarket.sol#L146-L152

Vulnerability details

Vulnerability Description:

In the WildcatMarket.borrow function, the _isFlaggedByChainalysis(borrower) function is called to check if the borrower has been flagged as a sanctioned entity by Chainalysis. If the borrower is flagged, the transaction is reverted with a BorrowWhileSanctioned error.

However, unlike the case of borrower able to remove the sanctions on lenders who are flagged erroneously as sanctioned entities by chainalysis, the borrower has no ability to override or resolve this flag if it has been set on him erroneously. This creates a potential issue where a borrower erroneously flagged as sanctioned has no way to interact with the market and rectify the situation, effectively locking them out of the protocol.

Impact:

An incorrect Chainalysis flagging can lead to a borrower being permanently barred from borrowing, with no mechanism in place to address or resolve erroneous sanctions. This could result in significant disruptions, particularly if the flagging was done in error, potentially preventing the borrower from accessing or utilizing their own funds.

Proof of Concept (PoC):

In the WildcatMarket.borrow function:

if (_isFlaggedByChainalysis(borrower)) {
    revert_BorrowWhileSanctioned();
}

If the borrower is incorrectly flagged as sanctioned, the transaction is reverted without any mechanism for correction or override.

https://github.com/code-423n4/2024-08-wildcat/blob/main/src/market/WildcatMarket.sol#L146-L152

Recommended Fix:

To address this issue, a mechanism should be implemented that allows an admin or owner of the contract to challenge or override an erroneous sanction flag set on a borrower. This could involve introducing a process where the borrower can request verification to resolve the errorneous sanction flag via an admin account. This would give borrowers a path to resolve erroneous sanction flags and regain access to their borrowing privileges.

Assessed type

Other

@howlbot-integration howlbot-integration bot added 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value 🤖_04_group AI based duplicate group recommendation bug Something isn't working primary issue Highest quality submission among a set of duplicates sufficient quality report This report is of sufficient quality labels Oct 15, 2024
howlbot-integration bot added a commit that referenced this issue Oct 15, 2024
@c4-judge
Copy link
Contributor

3docSec changed the severity to QA (Quality Assurance)

@c4-judge c4-judge added downgraded by judge Judge downgraded the risk level of this issue QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax and removed 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value labels Oct 17, 2024
@3docSec
Copy link

3docSec commented Oct 17, 2024

@c4-judge
Copy link
Contributor

3docSec marked the issue as grade-b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working downgraded by judge Judge downgraded the risk level of this issue grade-b primary issue Highest quality submission among a set of duplicates QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax 🤖_04_group AI based duplicate group recommendation sufficient quality report This report is of sufficient quality
Projects
None yet
Development

No branches or pull requests

3 participants