Skip to content
Business logic Audit finding Intermediate

Some rewards from POL will not be send to team wallet nor burned

When the DAO's POL is withdrawn during upkeep, the rewards earned are sent to the DAO but not distributed to the team wallet or burned as intended. An attacker could cause some rewards to be stuck, preventing the team from receiving its share and reducing the burn.

0xRobocop Follow with klau5

Originally disclosed on Code4rena

Submitted by 0xRobocop, also found by klau5

The rewards earned from the DAOs POL are distributed among the team wallet, then part of the remaining rewards are burned and the rest are kept as DAOs balance.

The issue, is that is possible for the DAO to claim SALT rewards without sending the team’s share to the team wallet and without burning the amount that should be burned.

Proof of Concept

The first step during the upkeep functionality is to perform the upkeep on the liquidizer contract.

https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/Upkeep.sol#L107

During that, if the amount of USDS to be burned is greater than the current balance of the liquidizer contract, then the code will withdraw some POL from the usds/dai and usds/salt pools:

https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/stable/Liquidizer.sol#L123-L124

When removing liquidity, the code will decrease the dao’s share and in doing so it will send to it some rewards proportional to the amount of shares decreased:

https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/staking/StakingRewards.sol#L136-L137

It is important note that pool rewards do not necessary comes from the emitter, but they can be added by third party protocols via the addRewards function in the StakingRewards contract:

https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/staking/StakingRewards.sol#L182

Recommended Mitigation Steps

Two options:

  • Save the amount of rewards received when withdrawing some POL, so they can be distributed and burned.
  • Make the call to claim all the rewards at the beginning of upkeep.

Picodes (Judge) commented:

This report shows how in some cases some rewards may end up being stuck when withdrawing PoL.

othernet-global (Salty.IO) acknowledged and commented:

POL has been removed from the protocol:

eaf40ef0fa27314c6e674db6830990df68e5d70e https://github.com/othernet-global/salty-io/commit/8e3231d3f444e9851881d642d6dd03021fade5ed

Status: Mitigation confirmed. Full details in reports from t0x1c, zzebra83, and 0xpiken.


The original report as published on Code4rena, by 0xRobocop. 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 upkeep process does not account for rewards received when withdrawing POL, so those rewards are not distributed to the team or burned.

Impact

Some rewards may end up stuck, so the team does not receive its share and the intended burn is reduced.

What the attacker needed

None

The fix

The protocol removed POL from the protocol, which mitigates the issue.

How it was found

  1. During upkeep, the liquidizer contract checks if the USDS to burn exceeds its balance.
  2. If so, it withdraws POL from the USDS/DAI and USDS/SALT pools.
  3. Withdrawing POL decreases the DAO's share and sends rewards to the DAO.
  4. These rewards are not distributed to the team wallet or burned.

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.

The DAO earns rewards from its own liquidity (POL). Normally, part of these rewards goes to the team and part is burned. This report shows that when the DAO withdraws some of its liquidity, the rewards it receives are not processed correctly, so the team misses out and less is burned.

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

View all

15 more disclosed reports, best first.

More from Salty.IO

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.