Skip to content
Business logic Audit finding Intermediate

nTokenERC20Proxy emits events even when not success

The nTokenERC20Proxy contract emits Transfer and Approval events regardless of whether the underlying token operation succeeded. An attacker could exploit this to mislead off-chain systems that rely on these events into treating failed transfers or approvals as successful.

cmichel Follow

Originally disclosed on Code4rena

Submitted by cmichel

The nTokenERC20Proxy functions emit events all the time, even if the return value from the inner call returns false, indicating an unsuccessful action.

An off-chain script scanning for Transfer or Approval events can be tricked into believing that an unsuccessful transfer was indeed successful. This happens in the approve, transfer and transferFrom functions.

Recommend only emitting events on success.

jeffywu (Notional) confirmed

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

Impact

An off-chain script scanning for Transfer or Approval events could be tricked into believing that an unsuccessful transfer was successful.

What the attacker needed

None

The fix

The contract should only emit events when the inner call returns true.

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.

Smart contracts can emit 'events' to signal that something happened, like a transfer of tokens. Here, the contract announces success even when the actual transfer failed, which could confuse programs that watch these announcements.

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 cmichel

View all

196 more disclosed reports, best first.

More from Notional 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.