Skip to content
Business logic Audit finding Intermediate

Flash loan risk mitigation is optional and not robust enough

The protocol's protection against flash loan attacks is optional and can be disabled by the owner, allowing smart contracts to interact and potentially exploit vulnerabilities. The report recommends a more robust mitigation such as limiting transactions per block.

0xRajeev Follow

Originally disclosed on Code4rena

Submitted by 0xRajeev

The switchEoaOnly() allows the owner to disable preventSmartContracts (the project’s plan apparently is to do so after the beta-period) which will allow any smart contract to interact with the protocol and potentially exploit any underlying flash loan vulnerabilities which are specified as an area of critical concern.

The current mitigation is to optionally prevent contracts, except whitelisted partner ones, from interacting with the protocol to prevent any flash loan manipulations. A more robust approach would be to add logic preventing multiple txs to the protocol from the same address/tx.origin within the same block when smart contracts are allowed. This will avoid any reliance on trust with integrating partners/protocols.

Recommend adding logic that prevents multiple txs to the protocol from the same address and within the same block.

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

Low-severity: This is a temporary blocker to not let SCs interact with gro-protocol, planned to be removed after beta as it might potentially stop other integrations (as per issue 51)

Acknowledged, this is just a temporary block, and is planned to be removed in future releases - other protection exists to protect the system from flash loan manipulations.

ghoul-sol (Judge) commented:

It looks like a low risk issue since it’s a future problem and not something that is an immediate issue, however, it’s not clear how the protocol will protect itself against flash loans after this temporary blocker is off. One of the critical protocol’s concerns are flash loans manipulations therefore I think medium risk is justified here.

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

Likely the reliance on an optional, owner-controlled switch to block smart contracts, without a robust on-chain mechanism to prevent flash loan manipulations.

Impact

If the switch is disabled, any smart contract could interact and potentially exploit flash loan vulnerabilities, though the report notes this is a future concern and other protections may exist.

What the attacker needed

Owner disables preventSmartContracts; smart contract interacts with protocol

The fix

The report recommends adding logic to prevent multiple transactions from the same address within the same block when smart contracts are allowed.

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.

Flash loans are large, instant loans that must be repaid in the same transaction. Attackers can use them to manipulate prices or exploit logic flaws. This report says the project's only defence is a switch that can be turned off, leaving the system open to such attacks.

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.