Skip to content
Business logic Audit finding Intermediate

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.


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

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.

More by rvierdiiev

View all

72 more disclosed reports, best first.

More from Tapioca Invitational

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.