User can bypass staking restrictions through composer and deposit on another chain
A user restricted from staking on the hub vault can still deposit iTRY and receive wiTRY on another chain via the cross-chain composer flow, because the composer does not check the depositor's restriction role. This bypasses the intended regulatory restriction.
Submitted by harry, also found by botdidy, curly, Dest1ny_rs, tobi0x18, and vangrim
Because the cross-chain wiTry flow lacks restriction verification, a user who has been restricted on the staking vault can still effectively stake via the composer and receive wiTRY on another chain. This breaks the intended regulatory restriction.
Root Cause
By intended design, SOFT_RESTRICTED_STAKER_ROLE should prevent an address from staking:
token/wiTRY/StakediTry.so #L27-L28
/// @notice The role which prevents an address to stake
bytes32 private constant SOFT_RESTRICTED_STAKER_ROLE = keccak256("SOFT_RESTRICTED_STAKER_ROLE");
However, due to the way wiTryOFTAdapter and wiTryVaultComposer are integrated, there is no effective check that propagates StakediTry’s restriction roles into the cross-chain path.
In the cross-chain wiTry flow, the LayerZero endpoint callback into wiTryVaultComposer, the call path for cross-chain deposits is: LayerZero Endpoint -> lzCompose() -> handleCompose() -> _depositAndSend()
When the message represents a cross-chain deposit, handleCompose() eventually triggers _depositAndSend():
token/wiTRY/crosschain/wiTryVaultComposer.sol#L61-L84token/wiTRY/crosschain/libraries/VaultComposerSync.sol#L206-L220
function _depositAndSend(
bytes32 _depositor,
uint256 _assetAmount,
SendParam memory _sendParam,
address _refundAddress
) internal virtual {
@> uint256 shareAmount = _deposit(_depositor, _assetAmount);
_assertSlippage(shareAmount, _sendParam.minAmountLD);
_sendParam.amountLD = shareAmount;
_sendParam.minAmountLD = 0;
_send(SHARE_OFT, _sendParam, _refundAddress);
emit Deposited(_depositor, _sendParam.to, _sendParam.dstEid, _assetAmount, shareAmount);
}
The actual deposit into the staking vault is performed in _deposit(), where wiTryVaultComposer deposits into StakediTryCrosschain on behalf of itself:
token/wiTRY/crosschain/libraries/VaultComposerSync.sol #L228-L238
function _deposit(
bytes32,
/*_depositor*/
uint256 _assetAmount
)
internal
virtual
returns (uint256 shareAmount)
{
@> shareAmount = VAULT.deposit(_assetAmount, address(this));
}
Here, VAULT is the StakediTryCrosschain contract. The vault does not enforce restriction checks on the composer contract address (address(this)). It does not check whether the recipient encoded in the OFT message has SOFT_RESTRICTED_STAKER_ROLE (and it also does not check FULL_RESTRICTED_STAKER_ROLE).
As a result, a user who is restricted on StakediTry can still route their position through the wiTry OFT path. By calling wiTryOFTAdapter.send() and going through the LayerZero compose flow, they can deposit iTRY into the vault via wiTryVaultComposer and mint wiTRY on another chain, effectively bypassing the staking restriction that was applied to their address on the hub vault.
Impact
Any user who has been restricted on the staking vault can still stake by going through the cross-chain wiTry flow. They can deposit iTRY via the OFT adapter and receive wiTRY on a spoke chain. This breaks the intended regulatory restriction.
Recommended mitigation steps
In wiTryVaultComposer._depositAndSend(), use the _depositor parameter and verify whether it has a restricted role before executing the VAULT.deposit() operation.
Proof of Concept
Scenario:
- On Sepolia (hub chain), a user effectively controls
100e18iTRYthat can be deposited into the vault. - The admin assigns a restriction role to the user (via
addToBlacklist()withSOFT_RESTRICTED_STAKER_ROLE) due to suspicious or illegal behavior, intending to block further staking. - Despite this, the user calls
wiTryOFTAdapter.send(), going through the OFT adapter and LayerZero compose route, to deposit theiriTRYand send the equivalentwiTRYto another chain. - On OP Sepolia (spoke chain), the restricted user receives the corresponding
wiTRYand continues to hold a staked position, effectively bypassing the restriction on the hub vault.
To run the PoC, create test/crosschainTests/crosschain/PoC.t.sol, add the following code, and run:
forge test --mt test_RestrictedUserBypassViaComposer -vvvv
View detailed Proof of Concept
Output:
...
│ │ │ │ └─ ← [Return] MessagingReceipt({ guid: 0x84f3b896af5e826af7e7a0fd94198a09ee7813bb473d89d412dfd050b3a12068, nonce: 1, fee: MessagingFee({ nativeFee: 10816191207305 [1.081e13], lzTokenFee: 0 }) })
│ │ │ ├─ emit OFTSent(guid: 0x84f3b896af5e826af7e7a0fd94198a09ee7813bb473d89d412dfd050b3a12068, dstEid: 40232 [4.023e4], fromAddress: wiTryVaultComposer: [0xC5231cb966A4F1DBB6be97EdaD19f5B27b14f9C7], amountSentLD: 100000000000000000000 [1e20], amountReceivedLD: 100000000000000000000 [1e20])
│ │ │ └─ ← [Return] MessagingReceipt({ guid: 0x84f3b896af5e826af7e7a0fd94198a09ee7813bb473d89d412dfd050b3a12068, nonce: 1, fee: MessagingFee({ nativeFee: 10816191207305 [1.081e13], lzTokenFee: 0 }) }), OFTReceipt({ amountSentLD: 100000000000000000000 [1e20], amountReceivedLD: 100000000000000000000 [1e20] })
│ │ ├─ emit Deposited(sender: 0x000000000000000000000000f94ca99493a6ca52b3f25bc26a38ffa2643b7534, recipient: 0x000000000000000000000000f94ca99493a6ca52b3f25bc26a38ffa2643b7534, dstEid: 40232 [4.023e4], assetAmt: 100000000000000000000 [1e20], shareAmt: 100000000000000000000 [1e20])
│ │ └─ ← [Stop]
│ ├─ emit Sent(guid: 0x939a39f977d7af96441985f1a8dc7e3c075eb3d5ff8625728c5e90e41d08a24a)
│ └─ ← [Stop]
└─ ← [Stop]
Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 29.92s (15.33s CPU time)
We can see that INITIAL_DEPOSIT (100e18) wiTRY is successfully sent from Sepolia (hub chain) to OP Sepolia (spoke chain).
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
The cross-chain deposit path calls the vault's deposit function from the composer contract without verifying whether the original depositor has a restricted staker role.
Impact
A restricted user can still stake and hold a staked position on another chain, breaking the intended regulatory restriction.
What the attacker needed
User has iTRY on the hub chain; user is restricted on the staking vault; cross-chain composer flow is available
The fix
The composer should check the depositor's restricted role before calling the vault's deposit function.
How it was found
- A user controls iTRY on the hub chain.
- The admin assigns the user a soft restricted staker role.
- The user calls the OFT adapter send function to route through the LayerZero compose flow.
- The composer deposits the iTRY into the vault on behalf of itself.
- The user receives wiTRY on the spoke chain.
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 staking vault has a rule that blocks certain addresses from staking. But there is a second way to stake: sending funds through a cross-chain bridge helper called a composer. That helper never checks the block list, so a blocked user can still stake and get a receipt token on another chain.
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.