Skip to content
Business logic Audit finding Intermediate

Changing NFT contract in the MochiEngine would break the protocol

The MochiEngine contract allows the operator to change the NFT contract address, which would cause all vaults to point to a different NFT contract and break the protocol, making users unable to access their positions.

jonah1005 Follow

Originally disclosed on Code4rena

Submitted by jonah1005

Impact

MochiEngine allows the operator to change the NFT contract in MochiEngine.sol#L91-L93

All the vaults would point to a different NFT address. As a result, users would not be access their positions. The entire protocol would be broken.

IMHO, A function that would break the entire protocol shouldn’t exist.

I consider this is a high-risk issue.

Proof of Concept

MochiEngine.sol#L91-L93

Recommended Mitigation Steps

Remove the function.

ryuheimat (Mochi) confirmed

The original report as published on Code4rena, by jonah1005. 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 contract includes an operator-only function to update the NFT contract address without safeguards, which would break all vaults that depend on the original address.

Impact

If the operator changes the NFT contract, all vaults would point to a different address, users would lose access to their positions, and the entire protocol would be broken.

What the attacker needed

Operator calls the function

The fix

The function should be removed.

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.

The MochiEngine contract has a function that lets the operator change which NFT contract the system uses. If that function is called, all vaults would suddenly refer to a different NFT contract, so users could no longer access their positions and the whole protocol would stop working.

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 jonah1005

View all

39 more disclosed reports, best first.

More from Mochi contest

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.