Skip to content
Business logic Audit finding Intermediate

Numa tokens fee on transfer can be bypassed

The Numa token charges a fee when transferring to certain addresses, but whitelisted spenders such as the UniswapV2Router are exempt. Because that router can also be used to sell tokens, a user could sell Numa on Uniswap without paying the transfer fee.

jokr Follow

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2024-12-numa-audit-judging/issues/184

The protocol has acknowledged this issue.

Found by

jokr

Summary

The Numa token is designed in a way that if users want to transfer Numa tokens to a specific address present in isIncludedInFees, a fee will be applied. Additionally, if the spender address is in the wlSpenders list, no fee is charged

In the case of Uniswap, this design allows fees to be taken when users want to sell Numa tokens in Uniswap. The wlSpenders list includes the UniswapV2Router to ensure that liquidity providers do not have to pay fees when adding liquidity using the router

Solidity
// cancel fee for some spenders. Typically, this will be used for UniswapV2Router which is used when adding liquidity
if ((!ns.wlSpenders[spender]) && (fee > 0) && ns.isIncludedInFees[to]) {
    _transferWithFee(from, to, value, fee);
} else {
    super._transfer(from, to, value);
}

However, the UniswapV2Router also includes functions such as swapExactTokensForTokens, which can be used to swap Numa tokens. Since the router is in the whitelist, no fees will be applied for the swap. This allows users to bypass the fee when selling their Numa tokens on Uniswap

Root Cause

In Numa.sol:95, if the spender is whitelisted, no fee will be charged. The whitelisted spender, UniswapV2Router, can also be used to sell Numa tokens, thereby bypassing the fee.

Internal pre-conditions

No response

External pre-conditions

No response

Attack Path

No response

Impact

Users can sell Numa tokens on Uniswap without paying any fees

PoC

No response

Mitigation

Change fee on transfer implementation of Numa token

Discussion

tibthecat

Irrelevant as current deployed Numa token does not have "on-transfer fee" anymore. And numa.sol should not have been in the audit scope.

c-plus-plus-equals-c-plus-one

Irrelevant as current deployed Numa token does not have "on-transfer fee" anymore. And numa.sol should not have been in the audit scope.

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

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 whitelist exemption for spenders is too broad: it exempts the Uniswap router from fees for all its functions, including selling, not just for adding liquidity.

Impact

Users could sell Numa tokens on Uniswap without paying the intended transfer fee, though the protocol says the deployed token no longer has an on-transfer fee.

What the attacker needed

Numa token with on-transfer fee; UniswapV2Router whitelisted as spender

The fix

The fee-on-transfer logic should be changed so that the whitelist exemption applies only to the intended operation, such as adding liquidity, and not to selling.

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.

Some tokens take a small cut, called a fee, when they are sent to certain addresses. The Numa token lets a trusted helper, the Uniswap router, move tokens without that cut, but the same helper can also be used to sell tokens. So a seller can avoid the fee by selling through that helper.

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 jokr

View all

5 more disclosed reports, best first.

More from Numa

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.