BriVault

First Flight #52
Beginner FriendlySolidity
100 EXP
View results
Submission Details
Severity: high
Valid

Shares Minted to `msg.sender` Instead of `receiver`

Description

  • ERC4626 deposit should credit shares to the receiver argument for delegated deposits.

  • Implementation logs stake under receiver but calls _mint(msg.sender, shares), so downstream logic tied to balanceOf(receiver) breaks.

// src/briVault.sol:220-233
stakedAsset[receiver] = stakeAsset;
...
@> _mint(msg.sender, participantShares);

Risk

Likelihood:

  • Any integration or custodian depositing on behalf of users (a standard pattern) will trigger it.

  • There is no UI or contract guard preventing delegated deposits.

Impact:

  • Receivers cannot join or withdraw because they lack shares, locking their funds.

  • Senders hold shares but never set a country, so their assets are equally stuck.

Proof of Concept

alice.deposit(100 ether, bob);
bob.joinEvent(1);
owner.setWinner(1);
bob.withdraw(); // shares == 0, receives nothing despite funding the pool

Recommended Mitigation

- _mint(msg.sender, participantShares);
+ _mint(receiver, participantShares);
Updates

Appeal created

bryanconquer Lead Judge 19 days ago
Submission Judgement Published
Validated
Assigned finding tags:

Shares Minted to msg.sender Instead of Specified Receiver

Support

FAQs

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

Give us feedback!