BriVault

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

Receiver mismatch in deposit enables third-party refund without burning attacker’s shares

Root + Impact

Description

  • Issue: deposit records the stake under receiver but mints shares to msg.sender. An attacker can deposit with receiver = victim so the victim can later call cancelParticipation() and drain vault funds, while attacker keeps the shares.

function deposit(uint256 assets, address receiver) public override returns (uint256) {
...
uint256 stakeAsset = assets - fee;
@> stakedAsset[receiver] = stakeAsset; // attribution to receiver
uint256 participantShares = _convertToShares(stakeAsset);
...
@> _mint(msg.sender, participantShares); // shares to msg.sender (attacker)
}
// Root cause in the codebase with @> marks to highlight the relevant section

Risk

Likelihood:

  • Happens whenever receiver != msg.sender is used (allowed by the API).

  • No check enforces receiver-sender consistency.

Impact:

  • Grief/Drain: a third party (the “receiver”) can cancel and get cash from the vault without any shares burned.

  • Shares remain with attacker to profit later.

Proof of Concept

Attacker calls deposit(1000, victim).
Shares are minted to attacker; stakedAsset[victim] = 1000.
Before start: victim.cancelParticipation() → receives 1000 from vault.
Attacker still holds shares for later payout.

Recommended Mitigation

- remove this code
+ add this code
Updates

Appeal created

bube 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!