Cross chain messages in MagnetarAssetXChainModule and MagnetarMintXChainModule will not work
Two cross-chain module functions pass a flag as false, so the composed LayerZero message is left empty and the intended cross-chain mint-and-lend flow cannot work. An attacker cannot exploit this; it is a functional bug that breaks the feature.
rvierdiiev Follow with KIntern_NA
Originally disclosed on Code4rena
Submitted by rvierdiiev, also found by KIntern_NA
In order to send LZ message MagnetarBaseModule._withdrawToChain function is called. This function allows to include composed message only if data.unwrap is set to true. In this case _lzCustomWithdraw function will be used, which will include composed message.
In case if !data.unwrap, then _lzWithdraw function is called, which calls _prepareLzSend function, which includes empty composed message. If you want to include composed message, then you should set data.unwrap as true.
Now, let’s look into MagnetarMintXChainModule.mintBBLendXChainSGL function, which passes false. Then look into MagnetarAssetXChainModule.depositYBLendSGLLockXchainTOLP function, which passes false.
As both of them pass data.unwrap as false, it means that compose message will not be crafted and this cross chain functionality will not work.
Impact
It will be not possible to min usdo on one chain and lend it to singularity on another chain.
Tools Used
VsCode
Recommended Mitigation Steps
Pass data.unwrap` as true.
Assessed type
Error
cryptotechmaker (Tapioca) confirmed and commented:
PR here.
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 two module functions hard-code the unwrap flag to false, so the helper that builds the composed message is never used.
Impact
Users cannot mint usdo on one chain and lend it to a singularity on another chain; no security impact is claimed.
What the attacker needed
None
The fix
The functions should pass the unwrap flag as true so the composed message is included; the report notes a pull request was opened.
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.
This code sends messages between blockchains using a messaging library. To attach extra instructions to a message, a true/false switch must be turned on. Two functions leave it off, so the extra instructions are never sent and the cross-chain action fails.
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.