Skip to content
Business logic Audit finding Intermediate

Malicious pool deployer can set a malicious interest rate contract to lock funds of vault depositors

A2-security Follow with Obsidian and iamnmt

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2024-06-new-scope-judging/issues/233

Found by

A2-security, Obsidian, iamnmt

Summary

Once vault depositors have deposited funds into a pool, a malicious pool creator can upgrade the interestRateStrategy contract (using PoolConfigurator.setReserveInterestRateStrategyAddress() to make all calls to it revert.

As a result any function of the protocol that calls updateInterestRates() will revert because updateInterestRates() makes the following call:

Solidity
(vars.nextLiquidityRate, vars.nextBorrowRate) = IReserveInterestRateStrategy(_reserve.interestRateStrategyAddress)
      .calculateInterestRates(
      /* PARAMS */
    );

The main impact is that now withdrawals will revert because executeWithdraw() calls updateInterestRates() which will always revert, so the funds that vault users deposited into this pool are lost forever.

Root Cause

Allowing the pool deployer to specify any interestRateStrategyAddress

Internal pre-conditions

No response

External pre-conditions

No response

Attack Path

  1. Vault users deposit into the pool
  2. the deployer sets their interestRateStrategy contract to make all calls to it revert
  3. All calls to withdraw funds from the pool will revert, the vault depositors have lost their funds

Impact

All the funds deposited to the pool from the vault will be lost

PoC

No response

Mitigation

Use protocol whitelisted interest rate calculation contracts

Discussion

nevillehuang

Invalid, require malicious admin

Essentially we expect all permissioned actors to behave rationally.

iamnmt

Escalate

Per the contest's README

There are two set of actors. Actors who manage pools and actors who mange vaults. If an action done by one party causes the other party to suffer losses we'd want to consider that.

This statement makes this issue valid.

sherlock-admin3

Escalate

Per the contest's README

There are two set of actors. Actors who manage pools and actors who mange vaults. If an action done by one party causes the other party to suffer losses we'd want to consider that.

This statement makes this issue valid.

You've created a valid escalation!

To remove the escalation from consideration: Delete your comment.

You may delete or edit your escalation comment anytime before the 48-hour escalation window closes. After that, the escalation becomes final.

zarkk01

IMO, the issue is invalid due to this statement of the sponsor.

Essentially we expect all permissioned actors to behave rationally.

It is, absolutely, irrational for a deployer to set a malicious interest rate contract since he has nothing to earn out of this behaviour.

0xSpearmint

The permissioned actors the protocol refers to are the protocol controlled PoolConfigurator and owner roles. They can be expected to act rationally.

This issue involves a malicious pool deployer (which can be anyone).

Deploying pools is permission-less, which is why the protocol was interested in such issues as they clearly stated in the README:

There are two set of actors. Actors who manage pools and actors who mange vaults. If an action done by one party causes the other party to suffer losses we'd want to consider that.

cvetanovv

I agree with the escalation of this issue to be High severity. For more information on what I think about the rule, you can see this comment: https://github.com/sherlock-audit/2024-06-new-scope-judging/issues/234#issuecomment-2413297520

Planning to accept the escalation and make this issue High severity.

WangSecurity

Result: High Has duplicates

sherlock-admin2

Escalations have been resolved successfully!

Escalation status:

DemoreXTess

@cvetanovv Can we reconsider this issue per this comment : https://github.com/sherlock-audit/2024-06-new-scope-judging/issues/234#issuecomment-2427578837_

The report wrongly states that the funds are locked forever. ZeroLend has permission to make changes on the pools. Users can get back their funds after adjustment by ZeroLend

0xSpearmint

The referenced comment is not accurate.

Even if the protocol sets a new IRM through this only configurator function, the pool admin can instantly change it back to the malicious IRM using this only pool admin function.

cvetanovv

I agree with @0xSpearmint comment. Even if ZeroLend makes any changes, the malicious pool admin can immediately roll back the previous configuration.

DemoreXTess

@cvetanovv
Is there a problem in this one, it says escalation resolved with has duplicates but the label is not added.

cvetanovv

@DemoreXTess That's not a problem. The labels of duplicate issues will be added after all escalations are resolved.

Joshuajee

@cvetanovv and @WangSecurity ,

Sorry, this might be coming late, but I don't believe that this issue meets the criteria of becoming a High because;

  1. It relies on the pool deployer becoming Malicious, what are the chances?
  2. It also relies on the vault managers not doing their due diligence on checking if the pool's strategy is indeed safe.
  3. Vault Managers are risk managers and should do their thorough checks on every pool, including oracles and strategy contracts before adding such.

The whole reason for validating this is that the pool deployer can hurt the vault manager, but the vault manager should be rational enough to check the rate strategy contract, before trusting a pool.

cvetanovv

@cvetanovv and @WangSecurity ,

Sorry, this might be coming late, but I don't believe that this issue meets the criteria of becoming a High because;

  1. It relies on the pool deployer becoming Malicious, what are the chances?
  2. It also relies on the vault managers not doing their due diligence on checking if the pool's strategy is indeed safe.
  3. Vault Managers are risk managers and should do their thorough checks on every pool, including oracles and strategy contracts before adding such.

The whole reason for validating this is that the pool deployer can hurt the vault manager, but the vault manager should be rational enough to check the rate strategy contract, before trusting a pool.

  1. The pool deployer does not need to become malicious. He is malicious by default if it can hurt the Vault.
  2. I agree here, and every Vault Manager should do their own checking, but it doesn't matter because, at any time, he can change the interest rate because he is malicious.
  3. Same as point 2. They are malicious by default, and even if the vault managers do the best check, the pool manager can increase the interest rate at any time.

Joshuajee

@cvetanovv,

I agree you are totally right here.

I think that my earlier complaint only affects https://github.com/sherlock-audit/2024-06-new-scope-judging/issues/234

Because oracles can not be changed after deployment

The original report as published on Sherlock, by A2-security. Images and videos are our own copies; raw HTML is shown as text. View it on Sherlock.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

What is known

A high-severity business logic bug in ZeroLend One. Sherlock made it public on 4 October 2024. Found in the 466 audit contest (finding H-6), also found by 2 other wardens.

About Business logic

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

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 A2-security

View all

8 more disclosed reports, best first.

More from ZeroLend One

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.