The Wildcat Protocol - Phantom's results

Banking, but worse - a protocol for fixed-rate, undercollateralised credit facilities.

General Information

Platform: Code4rena

Start Date: 16/10/2023

Pot Size: $60,500 USDC

Total HM: 16

Participants: 131

Period: 10 days

Judge: 0xTheC0der

Total Solo HM: 3

Id: 296

League: ETH

Wildcat Protocol

Findings Distribution

Researcher Performance

Rank: 87/131

Findings: 1

Award: $10.17

QA:
grade-b

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

10.1663 USDC - $10.17

Labels

bug
downgraded by judge
grade-b
low quality report
QA (Quality Assurance)
Q-04

External Links

Lines of code

https://github.com/code-423n4/2023-10-wildcat/blob/main/src/market/WildcatMarketToken.sol#L31-L34 https://github.com/code-423n4/2023-10-wildcat/blob/main/src/market/WildcatMarketToken.sol#L59-L62

Vulnerability details

Impact

Detailed description of the impact of this finding.

Proof of Concept

Provide direct links to all referenced code in GitHub. Add screenshots, logs, or any other relevant proof that illustrates the concept.

https://github.com/code-423n4/2023-10-wildcat/blob/main/src/market/WildcatMarketToken.sol#L31C2-L34C4

function approve(address spender, uint256 amount) external virtual nonReentrant returns (bool) { _approve(msg.sender, spender, amount); return true; }

https://github.com/code-423n4/2023-10-wildcat/blob/main/src/market/WildcatMarketToken.sol#L59-L62

function _approve(address approver, address spender, uint256 amount) internal virtual { allowance[approver][spender] = amount; emit Approval(approver, spender, amount); }

In this function, users can approve an invalid address, such as the zero address.

This operation is considered invalid since both the approver and the spender must be non-zero addresses for proper execution.

Tools Used

To avoid the operation where users can approve to invalid addresses such as the zero address, you can add a require statement to check that both the approver and the spender are non-zero addresses. Here's an example of how you can do this in Solidity:

function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); ... }

Assessed type

Invalid Validation

#0 - c4-pre-sort

2023-10-27T10:05:54Z

minhquanym marked the issue as low quality report

#1 - minhquanym

2023-10-27T10:05:56Z

QA

#2 - c4-judge

2023-11-08T16:53:25Z

MarioPoneder changed the severity to QA (Quality Assurance)

#3 - c4-judge

2023-11-09T14:01:14Z

MarioPoneder marked the issue as grade-b

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter