Sparkn

CodeFox Inc.
DeFiFoundryProxy
15,000 USDC
View results
Submission Details
Severity: high

Contract Is Vulnerable to Permit() Function in DAI

Summary

If DAI is deposited into the contract, the buyer can use the permit() function on the DAI contract to withdraw the DAI without the approval of the proxy factory

Vulnerability Details

Tokens like Dai have a permit() implementation that does not follow EIP2612.

Impact

The permit() issue could allow Owner to steal funds from the contract.Additionally, the issue could damage the reputation of the SPARKN protocol.
Here is a case scenario that illustrates the vulnerability :

1 The Owner of the contract deposits DAI into the contract.

2 A Client sees that the DAI is in the contract and agrees to do a job for the Owner.

3 The Client completes the job.

4 The Owner calls the permit() function inside the DAI contract to recover the DAI.

5 The Client is left with nothing, and the Protocol loses the fee that was paid by the Client.

Tools Used

Manual Review

Recommendations

The SPARKN protocol should not accept DAI deposits. If the contract must accept DAI deposits, then the contract should be updated to have a permit() function.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.