Risks of Non-Standard ERC-20 Tokens

Non-standard ERC-20 tokens hide flaws in transferFrom allowance logic and reentrancy paths that let attackers drain far more than authorized.

SECURITY4 min readBy AlgoSys Editorial TeamPublished Apr 24, 2026Updated Jun 26, 2026
Contents

Many ERC-20 tokens deviate from the standard interface, and every such deviation creates its own risks. Sometimes this is simply a developer oversight, and sometimes it is a deliberate trap written with the express purpose of draining user funds. Non-standard tokens are so widespread that every new contract is worth checking before you do anything with it at all.

High-profile incidents make the seriousness of the problem clear. The Ronin Bridge hack in 2022 was primarily a bridge exploit, but it also involved custom token logic. The Multichain exploit in 2023 showed the same thing from a different angle: attackers targeted the complex, non-standard mechanisms of the bridge.

The attacker's reasoning is straightforward. Non-standard implementations are specifically targeted because they bypass the usual security checks that are designed for standard code. Everyone who interacts with decentralized applications (dApps, applications without a central operator) or simply holds tokens in a wallet is at risk. Understanding these risks is therefore important for everyone who participates in the DeFi ecosystem.

MECHANICS

A non-standard ERC-20 token may be missing required functions, or it may have them but with unexpected behavior. For example, the contract might lack a transfer function, or approve might be implemented in a way that allows double spending, where the same amount can be spent twice.

Attackers exploit these deviations in various ways. One common vector involves manipulating the transferFrom function, which is supposed to respect the granted allowance. If a token's transferFrom does not properly check or decrement the allowance, an attacker can transfer an amount exceeding the authorized limit.

The second mechanism involves a reentrancy vulnerability in custom token logic. If the contract calls external contracts before updating its own internal state, an attacker can trigger a recursive call and drain the contract's entire balance. This technique was behind many early DeFi exploits.

RED FLAGS

The primary signal is hidden in the source code. When reviewing a contract, look for deviations from the standard ERC-20 interface and verify that the required functions transfer, approve, and transferFrom are implemented the way you would expect. Beyond the code itself, there are smaller details that are easy to miss but also point to risk.

Here is what to check first:

  • The decimals value: an unexpected number of decimal places may indicate manipulation or a bug that breaks price calculations.
  • Event logs: verify that the contract correctly emits the standard Transfer and Approval events; their absence or strange duplicates are a bad sign.
  • Upgradeability: assess whether the contract is upgradeable; proxy patterns (schemes that allow replacing the contract's logic) introduce new attack vectors if they are not managed securely.
  • Creator and deployer addresses: examine their history for suspicious activity or connections to known malicious actors.

Keep block explorers and security analysis tools handy: they surface known vulnerabilities and red flags tied to a specific contract.

To make it clearer how a single deviation changes the picture, compare the behavior of a legitimate and a tampered transferFrom with a simple numerical example. Suppose you have granted a dApp an allowance of 100 tokens and your balance is 1,000.

transferFrom behavior What happens when tokens are transferred
Standard (legitimate) At most 100 tokens are transferred; allowance is reduced to 0
Tampered (malicious) All 1,000 tokens are transferred; the 100-token limit is ignored

The difference of one line of code translates into a difference of 900 tokens, which is exactly why verifying a function against the reference matters more than trusting the token's name.

PROTECTION

The baseline rule: always verify the contract against the ERC-20 standard using reputable audit tools. OpenZeppelin's ERC20 contract template, which the majority of reputable projects build on, provides a solid and secure foundation.

Prioritize tokens that have undergone a professional audit from a well-known firm. Do not stop at the fact of an audit: read the report to see what was found and whether it was fixed. When working with a dApp, separately confirm that the platform itself has strong security practices and that it vets the tokens it supports rather than accepting any contract indiscriminately.

Store significant amounts on hardware wallets. Before final confirmation, review the transaction details directly on the device screen, paying particular attention to what function is being called and with what parameters: this is where substitution most often hides.

AFTERMATH

The first and most urgent step is to contain the leak by revoking any token approvals granted to potentially compromised contracts or addresses. This can be done by calling approve(spender, 0) for the relevant token, or through a service that manages approvals and displays them as a list.

Next, report the incident. Notify the platform or exchange where the token was traded, and contact blockchain security firms such as Chainalysis or PeckShield. The more detailed the transaction data you provide, the better the chances that the investigation will move forward.

Recovering funds is a separate and difficult matter. Community-driven initiatives, legal action against the perpetrators if they can be identified, and law enforcement are all options. Direct recovery of money is rare, but even when it is not possible, your reports help track the attackers and prevent the next attack.

FAQ

What makes an ERC-20 token non-standard?

A token is considered non-standard when it deviates from the ERC-20 interface specification. This can take different forms: the contract may be missing required functions, familiar functions may behave with altered logic, or new functions outside the standard may have been added that introduce their own vulnerabilities.

Can ordinary ERC-20 tokens be unsafe?

Yes. The ERC-20 standard provides a baseline level of predictability, but even a formally standard token is vulnerable if its internal logic contains a bug, or if it is embedded in a larger compromised system such as a flawed DeFi protocol or a bridge.

How can I check whether a token contract is non-standard?

Open the contract source code on a block explorer like Etherscan and compare its functions against the ERC-20 standard. Security analysis tools and audit reports give additional insight: they show how closely the token conforms to the standard and what risks were found.

What is an allowance and why do so many attacks revolve around it?

An allowance specifies the amount that one address is permitted to transfer from your balance via the transferFrom function. Attacks center on it because many users grant unlimited or inflated allowances to dApps and then forget about them, and if transferFrom is written with a bug an attacker can transfer more than the permitted amount.

What is a reentrancy attack?

This is a situation where a contract calls an external contract before updating its own internal state. An attacker intercepts that call and recursively invokes the same function again and again, draining the balance while the contract still believes the funds are in place. This technique was behind many early DeFi exploits.

How do I revoke a dangerous token approval?

The most direct way is to call approve(spender, 0) for the relevant token, setting the allowance for that specific address to zero. If you have many approvals outstanding, it is more convenient to use an approval management service that lists all active allowances and lets you revoke them in a couple of clicks.

Put this to work in the terminal

Live charts, derivatives, on-chain and macro data, free.

Open terminal →