Skip to content
Business logic Audit finding Intermediate

Transfer fee is burned on wrong accounts

The Vader token's transfer function burns the transfer fee from the sender's address even when the transfer is initiated via transferFrom, which may not involve the sender. This can cause relayers like aggregators to have their balances burned or transactions to fail, disrupting composability.

Vader Protocol contest

Originally disclosed on Code4rena

The Vader._transfer function burns the transfer fee on msg.sender but this address might not be involved in the transfer at all due to transferFrom.

Smart contracts that simply relay transfers like aggregators have their Vader balance burned or the transaction fails because these accounts don’t have any balance to burn, breaking the functionality.

Recommend that It should first increase the balance of recipient by the full amount and then burn the fee on the recipient.

strictly-scarce (vader) confirmed:

For composabilty with the rest of the ecosystem, this should be addressed, although disagree with the severity, no funds are lost, just the aggregrator cannot transfer unless they first transfer to themselves, which most often do.

Mervyn853 commented:

Our decision matrix for severity:

0: No-risk: Code style, clarity, off-chain monitoring (events etc), exclude gas-optimisations 1: Low Risk: UX, state handling, function incorrect as to spec 2: Funds-Not-At-Risk, but can impact the functioning of the protocol, or leak value with a hypothetical attack path with stated assumptions, but external requirements 3: Funds can be stolen/lost directly, or indirectly if a valid attack path shown that does not have handwavey hypotheticals.

Recommended: 2

The original report as published on Code4rena. 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 fee is burned from msg.sender instead of the actual recipient, even when msg.sender is not part of the transfer.

Impact

Aggregators or relayers may have their balances burned or transactions may fail, breaking functionality; no funds are lost according to the project.

What the attacker needed

Contract uses transferFrom; sender has no balance to burn

The fix

The transfer should first increase the recipient's balance by the full amount and then burn the fee from the recipient.

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.

In some tokens, a small fee is taken when you transfer tokens. This report says the fee is taken from the wrong account when a third party (like a service) moves tokens on your behalf. That can break services that rely on moving tokens for users.

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 from Vader Protocol 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.