Normal behavior:
Per the ERC-4626 standard, shares minted during a deposit must be credited to the receiver argument — the address that the depositor specifies.
This allows third-party integrations and front-ends to perform deposits on behalf of other users safely.
Specific issue:
In Vault.sol, the contract calls _mint(msg.sender, participantShares) instead of _mint(receiver, participantShares) inside deposit():
This violates ERC-4626 and misdirects shares when a protocol, wrapper, or relayer deposits tokens for another user.
It also prevents delegated deposits and can misattribute ownership in automated strategies.
Likelihood:
Reason 1: Occurs whenever a DeFi protocol or relayer deposits on behalf of another address, which is common with vault integrations.
Reason 2: The incorrect mint target is hard-coded (msg.sender), so the bug happens deterministically in every such deposit.
Impact:
Assets are deposited for receiver, but the minted shares go to msg.sender, causing loss of user ownership.
Breaks ERC-4626 compatibility → integrations relying on standard behavior will malfunction.
PoC Explanation
PoC for Finding (Vault.deposit mints shares to msg.sender instead of receiver).
Steps to reproduce (Hardhat / Remix):
Deploy the ERC20 asset token (or use an existing test token). Mint tokens to A (relayer).
Deploy BriVault (vault) with that token as asset, set participationFeeAddress to a test address,
set eventStartDate > now, eventEndDate > eventStartDate, minimumAmount set appropriately.
From account A (relayer), approve the vault to spend X tokens: token.approve(vault, X).
Choose account B (user, different from A).
From A, call PoC.exploitDeposit(vaultAddress, tokenAddress, amount, B).
Inspect vault.balanceOf(A) and vault.balanceOf(B). Expected: A got shares, B got 0 — demonstrating misallocation.
Explanation
Mint shares to the receiver parameter as the ERC-4626 standard requires.
This ensures deposits made on behalf of others properly credit the intended recipient.
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.