Skip to content
Business logic Audit finding Advanced

`Strategy::checkPoolActivity()` incorrect check leads to vulnerable price

0x73696d616f Follow

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2025-02-yieldoor-judging/issues/96

Found by

0x73696d616f

Summary

Strategy::checkPoolActivity() reverts if the timestamp is 0. However, this will never happen. What actually happens is the timestamp being 1, when the cardinality has been increased and the tick timestamp was set to 1 for gas saving purposes.

When this tick is hit in the loop, it means there were not enough observations to reach the lookAgo timestamp and it should revert because the price could not be validated. However, if the timestamp is 1, it may not revert depending on the value of the tick delta calculated, and as the timestamp is 1, it will return true with an invalid price observation.

Root Cause

In Strategy:322, the timestamp check is incorrect.

Internal Pre-conditions

None.

External Pre-conditions

None.

Attack Path

  1. Twap would not have enough credibility and rebalancing would be impossible.
  2. Attacker or user adds cardinality to the uniswap pool, which sets the next ticks timestamp to 1.
  3. Rebalance goes through with an invalid price with not enough validation, leading to depositing liquidity at a bad price and causing losses for users.

Impact

Loss of funds due to depositing liquidity at an unfavourable price.

PoC

The following function is used when cardinality is increased in the pool.

Solidity
    function grow(
        Observation[65535] storage self,
        uint16 current,
        uint16 next
    ) internal returns (uint16) {
        require(current > 0, 'I');
        // no-op if the passed next value isn't greater than the current next value
        if (next <= current) return current;
        // store in each slot to prevent fresh SSTOREs in swaps
        // this data will not be used because the initialized boolean is still false
        for (uint16 i = current; i < next; i++) self[i].blockTimestamp = 1;
        return next;
    }

Mitigation

Solidity
            if (timestamp == 1) {
                revert("timestamp 1");
            }

The original report as published on Sherlock, by 0x73696d616f. 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 medium-severity business logic bug in Yieldoor. Sherlock made it public on 17 March 2025. Found in the 791 audit contest (finding M-4).

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

View all

172 more disclosed reports, best first.

More from Yieldoor

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.