Skip to content
Business logic Audit finding Beginner

Safe addresses can only be added but not removed

The smart contract allows adding addresses to a safe list but provides no function to remove them. If a safe-listed address later becomes malicious, the protocol cannot revoke its exemption from flash loan protections, potentially enabling a flash loan attack.

0xRajeev Follow

Originally disclosed on Code4rena

Submitted by 0xRajeev, also found by pauliax

The addSafeAddress() takes an address and adds it to a “safe list”. This is used in eoaOnly() to give exemption to safe addresses that are trusted smart contracts, when all other smart contacts are prevented from protocol interaction. The stated purpose is to allow only such partner/trusted smart contract integrations (project rep mentioned Argent wallet as the only one for now but that may change) an exemption from potential flash loan threats. But if there is a safe listed integration that needs to be later disabled, it cannot be done. The protocol will have to rely on other measures (outside the scope of this contest) to prevent flash loan manipulations which are specified as an area of critical concern.

Scenario: A trusted integration/partner address is added to the safe list. But that wallet/protocol/DApp is later manipulated (by the project, its users or an attacker) to somehow launch a flash loan attack on the protocol. However, its address cannot be removed from the safe list and the protocol cannot prevent flash loan manipulations from that source because of its exemption. Contract/project will have to be redeployed.

Recommend changing addSafeAddress() to isSafeAddress() with an additional bool parameter to allow both the enabling AND disabling of safe addresses.

kristian-gro (Gro) confirmed but disagreed with severity:

low risk - Made specifically for one partner in beta period, and planned to be removed. We added the removal function for sanity.

Confirmed and Fix has been implemented in release version.

ghoul-sol (Judge) commented:

I’ll keep medium risk because this could put the protocol into a one way street and not being able to remove safe addresses is quite dangerous. Medium risk.

The original report as published on Code4rena, by 0xRajeev. 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 contract only implements a function to add safe addresses, with no corresponding function to remove them.

Impact

A safe-listed address that is later compromised or turned malicious cannot be removed, so the protocol cannot prevent flash loan manipulations from that source and may need to be redeployed.

What the attacker needed

A safe address is added; that address later becomes malicious

The fix

The function should be changed to allow both enabling and disabling of safe addresses, and the project confirmed a fix was implemented.

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 keeps a list of trusted addresses that are allowed to interact with it without extra checks. The problem is that once an address is added, there is no way to take it off the list. If that address later turns bad, the contract cannot stop it from doing harmful things.

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 0xRajeev

View all

61 more disclosed reports, best first.

More from Gro Protocol

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.