56863 sc critical first depositor advantage
Submitted on Oct 21st 2025 at 10:37:35 UTC by @pawps for Audit Comp | Belong
Report ID: #56863
Report Type: Smart Contract
Report severity: Critical
Target: https://github.com/belongnet/checkin-contracts/blob/main/contracts/v2/periphery/Staking.sol
Impacts:
Direct theft of any user funds, whether at-rest or in-motion, other than unclaimed yield
Description
Vulnerability Details
The Staking contract inherits from the ERC4626 standard. This contract is susceptible to a well-known exploit referred to as the "first depositor inflation attack." This vulnerability occurs due to the lack of protective mechanisms in the contract's design, allowing the initial depositor to manipulate the share price to their advantage.
This can enable the first depositor to disproportionately claim assets from the vault, effectively draining value at the expense of subsequent depositors.
An attacker/first depositor could simply:
Stake 1 receipt token into the contract, resulting in a 1:1 share price.
Donate 10,000 receipt tokens directly to the contract, causing the share price to become 10,001 units per share. OR admin calls
distributeRewardswith reward amount of receipt token (asset)Subsequent deposits will receive no shares, and their deposit will be absorbed by the single share in the system that belongs to the first depositor.
In the Staking contract, no specific safeguards exist to prevent this attack. There is no minimum initial deposit requirement, nor is there any use of virtual shares to stabilize the share price, and there are no other mechanisms to ensure fairness.
Mitigation suggestions provided by reporter: send an initial “seed” deposit to address(0) so that subsequent deposits must buy shares at a fair price; or revert any deposit that would grant 0 shares to protect user funds.
Impact Details
This bug will brick the contract and cause loss total of funds
Proof of Concept
Proof-of-Concept test (Solidity / Hardhat-style):
Was this helpful?