The audit identified a potential vulnerability in the staking mechanism and auction contracts. Specifically, the absence of a minimum staking amount could be exploited by a malicious user, leading to a Denial of Service (DoS) attack. This issue is also present in the bidding process of the SpiceAuction
and DaiGoldAuction
contracts.
Staking without Minimum Amount:
The stake
and stakeFor
functions allow users to stake any amount, including very small amounts (dust amounts).
Code Snippet:
Minimum Amount for Bidding in Auctions:
Similar to staking, there is no minimum amount requirement for bidding in SpiceAuction
and DaiGoldAuction
.
DoS Attack via Dust Amounts:
A malicious user could repeatedly stake dust amounts (2^256 - 1 times) to a specific address, effectively DoS-ing the staking process for that address during the current epoch.
The lack of a minimum staking amount exposes the contract to a Denial of Service (DoS) attack. A malicious user could exploit this by front-running other users and staking dust amounts repeatedly, preventing legitimate staking actions for a particular address. This issue can disrupt the staking process and negatively affect user experience and trust in the system.
Manual Review
Implement a Minimum Staking Amount:
Modify the stake
and stakeFor
functions to include a check for a minimum staking amount.
Set Minimum Bid Amounts for Auctions:
Introduce a minimum bid amount for SpiceAuction
and DaiGoldAuction
contracts to prevent similar exploits in the bidding process.
Mitigate DoS Risks:
Consider implementing additional checks and balances to prevent users from repeatedly staking dust amounts to the same address within a short period.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.