Unsupported fee-on-transfer tokens
The contract's _burnTokenFrom function assumes it receives the full transfer amount, but fee-on-transfer tokens deliver less. An attacker could exploit this to cause a mismatch between burned and minted amounts, potentially leading to unbacked tokens.
Submitted by cccz
When tokenAddress is fee-on-transfer tokens, in the _burnTokenFrom function, the actual amount of tokens received by the contract will be less than the amount.
Proof of Concept
Recommended Mitigation Steps
Consider getting the received amount by calculating the difference of token balance (using balanceOf) before and after the transferFrom.
deluca-mike (Axelar) confirmed and commented:
Valid for
TokenType.External, since it is a token implementation that is not ours, and thus could actually transfer us less than expected due to fees.Keep in mind that, in the case of a malicious token contract, it could also lie about the
balanceOf.In any case, if and when we wanted to accept fee-on-transfer tokens in the gateway, we might need to implement the recommended mitigation steps; however, it is not that simple because the is not link (on-chain) here that ensure the amount the gateway burns to be equal to the amount the gateway/validators mint elsewhere. Knowing the actual amount burned is not critical to the source gateway, but rather to the validators that will need to create the mint command elsewhere.
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 uses the transfer amount instead of checking the actual balance difference, so fee-on-transfer tokens cause a mismatch.
Impact
Could lead to unbacked minting on other chains if fee-on-transfer tokens are accepted, though the report notes it is not critical for the source gateway and may not be simple to fix.
What the attacker needed
Fee-on-transfer token; gateway accepts external tokens
The fix
The contract should calculate the received amount by comparing the token balance before and after the transfer.
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 fee when transferred, so the receiver gets less than the sender sent. The contract didn't check the actual balance change, so it thought it received more than it did. This could let someone create tokens on another chain without the proper backing.
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.