Skip to content
Business logic Audit finding Intermediate

No way to cancel l1 -< l2 messages

The L1-to-L2 messaging contract lacks a cancellation function, so if a message fails on L2, the user cannot reclaim the fee paid. An attacker could not directly exploit this, but users may permanently lose fees.

1AutumnLeaf777 Follow with Bauchibred, wasm_it and 2 others

Originally disclosed on Code4rena

Submitted by 1AutumnLeaf777, also found by Bauchibred, wasm_it, RadiantLabs, and oakcobalt

There is no api to allow cancellation of l1->l2 messages. In the event of an issue in the Kakarot contracts, this will result in the fee being permanently lost since the user has no ability to reclaim the funds.

https://github.com/kkrt-labs/kakarot/blob/7411a5520e8a00be6f5243a50c160e66ad285563/solidity_contracts/src/L1L2Messaging/L1KakarotMessaging.sol#L26-L61

As we can see there are only functions to either send the message from l1 -> l2 or consume an l2 message. There is no cancelL1toL2Message present.

Recommended Mitigation Steps

Introduce the following API to let users cancel their messages after waiting the time limit so that they can reclaim funds.

https://docs.starknet.io/architecture-and-concepts/network-architecture/messaging-mechanism/#l2-l1_message_cancellation

Assessed type

Context

ClementWalter (Kakarot) confirmed and commented:

Severity: Low Only fees would be lost as it is not a bridge. No other funds at risk. But cancellation will be implemented.

LSDan (judge) commented:

Fee loss is still a value leak/loss of funds. Medium is appropriate.

obatirou (Kakarot) commented:

As per the doc, see https://docs.code4rena.com/awarding/judging-criteria/severity-categorization#loss-of-fees-as-low

loss of fees is a LOW.

LSDan (judge) commented:

Loss of fees should be regarded as an impact similar to any other loss of capital Context: I helped write this rule as one of the 3 SC judges that agreed on it.

Loss of unmatured yield or yield in motion shall be capped to medium severity. The intent is that loss of fees is not higher than medium, even if they are substantial yield rewards.

Loss of dust amounts are QA Only loss of dust is specifically stated as low.

Loss of real amounts depends on specific conditions and likelihood considerations. The condition above is very likely, making this a valid medium.

Kakarot mitigated:

PR 1623 and lib PR 12 removed messaging.

Status: Mitigation confirmed.


The original report as published on Code4rena, by 1AutumnLeaf777. 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

The contract only implements sending and consuming messages, with no function to cancel a pending L1-to-L2 message after a timeout.

Impact

If a message fails on L2, the user's fee is permanently lost; only fees are at risk, not bridged funds.

What the attacker needed

Message fails on L2; no cancellation function

The fix

The messaging feature was removed entirely in a later pull request, which mitigates the issue.

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.

When you send a message from one blockchain to another, you pay a fee. If something goes wrong on the receiving side, you normally want to cancel and get your fee back. This report says there is no way to cancel, so the fee is lost.

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 1AutumnLeaf777

View all

5 more disclosed reports, best first.

More from Kakarot

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.