Skip to content
Business logic Audit finding Intermediate

Share lock applied to wrapper instead of end user breaks transfers or bypasses lock

The vault's share lock is recorded against the wrapper contract instead of the end user, so freshly minted shares are locked to the wrapper. If the transfer hook is enforced, any immediate transfer of those shares reverts; if it is not, the lock is bypassed and users get transferable shares at once.

Afriauditor Follow

Originally disclosed on Immunefi

  • Disclosed after under an hour

53035 sc medium share lock applied to wrapper instead of end user breaks transfers or bypasses lock

Submitted on Aug 14th 2025 at 17:48:31 UTC by @Afriauditor for Attackathon | Plume Network

Description

Brief / Intro

The vault’s share lock mechanism is applied to the wrapper contract’s address rather than the actual end user in both the bridge (depositAndBridge) and non-bridge (depositOneInch) deposit flows. Depending on configuration this causes one of two critical outcomes:

  • If the vault enforces the BeforeTransferHook, immediate post-deposit transfers revert (flows break).
  • If the hook is disabled, users receive transferable shares instantly, effectively bypassing the intended lock.

Either outcome undermines the intended security model and can brick core functionality.

Vulnerability Details

When the wrapper calls into the teller (TellerWithMultiAssetSupport) it is the wrapper that is msg.sender. This results in:

  • Shares minted to the wrapper
  • The share lock recorded against the wrapper's address rather than the end-user

Example behavior in the teller called by DexAggregatorWrapperWithPredicateProxy:

Solidity
// shares minted to msg.sender (the wrapper)
shares = _erc20Deposit(depositAsset, depositAmount, minimumMint, msg.sender);

// lock recorded for msg.sender (the wrapper), not the user
_afterPublicDeposit(msg.sender, depositAsset, depositAmount, shares, shareLockPeriod);

Consequences:

  • If the vault enforces BeforeTransferHook, any immediate transfer from the wrapper (to the user or onward into the bridge flow) invokes beforeTransfer(wrapper) and triggers: if (shareUnlockTime[from] > block.timestamp) revert SharesAreLocked(); — causing the transfer to revert.
  • If the hook is disabled, the user receives transferable shares immediately (lock bypassed).

Impact Details

{% hint style="warning" %} All wrapper-based deposit paths (both depositOneInch and depositAndBridge) are blocked when the vault enforces BeforeTransferHook, because moving the freshly minted shares out of the wrapper immediately triggers SharesAreLocked. If the hook is not enforced, the intended share lock is effectively bypassed and users obtain transferable shares immediately, breaking invariants. {% endhint %}

Proof of Concept

{% stepper %} {% step %}

Setup

  • Configure the vault to invoke BeforeTransferHook.beforeTransfer(from) on every transfer.
  • Set shareLockPeriod = 2 days in the teller. {% endstep %}

{% step %}

Trigger

  • Call either depositOneInch (non-bridge) or depositAndBridge (bridge) via the wrapper. {% endstep %}

{% step %}

Observed behavior

  • Inside the teller, shares are minted to the wrapper; _afterPublicDeposit sets shareUnlockTime[wrapper] = now + 2 days.
  • The wrapper immediately attempts to move those shares (to the user or into the bridge flow).
  • Vault calls beforeTransfer(wrapper) → sees lock active → reverts with SharesAreLocked. {% endstep %} {% endstepper %}
<details> <summary>Minimal reproduction summary</summary>
  • Wrapper calls teller deposit path.
  • Teller treats wrapper as msg.sender, mints shares to wrapper and records lock against wrapper.
  • Immediate transfer from wrapper hits BeforeTransferHook and reverts due to lock.
</details>

References

The original report as published on Immunefi, by Afriauditor. Images and videos are our own copies; raw HTML is shown as text. View it on Immunefi.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the wrapper calls the teller directly, so the teller treats the wrapper as msg.sender and records the share lock against the wrapper rather than the real depositor.

Impact

When the transfer hook is enforced, all wrapper-based deposit paths are blocked because the shares cannot leave the wrapper; when it is not enforced, the intended share lock is bypassed and users receive transferable shares immediately.

What the attacker needed

Vault uses the wrapper deposit paths; share lock period is configured

How it was found

  1. Configure the vault to call the transfer hook on every transfer and set a two-day share lock period.
  2. Call either depositOneInch or depositAndBridge through the wrapper.
  3. The teller mints shares to the wrapper and records the lock against the wrapper.
  4. The wrapper tries to move the shares immediately and the vault reverts with SharesAreLocked.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A vault gives out 'shares' when you deposit, and it can lock those shares for a set period so they cannot be moved straight away. Here the lock was put on a middleman contract (the wrapper) rather than on the person depositing. That means the middleman cannot pass the shares on while the lock is active, or, if the lock check is switched off, the person gets unlocked shares immediately.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

More by Afriauditor

View all

28 more disclosed reports, best first.

More from Plume Network

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.