When a token that exists on one chain but not yet on the other chain, such tokens protocol can deterministically deploy such token to the same address on the other chain in the future. For such token that does not yet exist but is expected to exist on a chain, the following allowlistAssets function can be called to allowlist it on the corresponding chain. Afterwards, the operator can deploy a vault for such token. Although such token does not exist yet, stakers can call the vaults deposit functions like deposit below to mint shares without sending any token amount because soladys SafeTransferLib used by the Vault contract does not check whether the token has code or not. These deposits can mess up the vaults accounting. For example, a malicious staker can mint a very large number of shares that is somewhat close to type(uint256).max while does not send any token amount to the vault when the token does not exist. After the token is deployed and exists on the chain, innocent stakers would mint shares by sending token amounts to the vault. When the vaults totalSupply() becomes very close to type(uint256).max, the malicious staker can mint the difference between type(uint256).max and the existing totalSupply() by sending a small token amount. When the vaults totalSupply() equals type(uint256).max, calling the vaults startRedeem function that further calls soladys ERC4626.convertToAssets function can revert since executing FixedPointMathLib.fullMulDiv(shares, totalAssets() + 1, _inc(totalSupply())) would divide by 0 and revert. As a result, the innocent stakers are DOSed from calling the vaults startRedeem function and lose their deposits.
https://github.com/code-423n4/2024-07-karak/blob/d19a4de35bcaf31ccec8bccd36e2d26594d05aad/src/entities/CoreLib.sol#L67-L75
https://github.com/code-423n4/2024-07-karak/blob/53eb78ebda718d752023db4faff4ab1567327db4/src/Vault.sol#L94-L103
https://github.com/Vectorized/solady/blob/a95f6714868cfe5d590145f936d0661bddff40d2/src/utils/SafeTransferLib.sol#L11-L13
https://github.com/code-423n4/2024-07-karak/blob/53eb78ebda718d752023db4faff4ab1567327db4/src/Vault.sol#L125-L149
https://github.com/Vectorized/solady/blob/main/src/tokens/ERC4626.sol#L192-L204
https://github.com/Vectorized/solady/blob/a95f6714868cfe5d590145f936d0661bddff40d2/src/tokens/ERC4626.sol#L310-L314
The CoreLib.allowlistAssets function can be updated to revert if the underlying token does not exist on the corresponding chain even though it will be deployed and exist on such chain in the future.
