Skip to content
Smart contracts Audit finding Intermediate

Call to non-existing contracts returns success

Low-level calls in the LiquidityFarming contract return success even when the target address has no deployed contract, so funds sent to such an address are lost. An owner or executor could accidentally send rewards or tokens to a non-existent address and the transaction would not revert.

CertoraInc Follow

Originally disclosed on Code4rena

Submitted by CertoraInc, also found by kenta and wuwe1

LiquidityFarming.sol#L140 LiquidityFarming.sol#L145 LiquidityFarming.sol#L187

Low level calls (call, delegate call and static call) return success if the called contract doesn’t exist (not deployed or destructed).

This makes a user be able to send his funds to non-existing addresses.

LiquidityFarming reclaimTokens - if the owner calls by accident with a non-existing address he’ll lose the funds. _sendRewardsForNft - if the withdraw or extractRewards will be called with a to non-existing address, the funds will be lost. That’s because of the call to _sendRewardsForNft which contains a low level call to the to address.

sendFundsToUser - if an executor calls by accident with a non-existing address the funds will be lost. transfer - if the transfer function will be called (by the LiquidityProvidors contract of course) with a non existing address as a receiver, the funds will be lost.

This can be seen here https://github.com/Uniswap/v3-core/blob/main/audits/tob/audit.pdf (report #9) and here https://docs.soliditylang.org/en/develop/control-structures.html#error-handling-assert-require-revert-and-exceptions

ankurdubey521 (Biconomy) confirmed and commented:

HP-25: C4 Audit Fixes, Dynamic Fee Changes bcnmy/hyphen-contract#42

pauliax (judge) commented:

I am hesitating if this should be with the severity of Medium or Low but leaving in favor of wardens this time. I believe checking against empty addresses is not enough, low-level calls return true even for non-empty but not valid addresses. It would be better to use interfaces if possible.


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

Likely the code uses low-level calls without checking that the target address actually contains a deployed contract, so a call to an empty address still returns success.

Impact

Funds could be permanently lost if an owner or executor accidentally passes a non-existent address to reclaimTokens, _sendRewardsForNft, sendFundsToUser or transfer.

What the attacker needed

Owner or executor passes a wrong address; target address has no deployed contract

The fix

The code should check that the target address holds a contract, for example by using interfaces rather than raw low-level calls, and the project confirmed a fix in a pull request.

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.

A smart contract can send funds to another address using a low-level call. Normally you would expect that call to fail if nothing is there, but in Solidity it reports success anyway. That means money can be sent into an address where no contract exists, and it cannot be recovered.

What is Smart contracts?

Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.

More by CertoraInc

View all

16 more disclosed reports, best first.

More from Biconomy - Smart Contract Wallet contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Smart contract vulnerabilities

The lesson behind this report.

Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.