Core deposit and depositandbridge functionality in tellerwithmultiassetsupportpredicateproxy is non functional due to flawed sharelockperiod logic
The proxy contract calls the teller's deposit function, which locks the newly minted shares for the proxy itself rather than the end user. When the proxy then tries to transfer those shares to the user, the vault's transfer hook reverts because the shares are still locked, making deposit and depositAndBridge unusable while a share lock period is active.
Plume Network
Originally disclosed on Immunefi
51043 sc medium core deposit and depositandbridge functionality in tellerwithmultiassetsupportpredicateproxy is non functional due to flawed sharelockperiod logic
- Submitted on: Jul 30th 2025 at 16:54:00 UTC by @perseverance for Attackathon | Plume Network
- Report ID: #51043
- Report Type: Smart Contract
- Report severity: Medium
- Target: https://github.com/immunefi-team/attackathon-plume-network-nucleus-boring-vault/blob/main/src/base/Roles/TellerWithMultiAssetSupportPredicateProxy.sol
Impacts:
- Smart contract unable to operate due to lack of token funds
Description
Short summary
The deposit function in TellerWithMultiAssetSupportPredicateProxy.sol is fundamentally broken and will always fail if a shareLockPeriod is active on the underlying CrossChainTellerBase contract. The proxy calls teller.deposit(), which results in the newly minted shares being time-locked for the proxy itself. The proxy then immediately attempts to transfer these locked shares to the end-user, causing the transaction to revert due to the lock. This makes the proxy-based deposit and depositAndBridge functionality unusable while a share lock period is active.
The vulnerability
The Plume Network architecture includes a TellerWithMultiAssetSupportPredicateProxy.sol contract that acts as an intermediary allowing users to deposit assets into the BoringVault indirectly.
The core deposit logic is handled by TellerWithMultiAssetSupport.sol (Teller), which interacts with BoringVault.sol. A key security feature of the Teller is the shareLockPeriod. When a deposit is made, the newly minted vault shares are locked for the depositor for a specified duration. This is enforced by a beforeTransfer hook in BoringVault.sol that checks the lock status before any share transfer.
The bug affects both deposit and depositAndBridge. The flawed interaction occurs within the deposit function of the proxy:
// File: src/base/Roles/TellerWithMultiAssetSupportPredicateProxy.sol
function deposit(
ERC20 depositAsset,
uint256 depositAmount,
uint256 minimumMint,
address recipient,
CrossChainTellerBase teller,
PredicateMessage calldata predicateMessage
) external nonReentrant returns (uint256 shares) {
//...
// [Step 1] Proxy calls teller.deposit(). msg.sender is the proxy contract.
shares = teller.deposit(depositAsset, depositAmount, minimumMint);
// [Step 2] The Teller locks the shares for the msg.sender (the proxy).
// [Step 3] Proxy tries to transfer the now-locked shares to the user.
// THIS CALL WILL FAIL.
vault.safeTransfer(recipient, shares);
//...
}
The lock is applied inside teller.deposit via an internal call to _afterPublicDeposit, which locks shares for its msg.sender.
// src/base/Roles/TellerWithMultiAssetSupport.sol
function deposit(
ERC20 depositAsset,
uint256 depositAmount,
uint256 minimumMint
)
external
requiresAuth
nonReentrant
returns (uint256 shares)
{
if (isPaused) revert TellerWithMultiAssetSupport__Paused();
if (!isSupported[depositAsset]) revert TellerWithMultiAssetSupport__AssetNotSupported();
shares = _erc20Deposit(depositAsset, depositAmount, minimumMint, msg.sender); // @audit msg.sender = TellerWithMultiAssetSupportPredicateProxy
_afterPublicDeposit(msg.sender, depositAsset, depositAmount, shares, shareLockPeriod); // @audit msg.sender = TellerWithMultiAssetSupportPredicateProxy
}
// src/base/Roles/TellerWithMultiAssetSupport.sol
function _erc20Deposit(
ERC20 depositAsset,
uint256 depositAmount,
uint256 minimumMint,
address to // @audit to = TellerWithMultiAssetSupportPredicateProxy
)
internal
returns (uint256 shares)
{
if (depositAmount == 0) revert TellerWithMultiAssetSupport__ZeroAssets();
shares = depositAmount.mulDivDown(ONE_SHARE, accountant.getRateInQuoteSafe(depositAsset));
if (shares < minimumMint) revert TellerWithMultiAssetSupport__MinimumMintNotMet();
vault.enter(msg.sender, depositAsset, depositAmount, to, shares); // @audit to = TellerWithMultiAssetSupportPredicateProxy
}
function _afterPublicDeposit(
address user, // @audit user = TellerWithMultiAssetSupportPredicateProxy
ERC20 depositAsset,
uint256 depositAmount,
uint256 shares,
uint256 currentShareLockPeriod
)
internal
{
shareUnlockTime[user] = block.timestamp + currentShareLockPeriod; // @audit shareUnlockTime[user] = shareUnlockTime[TellerWithMultiAssetSupportPredicateProxy]
uint256 nonce = depositNonce;
publicDepositHistory[nonce] =
keccak256(abi.encode(user, depositAsset, depositAmount, shares, block.timestamp, currentShareLockPeriod));
depositNonce++;
emit Deposit(nonce, user, address(depositAsset), depositAmount, shares, block.timestamp, currentShareLockPeriod);
}
After the proxy calls teller.deposit, shareUnlockTime[TellerWithMultiAssetSupportPredicateProxy] = block.timestamp + currentShareLockPeriod. When the proxy attempts to transfer shares, the vault invokes the beforeTransfer hook:
// src/base/BoringVault.sol
function transfer(address to, uint256 amount) public override returns (bool) {
_callBeforeTransfer(msg.sender); // @audit msg.sender = TellerWithMultiAssetSupportPredicateProxy
return super.transfer(to, amount);
}
function _callBeforeTransfer(address from) internal view {
if (address(hook) != address(0)) hook.beforeTransfer(from); // @audit from = TellerWithMultiAssetSupportPredicateProxy
}
And the beforeTransfer implementation in the Teller reverts when shares are still locked:
// src/base/Roles/TellerWithMultiAssetSupport.sol
function beforeTransfer(address from) public view {
if (shareUnlockTime[from] > block.timestamp) revert TellerWithMultiAssetSupport__SharesAreLocked(); // revert if locked
}
Thus, if shareLockPeriod > 0, beforeTransfer will revert and the proxy cannot forward shares to the user. The same pattern causes depositAndBridge to fail because bridge calls beforeTransfer(msg.sender) before burning shares.
depositAndBridge flow:
function depositAndBridge(
ERC20 depositAsset,
uint256 depositAmount,
uint256 minimumMint,
BridgeData calldata data
)
external
payable
requiresAuth
nonReentrant
{
if (!isSupported[depositAsset]) {
revert TellerWithMultiAssetSupport__AssetNotSupported();
}
uint256 shareAmount = _erc20Deposit(depositAsset, depositAmount, minimumMint, msg.sender); // @audit msg.sender = TellerWithMultiAssetSupportPredicateProxy
_afterPublicDeposit(msg.sender, depositAsset, depositAmount, shareAmount, shareLockPeriod); // @audit msg.sender = TellerWithMultiAssetSupportPredicateProxy
bridge(shareAmount, data);
}
bridge calls beforeTransfer(msg.sender) and will revert because the proxy's shares are locked:
// src/base/Roles/CrossChain/CrossChainTellerBase.sol
function bridge(
uint256 shareAmount,
BridgeData calldata data
)
public
payable
requiresAuth
returns (bytes32 messageId)
{
if (isPaused) revert TellerWithMultiAssetSupport__Paused();
_beforeBridge(data);
// Since shares are directly burned, call `beforeTransfer` to enforce before transfer hooks.
beforeTransfer(msg.sender); // @audit-issue -> reverts when shareUnlockTime[msg.sender] > block.timestamp
// Burn shares from sender
vault.exit(address(0), ERC20(address(0)), 0, msg.sender, shareAmount);
messageId = _bridge(shareAmount, data);
_afterBridge(shareAmount, data, messageId);
}
Severity assessment
- Bug Severity: Medium
- Impact category: Medium — Smart contract unable to operate due to lack of token funds. This renders a primary feature of the proxy unusable while share lock periods are active.
Suggested Fix / Remediation
The proxy deposit mechanism must ensure the lock is applied to the final recipient (user), not the intermediary proxy (msg.sender). Concretely, the Teller should be made aware of the intended recipient for locking (for example by exposing a deposit API that takes a recipient argument and applies the lock to that recipient), or the proxy should deposit on behalf of the recipient such that msg.sender in the Teller is the final recipient. The locking logic should lock the user who receives the shares rather than the proxy address.
Proof of Concept (conceptual)
This scenario demonstrates how standard protocol operation leads to a denial of service for a core feature.
{% stepper %} {% step %}
Setup
A protocol administrator sets shareLockPeriod to 1 hour on the CrossChainTellerBase contract.
{% endstep %}
{% step %}
User action
A user calls the proxy:
deposit(WETH, 10e18, 0, userAddress, ...) on TellerWithMultiAssetSupportPredicateProxy.
{% endstep %}
{% step %}
Sequence
- Proxy pulls 10 WETH from the user.
- Proxy calls
teller.deposit(). TheBoringVaultmints shares and sends them to the proxy contract. - The
Tellermarks the proxy's new shares as locked for 1 hour. - The proxy immediately tries to
safeTransferthe new shares touserAddress. - The
beforeTransferhook checks the proxy's lock and reverts because the proxy's shares are locked. {% endstep %}
{% step %}
Result
The user's transaction fails and gas is lost. The proxy's deposit functionality cannot be used while shareLockPeriod > 0.
{% endstep %}
{% endstepper %}
Sequence diagram (illustrative):
sequenceDiagram
participant User
participant Proxy as "TellerWithMultiAssetSupportPredicateProxy"
participant Teller as "CrossChainTellerBase (TellerWithMultiAssetSupport)"
participant Vault as "BoringVault"
User->>Proxy: deposit(asset, amount, userAddress, ...)
Proxy->>Teller: deposit(asset, amount, minMint)
note right of Proxy: msg.sender is Proxy
Teller->>Vault: enter(...)
note right of Teller: Mints shares to Proxy's address
Vault-->>Teller: returns success
Teller-->>Proxy: returns shares
note left of Teller: Teller applies lock to msg.sender (Proxy)
Proxy->>Vault: safeTransfer(userAddress, shares)
note right of Proxy: Attempting to move shares from Proxy to User
Vault->>Vault: beforeTransfer(from=Proxy, ...)
note right of Vault: Hook checks if Proxy's shares are locked
note over Vault: Check finds shares are LOCKED!
Vault-->>Proxy: REVERT (TellerWithMultiAssetSupport__SharesLocked)
Proxy-->>User: REVERT (Transaction Fails)
References (code locations)
- Proxy: https://github.com/immunefi-team/attackathon-plume-network-nucleus-boring-vault/blob/main/src/base/Roles/TellerWithMultiAssetSupportPredicateProxy.sol
- Teller deposit + lock: https://github.com/immunefi-team/attackathon-plume-network-nucleus-boring-vault/blob/main/src/base/Roles/TellerWithMultiAssetSupport.sol
- Vault hooks: https://github.com/immunefi-team/attackathon-plume-network-nucleus-boring-vault/blob/main/src/base/BoringVault.sol
- Bridge flow: https://github.com/immunefi-team/attackathon-plume-network-nucleus-boring-vault/blob/main/src/base/Roles/CrossChain/CrossChainTellerBase.sol
(End of report)
Context
The target is the Plume Network codebase, specifically the TellerWithMultiAssetSupportPredicateProxy.sol contract in the attackathon-plume-network-nucleus-boring-vault repository. The proxy sits between users and the BoringVault, letting users deposit assets into the vault indirectly. The core deposit logic lives in TellerWithMultiAssetSupport.sol (the Teller), which interacts with BoringVault.sol.
A key security feature of the Teller is shareLockPeriod. When a deposit is made, the newly minted vault shares are locked for the depositor for a specified duration. This is enforced by a beforeTransfer hook in BoringVault.sol that checks the lock status before any share transfer.
The report describes a flaw in which the proxy's deposit and depositAndBridge functions become unusable whenever a shareLockPeriod is active on the underlying CrossChainTellerBase contract.
Setup
The scenario requires a protocol administrator to set shareLockPeriod to a non-zero value on the CrossChainTellerBase contract. In the proof of concept the value used is 1 hour. No other accounts, tools or versions are described in the report.
Finding it
The proxy calls teller.deposit(), which results in the newly minted shares being time-locked for the proxy itself. The proxy then immediately attempts to transfer these locked shares to the end-user, causing the transaction to revert due to the lock. The same pattern affects depositAndBridge.
The flawed interaction occurs within the deposit function of the proxy:
// File: src/base/Roles/TellerWithMultiAssetSupportPredicateProxy.sol
function deposit(
ERC20 depositAsset,
uint256 depositAmount,
uint256 minimumMint,
address recipient,
CrossChainTellerBase teller,
PredicateMessage calldata predicateMessage
) external nonReentrant returns (uint256 shares) {
//...
// [Step 1] Proxy calls teller.deposit(). msg.sender is the proxy contract.
shares = teller.deposit(depositAsset, depositAmount, minimumMint);
// [Step 2] The Teller locks the shares for the msg.sender (the proxy).
// [Step 3] Proxy tries to transfer the now-locked shares to the user.
// THIS CALL WILL FAIL.
vault.safeTransfer(recipient, shares);
//...
}
The lock is applied inside teller.deposit via an internal call to _afterPublicDeposit, which locks shares for its msg.sender:
// src/base/Roles/TellerWithMultiAssetSupport.sol
function deposit(
ERC20 depositAsset,
uint256 depositAmount,
uint256 minimumMint
)
external
requiresAuth
nonReentrant
returns (uint256 shares)
{
if (isPaused) revert TellerWithMultiAssetSupport__Paused();
if (!isSupported[depositAsset]) revert TellerWithMultiAssetSupport__AssetNotSupported();
shares = _erc20Deposit(depositAsset, depositAmount, minimumMint, msg.sender); // @audit msg.sender = TellerWithMultiAssetSupportPredicateProxy
_afterPublicDeposit(msg.sender, depositAsset, depositAmount, shares, shareLockPeriod); // @audit msg.sender = TellerWithMultiAssetSupportPredicateProxy
}
// src/base/Roles/TellerWithMultiAssetSupport.sol
function _erc20Deposit(
ERC20 depositAsset,
uint256 depositAmount,
uint256 minimumMint,
address to // @audit to = TellerWithMultiAssetSupportPredicateProxy
)
internal
returns (uint256 shares)
{
if (depositAmount == 0) revert TellerWithMultiAssetSupport__ZeroAssets();
shares = depositAmount.mulDivDown(ONE_SHARE, accountant.getRateInQuoteSafe(depositAsset));
if (shares < minimumMint) revert TellerWithMultiAssetSupport__MinimumMintNotMet();
vault.enter(msg.sender, depositAsset, depositAmount, to, shares); // @audit to = TellerWithMultiAssetSupportPredicateProxy
}
function _afterPublicDeposit(
address user, // @audit user = TellerWithMultiAssetSupportPredicateProxy
ERC20 depositAsset,
uint256 depositAmount,
uint256 shares,
uint256 currentShareLockPeriod
)
internal
{
shareUnlockTime[user] = block.timestamp + currentShareLockPeriod; // @audit shareUnlockTime[user] = shareUnlockTime[TellerWithMultiAssetSupportPredicateProxy]
uint256 nonce = depositNonce;
publicDepositHistory[nonce] =
keccak256(abi.encode(user, depositAsset, depositAmount, shares, block.timestamp, currentShareLockPeriod));
depositNonce++;
emit Deposit(nonce, user, address(depositAsset), depositAmount, shares, block.timestamp, currentShareLockPeriod);
}
After the proxy calls teller.deposit, shareUnlockTime[TellerWithMultiAssetSupportPredicateProxy] = block.timestamp + currentShareLockPeriod. When the proxy attempts to transfer shares, the vault invokes the beforeTransfer hook:
// src/base/BoringVault.sol
function transfer(address to, uint256 amount) public override returns (bool) {
_callBeforeTransfer(msg.sender); // @audit msg.sender = TellerWithMultiAssetSupportPredicateProxy
return super.transfer(to, amount);
}
function _callBeforeTransfer(address from) internal view {
if (address(hook) != address(0)) hook.beforeTransfer(from); // @audit from = TellerWithMultiAssetSupportPredicateProxy
}
And the beforeTransfer implementation in the Teller reverts when shares are still locked:
// src/base/Roles/TellerWithMultiAssetSupport.sol
function beforeTransfer(address from) public view {
if (shareUnlockTime[from] > block.timestamp) revert TellerWithMultiAssetSupport__SharesAreLocked(); // revert if locked
}
Thus, if shareLockPeriod > 0, beforeTransfer will revert and the proxy cannot forward shares to the user.
Exploitation
Step 1: Administrator sets the lock period
A protocol administrator sets shareLockPeriod to 1 hour on the CrossChainTellerBase contract.
Step 2: User calls the proxy
A user calls the proxy:
deposit(WETH, 10e18, 0, userAddress, ...) on `TellerWithMultiAssetSupportPredicateProxy`.
Step 3: Sequence of events
- Proxy pulls 10 WETH from the user.
- Proxy calls
teller.deposit(). TheBoringVaultmints shares and sends them to the proxy contract. - The
Tellermarks the proxy's new shares as locked for 1 hour. - The proxy immediately tries to
safeTransferthe new shares touserAddress. - The
beforeTransferhook checks the proxy's lock and reverts because the proxy's shares are locked.
Step 4: Result
The user's transaction fails and gas is lost. The proxy's deposit functionality cannot be used while shareLockPeriod > 0.
The report also includes a sequence diagram (illustrative):
sequenceDiagram
participant User
participant Proxy as "TellerWithMultiAssetSupportPredicateProxy"
participant Teller as "CrossChainTellerBase (TellerWithMultiAssetSupport)"
participant Vault as "BoringVault"
User->>Proxy: deposit(asset, amount, userAddress, ...)
Proxy->>Teller: deposit(asset, amount, minMint)
note right of Proxy: msg.sender is Proxy
Teller->>Vault: enter(...)
note right of Teller: Mints shares to Proxy's address
Vault-->>Teller: returns success
Teller-->>Proxy: returns shares
note left of Teller: Teller applies lock to msg.sender (Proxy)
Proxy->>Vault: safeTransfer(userAddress, shares)
note right of Proxy: Attempting to move shares from Proxy to User
Vault->>Vault: beforeTransfer(from=Proxy, ...)
note right of Vault: Hook checks if Proxy's shares are locked
note over Vault: Check finds shares are LOCKED!
Vault-->>Proxy: REVERT (TellerWithMultiAssetSupport__SharesLocked)
Proxy-->>User: REVERT (Transaction Fails)
The depositAndBridge path
The same pattern causes depositAndBridge to fail because bridge calls beforeTransfer(msg.sender) before burning shares.
function depositAndBridge(
ERC20 depositAsset,
uint256 depositAmount,
uint256 minimumMint,
BridgeData calldata data
)
external
payable
requiresAuth
nonReentrant
{
if (!isSupported[depositAsset]) {
revert TellerWithMultiAssetSupport__AssetNotSupported();
}
uint256 shareAmount = _erc20Deposit(depositAsset, depositAmount, minimumMint, msg.sender); // @audit msg.sender = TellerWithMultiAssetSupportPredicateProxy
_afterPublicDeposit(msg.sender, depositAsset, depositAmount, shareAmount, shareLockPeriod); // @audit msg.sender = TellerWithMultiAssetSupportPredicateProxy
bridge(shareAmount, data);
}
bridge calls beforeTransfer(msg.sender) and will revert because the proxy's shares are locked:
// src/base/Roles/CrossChain/CrossChainTellerBase.sol
function bridge(
uint256 shareAmount,
BridgeData calldata data
)
public
payable
requiresAuth
returns (bytes32 messageId)
{
if (isPaused) revert TellerWithMultiAssetSupport__Paused();
_beforeBridge(data);
// Since shares are directly burned, call `beforeTransfer` to enforce before transfer hooks.
beforeTransfer(msg.sender); // @audit-issue -> reverts when shareUnlockTime[msg.sender] > block.timestamp
// Burn shares from sender
vault.exit(address(0), ERC20(address(0)), 0, msg.sender, shareAmount);
messageId = _bridge(shareAmount, data);
_afterBridge(shareAmount, data, messageId);
}
Root cause
The proxy calls teller.deposit(), so msg.sender inside the Teller is the proxy contract. The Teller applies the share lock to msg.sender via _afterPublicDeposit, setting shareUnlockTime[proxy] = block.timestamp + shareLockPeriod. The shares are minted to the proxy (to = msg.sender in _erc20Deposit). When the proxy then calls vault.safeTransfer(recipient, shares), the vault's beforeTransfer hook checks shareUnlockTime[from] where from is the proxy, finds it greater than block.timestamp, and reverts with TellerWithMultiAssetSupport__SharesAreLocked. The lock is applied to the intermediary rather than the final recipient, so the proxy can never forward the shares while the lock is active. The same applies to depositAndBridge, where bridge calls beforeTransfer(msg.sender) before burning shares.
Impact
The report rates this as Medium severity, with the impact category "Smart contract unable to operate due to lack of token funds". The proxy-based deposit and depositAndBridge functionality is unusable while a share lock period is active. This renders a primary feature of the proxy unusable while share lock periods are active.
Fix
The proxy deposit mechanism must ensure the lock is applied to the final recipient (the user), not the intermediary proxy (msg.sender). Concretely, the Teller should be made aware of the intended recipient for locking, for example by exposing a deposit API that takes a recipient argument and applies the lock to that recipient, or the proxy should deposit on behalf of the recipient such that msg.sender in the Teller is the final recipient. The locking logic should lock the user who receives the shares rather than the proxy address.
Variants to test
- Any proxy or router contract that calls a
Teller-style deposit function and then forwards shares to a user. A positive result is a revert with a shares-locked error whenever the lock period is non-zero. - Bridge flows that call
beforeTransferbefore burning shares. A positive result is the same revert on the bridge path. - Deposit APIs that accept a recipient argument but still apply the lock to
msg.sender. A positive result is a lock recorded against the caller rather than the recipient.
Hunting notes
This kind of bug tends to hide in intermediary contracts that wrap a deposit function and then move the resulting shares or tokens onward. During recon, look for proxy or router contracts that call a Teller-style deposit and then transfer the minted shares to a different address. Signals include a shareLockPeriod or similar time-lock feature on the underlying contract, a beforeTransfer hook that checks a per-address unlock time, and deposit functions that pass msg.sender as the recipient. The report walks through the call sequence, showing the lock recorded against the proxy and the beforeTransfer check reverting, which shows a denial of service for a core feature under a realistic configuration.
What happened, in plain words
Imagine a bank where you cannot hand your deposit slip to the cashier directly. Instead, you give it to a middleman standing at the counter, and the middleman is supposed to pass it on to the cashier and then hand you the receipt. Now imagine the bank has a rule: any receipt issued to someone is frozen for one hour and cannot be passed to anyone else during that time. The middleman gets the receipt in their own name, tries to hand it to you straight away, and the bank refuses because the receipt is frozen. Your money went in, but you get nothing back and the attempt fails.
That is essentially the bug described here. A smart contract called a proxy acts as that middleman. It takes a user's deposit, passes it to the main deposit contract, and then tries to forward the resulting shares to the user. But the main contract has a feature called a share lock period, which freezes newly created shares for a set time. The freeze is applied to whoever called the deposit function, which is the proxy, not the user. So when the proxy tries to pass the shares on, the vault refuses, and the whole transaction fails.
This report was submitted to the Plume Network bug bounty programme on Immunefi, a platform where security researchers report flaws in software and are paid for valid findings. It was rated Medium severity. The impact category given is "Smart contract unable to operate due to lack of token funds", meaning a core feature simply cannot work.
Before going further, a few words on the building blocks, because the rest of this article leans on them.
- A smart contract is a small program that lives on a blockchain. It runs automatically when someone sends it a transaction, and its rules cannot be changed after it is deployed unless the code allows it.
- A blockchain is a shared ledger that many computers keep copies of. Once a transaction is recorded, it stays recorded.
- A token is a digital unit tracked by a smart contract. It can represent money, a share, a receipt, or anything else the contract's authors decide.
- A vault is a smart contract that holds tokens on behalf of users. When you put tokens in, the vault gives you something in return that represents your claim on what is inside.
- A share is that something. It is a token issued by the vault. If the vault holds 100 tokens and you deposited 10 of them, you might hold shares representing a tenth of the vault.
- A proxy is a contract that sits in front of another contract and passes requests through it, often adding checks or extra steps. Think of it as a receptionist who takes your form, walks it to the right office, and brings back the stamped copy.
- Gas is the fee paid to run a transaction on a blockchain. If a transaction fails, the fee is still spent, because the computers still did the work of checking it.
- A revert is how a smart contract refuses to complete a transaction. It undoes everything the transaction did and returns an error. It is the blockchain equivalent of a cashier saying "no, I cannot process this".
- A hook is a piece of code that the main contract calls at a particular moment, so that another contract can add its own rules. Here, the vault calls a hook before any share transfer, and the hook can block the transfer.
- msg.sender is a special value inside every smart contract that records who called the current function. It is the blockchain's version of a caller ID. When contract A calls contract B, then inside B,
msg.senderis A, not the person who started the whole chain of calls. - A denial of service means making a feature unusable, whether by crashing it, blocking it, or making every attempt fail.
Context
The target is the Plume Network codebase, specifically the TellerWithMultiAssetSupportPredicateProxy.sol contract in the attackathon-plume-network-nucleus-boring-vault repository. The proxy sits between users and the BoringVault, letting users deposit assets into the vault indirectly. The core deposit logic lives in TellerWithMultiAssetSupport.sol (the Teller), which interacts with BoringVault.sol.
In plain terms, there are three contracts in a row. The user talks to the proxy. The proxy talks to the Teller. The Teller talks to the vault. Each one has a job. The proxy is the front door for users who want to deposit through this particular route. The Teller handles the accounting of deposits and issues shares. The vault holds the actual tokens and the shares.
A key security feature of the Teller is shareLockPeriod. When a deposit is made, the newly minted vault shares are locked for the depositor for a specified duration. This is enforced by a beforeTransfer hook in BoringVault.sol that checks the lock status before any share transfer.
Why would anyone want to lock shares? A lock period is a common defence. It stops someone from depositing and immediately pulling the shares out again, which can be used to game the way the vault prices its shares or to exploit timing differences between deposits and withdrawals. The lock says: your shares exist, but you cannot move them for a while. The vault enforces this by calling the hook before every transfer, and the hook looks up the sender's unlock time.
The report describes a flaw in which the proxy's deposit and depositAndBridge functions become unusable whenever a shareLockPeriod is active on the underlying CrossChainTellerBase contract.
depositAndBridge is a second function on the proxy. It deposits the user's tokens and then, in the same transaction, sends the resulting shares off to another chain through a bridge. A bridge is a mechanism for moving tokens from one blockchain to another. Both functions hit the same wall.
Setup
The scenario requires a protocol administrator to set shareLockPeriod to a non-zero value on the CrossChainTellerBase contract. In the proof of concept the value used is 1 hour. No other accounts, tools or versions are described in the report.
A protocol administrator is someone with the rights to change settings on the contract. Setting the lock period to one hour is a normal, sensible configuration, not an attack. That is the point: the bug appears under ordinary use.
Finding it
The proxy calls teller.deposit(), which results in the newly minted shares being time-locked for the proxy itself. The proxy then immediately attempts to transfer these locked shares to the end-user, causing the transaction to revert due to the lock. The same pattern affects depositAndBridge.
The flawed interaction occurs within the deposit function of the proxy:
// File: src/base/Roles/TellerWithMultiAssetSupportPredicateProxy.sol
function deposit(
ERC20 depositAsset,
uint256 depositAmount,
uint256 minimumMint,
address recipient,
CrossChainTellerBase teller,
PredicateMessage calldata predicateMessage
) external nonReentrant returns (uint256 shares) {
//...
// [Step 1] Proxy calls teller.deposit(). msg.sender is the proxy contract.
shares = teller.deposit(depositAsset, depositAmount, minimumMint);
// [Step 2] The Teller locks the shares for the msg.sender (the proxy).
// [Step 3] Proxy tries to transfer the now-locked shares to the user.
// THIS CALL WILL FAIL.
vault.safeTransfer(recipient, shares);
//...
}
Line by line:
function deposit(starts the definition of the proxy's deposit function. Everything between the parentheses is an input the caller must supply.ERC20 depositAssetis the token the user wants to deposit, for example a wrapped version of a cryptocurrency.uint256 depositAmountis how much of that token to deposit.uint256means a whole non-negative number.uint256 minimumMintis the smallest number of shares the user will accept. If the vault would issue fewer, the transaction should fail rather than give the user a bad deal.address recipientis the user's blockchain address, the place the shares should end up.CrossChainTellerBase telleris a reference to the Teller contract the proxy will call.PredicateMessage calldata predicateMessageis extra data passed along, presumably for a permission check performed elsewhere. The report does not explain its contents.external nonReentrant returns (uint256 shares)says the function can be called from outside, that it cannot be re-entered while it is running (a guard against a classic attack where a contract calls back into itself mid-operation), and that it returns the number of shares.shares = teller.deposit(depositAsset, depositAmount, minimumMint);is the key line. The proxy asks the Teller to do the deposit. Because the proxy is the one making the call, the Teller seesmsg.senderas the proxy's address.- The comment marks step 2: the Teller records the lock against
msg.sender, which is the proxy. vault.safeTransfer(recipient, shares);is where it breaks. The proxy tries to send the shares to the user. The vault checks the lock first, sees the proxy is frozen, and refuses.
The lock is applied inside teller.deposit via an internal call to _afterPublicDeposit, which locks shares for its msg.sender:
// src/base/Roles/TellerWithMultiAssetSupport.sol
function deposit(
ERC20 depositAsset,
uint256 depositAmount,
uint256 minimumMint
)
external
requiresAuth
nonReentrant
returns (uint256 shares)
{
if (isPaused) revert TellerWithMultiAssetSupport__Paused();
if (!isSupported[depositAsset]) revert TellerWithMultiAssetSupport__AssetNotSupported();
shares = _erc20Deposit(depositAsset, depositAmount, minimumMint, msg.sender); // @audit msg.sender = TellerWithMultiAssetSupportPredicateProxy
_afterPublicDeposit(msg.sender, depositAsset, depositAmount, shares, shareLockPeriod); // @audit msg.sender = TellerWithMultiAssetSupportPredicateProxy
}
Line by line:
function deposit(begins the Teller's own deposit function. Note that it takes only three inputs: the asset, the amount, and the minimum shares. There is no recipient parameter. That absence is the heart of the bug.external requiresAuth nonReentrantmeans the function is callable from outside, only by an authorised caller, and protected against re-entry.if (isPaused) revert ...stops everything if the contract is paused, a standard emergency switch.if (!isSupported[depositAsset]) revert ...stops everything if the token is not on the list of accepted assets.shares = _erc20Deposit(depositAsset, depositAmount, minimumMint, msg.sender);performs the actual deposit and passesmsg.senderas the destination. Since the proxy called this function, the shares are created for the proxy._afterPublicDeposit(msg.sender, depositAsset, depositAmount, shares, shareLockPeriod);records the lock. Againmsg.senderis the proxy, so the lock is recorded against the proxy.
// src/base/Roles/TellerWithMultiAssetSupport.sol
function _erc20Deposit(
ERC20 depositAsset,
uint256 depositAmount,
uint256 minimumMint,
address to // @audit to = TellerWithMultiAssetSupportPredicateProxy
)
internal
returns (uint256 shares)
{
if (depositAmount == 0) revert TellerWithMultiAssetSupport__ZeroAssets();
shares = depositAmount.mulDivDown(ONE_SHARE, accountant.getRateInQuoteSafe(depositAsset));
if (shares < minimumMint) revert TellerWithMultiAssetSupport__MinimumMintNotMet();
vault.enter(msg.sender, depositAsset, depositAmount, to, shares); // @audit to = TellerWithMultiAssetSupportPredicateProxy
}
function _afterPublicDeposit(
address user, // @audit user = TellerWithMultiAssetSupportPredicateProxy
ERC20 depositAsset,
uint256 depositAmount,
uint256 shares,
uint256 currentShareLockPeriod
)
internal
{
shareUnlockTime[user] = block.timestamp + currentShareLockPeriod; // @audit shareUnlockTime[user] = shareUnlockTime[TellerWithMultiAssetSupportPredicateProxy]
uint256 nonce = depositNonce;
publicDepositHistory[nonce] =
keccak256(abi.encode(user, depositAsset, depositAmount, shares, block.timestamp, currentShareLockPeriod));
depositNonce++;
emit Deposit(nonce, user, address(depositAsset), depositAmount, shares, block.timestamp, currentShareLockPeriod);
}
Line by line:
_erc20Depositis an internal helper, meaning only the Teller itself can call it. The leading underscore is a naming convention for internal functions.address tois the destination for the shares. The audit comment notes that in practice this is the proxy's address.if (depositAmount == 0) revert ...rejects empty deposits.shares = depositAmount.mulDivDown(ONE_SHARE, accountant.getRateInQuoteSafe(depositAsset));converts the token amount into a share amount using the current exchange rate from the accountant contract.mulDivDownmultiplies and divides while rounding down, so the vault never gives out more shares than it should.if (shares < minimumMint) revert ...enforces the user's minimum, protecting them from a bad rate.vault.enter(msg.sender, depositAsset, depositAmount, to, shares);tells the vault to take the tokens and create the shares forto, which is the proxy._afterPublicDepositis the function that records the lock. Its first parameter is nameduser, but the caller passesmsg.sender, so in this flowuseris the proxy.shareUnlockTime[user] = block.timestamp + currentShareLockPeriod;is the lock itself.block.timestampis the current time according to the blockchain. Adding the lock period gives the moment the shares become movable. This value is stored in a mapping, which is a lookup table keyed by address.uint256 nonce = depositNonce;takes the current counter value, used to number each deposit uniquely.publicDepositHistory[nonce] = keccak256(abi.encode(...));stores a fingerprint of the deposit details for the record.keccak256is a hashing function that turns data into a fixed-length string, andabi.encodepacks the values together first.depositNonce++;increments the counter for the next deposit.emit Deposit(...)writes an event to the blockchain log, so outside observers can see the deposit happened.
After the proxy calls teller.deposit, shareUnlockTime[TellerWithMultiAssetSupportPredicateProxy] = block.timestamp + currentShareLockPeriod. When the proxy attempts to transfer shares, the vault invokes the beforeTransfer hook:
// src/base/BoringVault.sol
function transfer(address to, uint256 amount) public override returns (bool) {
_callBeforeTransfer(msg.sender); // @audit msg.sender = TellerWithMultiAssetSupportPredicateProxy
return super.transfer(to, amount);
}
function _callBeforeTransfer(address from) internal view {
if (address(hook) != address(0)) hook.beforeTransfer(from); // @audit from = TellerWithMultiAssetSupportPredicateProxy
}
Line by line:
function transfer(address to, uint256 amount)is the vault's standard share transfer function, the same shape as any token transfer: sendamounttoto._callBeforeTransfer(msg.sender);runs the hook before anything moves. The sender here is the proxy, because the proxy is the one calling the vault.return super.transfer(to, amount);then performs the actual transfer, assuming the hook did not stop it._callBeforeTransferis the helper that runs the hook.internal viewmeans only the vault can call it and it does not change state.if (address(hook) != address(0))checks that a hook is configured at all. If no hook is set, nothing to check.hook.beforeTransfer(from);calls the hook with the sender's address, giving the hook a chance to revert.
And the beforeTransfer implementation in the Teller reverts when shares are still locked:
// src/base/Roles/TellerWithMultiAssetSupport.sol
function beforeTransfer(address from) public view {
if (shareUnlockTime[from] > block.timestamp) revert TellerWithMultiAssetSupport__SharesAreLocked(); // revert if locked
}
Line by line:
function beforeTransfer(address from) public viewis the hook the Teller provides. It takes the address that is trying to send shares.if (shareUnlockTime[from] > block.timestamp)looks up that address's unlock time and compares it with now. If the unlock time is in the future, the shares are still locked.revert TellerWithMultiAssetSupport__SharesAreLocked();cancels the transaction with a clear error name.
Thus, if shareLockPeriod > 0, beforeTransfer will revert and the proxy cannot forward shares to the user.
Exploitation
Step 1: Administrator sets the lock period
A protocol administrator sets shareLockPeriod to 1 hour on the CrossChainTellerBase contract.
This is the only precondition. No attacker action is needed to set it up. The administrator is configuring the system as intended.
Step 2: User calls the proxy
A user calls the proxy:
deposit(WETH, 10e18, 0, userAddress, ...) on `TellerWithMultiAssetSupportPredicateProxy`.
Reading this call: the user wants to deposit WETH, a wrapped form of the Ether cryptocurrency. 10e18 is the amount in the smallest unit the token uses, which for most tokens means 10 whole tokens. The 0 is the minimum shares accepted, so the user is not setting a floor here. userAddress is where the shares should go. The trailing ... stands for the remaining arguments, which the report does not spell out.
Step 3: Sequence of events
- Proxy pulls 10 WETH from the user.
- Proxy calls
teller.deposit(). TheBoringVaultmints shares and sends them to the proxy contract. - The
Tellermarks the proxy's new shares as locked for 1 hour. - The proxy immediately tries to
safeTransferthe new shares touserAddress. - The
beforeTransferhook checks the proxy's lock and reverts because the proxy's shares are locked.
To mint shares means to create them. safeTransfer is a transfer function that also checks the receiving contract can handle tokens, a safety measure for transfers to contracts.
Step 4: Result
The user's transaction fails and gas is lost. The proxy's deposit functionality cannot be used while shareLockPeriod > 0.
The report also includes a sequence diagram (illustrative):
sequenceDiagram
participant User
participant Proxy as "TellerWithMultiAssetSupportPredicateProxy"
participant Teller as "CrossChainTellerBase (TellerWithMultiAssetSupport)"
participant Vault as "BoringVault"
User->>Proxy: deposit(asset, amount, userAddress, ...)
Proxy->>Teller: deposit(asset, amount, minMint)
note right of Proxy: msg.sender is Proxy
Teller->>Vault: enter(...)
note right of Teller: Mints shares to Proxy's address
Vault-->>Teller: returns success
Teller-->>Proxy: returns shares
note left of Teller: Teller applies lock to msg.sender (Proxy)
Proxy->>Vault: safeTransfer(userAddress, shares)
note right of Proxy: Attempting to move shares from Proxy to User
Vault->>Vault: beforeTransfer(from=Proxy, ...)
note right of Vault: Hook checks if Proxy's shares are locked
note over Vault: Check finds shares are LOCKED!
Vault-->>Proxy: REVERT (TellerWithMultiAssetSupport__SharesLocked)
Proxy-->>User: REVERT (Transaction Fails)
This diagram is a timeline. Each arrow is one call from one contract to another, read from top to bottom. The user calls the proxy. The proxy calls the Teller. The Teller calls the vault to create shares for the proxy. The vault confirms. The Teller returns the share count to the proxy and records the lock against the proxy. The proxy then calls the vault to send the shares to the user. The vault runs its hook, finds the proxy locked, and reverts. The revert travels back up the chain, so the proxy reverts and the user's transaction fails.
The depositAndBridge path
The same pattern causes depositAndBridge to fail because bridge calls beforeTransfer(msg.sender) before burning shares.
function depositAndBridge(
ERC20 depositAsset,
uint256 depositAmount,
uint256 minimumMint,
BridgeData calldata data
)
external
payable
requiresAuth
nonReentrant
{
if (!isSupported[depositAsset]) {
revert TellerWithMultiAssetSupport__AssetNotSupported();
}
uint256 shareAmount = _erc20Deposit(depositAsset, depositAmount, minimumMint, msg.sender); // @audit msg.sender = TellerWithMultiAssetSupportPredicateProxy
_afterPublicDeposit(msg.sender, depositAsset, depositAmount, shareAmount, shareLockPeriod); // @audit msg.sender = TellerWithMultiAssetSupportPredicateProxy
bridge(shareAmount, data);
}
Line by line:
function depositAndBridge(defines a function that deposits and then bridges in one go.BridgeData calldata datacarries the instructions for the bridge, such as where the shares should go on the other chain.external payable requiresAuth nonReentrantmeans it is callable from outside, can receive the chain's native currency, needs authorisation, and is protected against re-entry.if (!isSupported[depositAsset])rejects tokens that are not accepted.uint256 shareAmount = _erc20Deposit(..., msg.sender);deposits and creates shares for the proxy, exactly as before._afterPublicDeposit(msg.sender, ...)records the lock against the proxy, exactly as before.bridge(shareAmount, data);then tries to send those shares across the bridge.
bridge calls beforeTransfer(msg.sender) and will revert because the proxy's shares are locked:
// src/base/Roles/CrossChain/CrossChainTellerBase.sol
function bridge(
uint256 shareAmount,
BridgeData calldata data
)
public
payable
requiresAuth
returns (bytes32 messageId)
{
if (isPaused) revert TellerWithMultiAssetSupport__Paused();
_beforeBridge(data);
// Since shares are directly burned, call `beforeTransfer` to enforce before transfer hooks.
beforeTransfer(msg.sender); // @audit-issue -> reverts when shareUnlockTime[msg.sender] > block.timestamp
// Burn shares from sender
vault.exit(address(0), ERC20(address(0)), 0, msg.sender, shareAmount);
messageId = _bridge(shareAmount, data);
_afterBridge(shareAmount, data, messageId);
}
Line by line:
function bridge(defines the bridging function, taking an amount of shares and bridge instructions.returns (bytes32 messageId)says it returns an identifier for the bridge message, so the transfer can be tracked.if (isPaused) revert ...respects the emergency pause._beforeBridge(data);runs any pre-bridge checks.beforeTransfer(msg.sender);is the same lock check as before. The comment explains why it is there: the shares are about to be destroyed rather than transferred, so the normal transfer check would not run, and the authors wanted the lock rule to apply anyway.vault.exit(address(0), ERC20(address(0)), 0, msg.sender, shareAmount);removes the shares from the sender. Burning means destroying them permanently.messageId = _bridge(shareAmount, data);sends the bridge message._afterBridge(shareAmount, data, messageId);runs any post-bridge bookkeeping.
Because step 5 runs before anything else happens, and the proxy is locked, the whole bridge path fails too.
Root cause
The proxy calls teller.deposit(), so msg.sender inside the Teller is the proxy contract. The Teller applies the share lock to msg.sender via _afterPublicDeposit, setting shareUnlockTime[proxy] = block.timestamp + shareLockPeriod. The shares are minted to the proxy (to = msg.sender in _erc20Deposit). When the proxy then calls vault.safeTransfer(recipient, shares), the vault's beforeTransfer hook checks shareUnlockTime[from] where from is the proxy, finds it greater than block.timestamp, and reverts with TellerWithMultiAssetSupport__SharesAreLocked. The lock is applied to the intermediary rather than the final recipient, so the proxy can never forward the shares while the lock is active. The same applies to depositAndBridge, where bridge calls beforeTransfer(msg.sender) before burning shares.
Put simply: the Teller has no way to know who the real user is. It only knows who called it, and that is always the proxy. So every lock lands on the proxy, and the proxy is the one address that must move the shares immediately. The rule and the design are in direct conflict.
Impact
The report rates this as Medium severity, with the impact category "Smart contract unable to operate due to lack of token funds". The proxy-based deposit and depositAndBridge functionality is unusable while a share lock period is active. This renders a primary feature of the proxy unusable while share lock periods are active.
The damage is that a whole entry point stops working whenever a normal safety setting is switched on, and users pay gas for transactions that cannot succeed.
Fix
The proxy deposit mechanism must ensure the lock is applied to the final recipient (the user), not the intermediary proxy (msg.sender). Concretely, the Teller should be made aware of the intended recipient for locking, for example by exposing a deposit API that takes a recipient argument and applies the lock to that recipient, or the proxy should deposit on behalf of the recipient such that msg.sender in the Teller is the final recipient. The locking logic should lock the user who receives the shares rather than the proxy address.
In everyday terms: the receipt should be printed in the customer's name, not the middleman's. Either the cashier is told who the customer is, or the customer walks to the counter themselves.
Variants to test
- Any proxy or router contract that calls a
Teller-style deposit function and then forwards shares to a user. A positive result is a revert with a shares-locked error whenever the lock period is non-zero. - Bridge flows that call
beforeTransferbefore burning shares. A positive result is the same revert on the bridge path. - Deposit APIs that accept a recipient argument but still apply the lock to
msg.sender. A positive result is a lock recorded against the caller rather than the recipient.
A router, in this context, is a contract that directs a request to the right place, much like the proxy. The pattern to look for is always the same: a contract that deposits on someone else's behalf and then has to move the result onward.
Hunting notes
This kind of bug tends to hide in intermediary contracts that wrap a deposit function and then move the resulting shares or tokens onward. During recon, look for proxy or router contracts that call a Teller-style deposit and then transfer the minted shares to a different address. Signals include a shareLockPeriod or similar time-lock feature on the underlying contract, a beforeTransfer hook that checks a per-address unlock time, and deposit functions that pass msg.sender as the recipient. The report walks through the call sequence, showing the lock recorded against the proxy and the beforeTransfer check reverting, which shows a denial of service for a core feature under a realistic configuration.
Recon, short for reconnaissance, means the reading and mapping you do before testing anything: which contracts exist, who calls whom, and which settings change behaviour. The lesson here is that a safety feature and a helper contract can each be correct on their own and still break each other when combined.
Glossary
- Address: a unique identifier for an account or contract on a blockchain, similar to an account number.
- Administrator: a person or role with permission to change settings on a contract.
- Blockchain: a shared, append-only ledger kept by many computers.
- Bridge: a mechanism for moving tokens from one blockchain to another.
- Burn: to destroy tokens permanently by removing them from circulation.
- Caller ID (msg.sender): the value inside a contract recording which address called the current function.
- Cross-chain: involving more than one blockchain.
- Denial of service: making a feature unusable, whether by crashing it or making every attempt fail.
- Event: a log entry a contract writes to the blockchain so outsiders can observe what happened.
- Gas: the fee paid to run a transaction; it is spent even if the transaction fails.
- Hash (keccak256): a function that turns any data into a fixed-length fingerprint.
- Hook: code the main contract calls at a set moment so another contract can add rules.
- Mapping: a lookup table inside a contract, keyed by something such as an address.
- Mint: to create new tokens.
- Non-reentrant: protected against a contract calling back into itself mid-operation.
- Proxy: a contract that sits in front of another and passes requests through it.
- Recon: the reading and mapping done before testing, to understand how a system fits together.
- Revert: a contract refusing to complete a transaction and undoing its effects.
- Router: a contract that directs a request to the right destination.
- Share: a token representing a claim on what a vault holds.
- Share lock period: a setting that freezes newly issued shares for a set time so they cannot be moved.
- Smart contract: a program on a blockchain that runs automatically when called.
- Token: a digital unit tracked by a smart contract.
- Transaction: a request sent to a blockchain to run something, which either succeeds or reverts.
- Vault: a contract that holds tokens on behalf of users and issues shares in return.
- WETH: a wrapped form of the Ether cryptocurrency, usable as a standard token.