Skip to content
This repository has been archived by the owner on Dec 17, 2023. It is now read-only.

Madalad - Missing check if Chainlink sequencer is down #317

Closed
sherlock-admin opened this issue Jun 11, 2023 · 0 comments
Closed

Madalad - Missing check if Chainlink sequencer is down #317

sherlock-admin opened this issue Jun 11, 2023 · 0 comments
Labels
Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label Medium A valid Medium severity issue Reward A payout will be made for this issue

Comments

@sherlock-admin
Copy link
Contributor

sherlock-admin commented Jun 11, 2023

Madalad

medium

Missing check if Chainlink sequencer is down

Summary

When utilizing Chainlink in L2 chains like Arbitrum or Optimism, it's important
to ensure that the prices provided are not falsely perceived as fresh, even
when the sequencer is down (source).

Vulnerability Detail

If the sequencer goes down, the oracle may return stale prices since L2-submitted transactions will not be processed.

Impact

If the price oracle retrieves an incorrect price, this could lead to unexpected behaviour throughout the protocol, such as undercollateralized loans or unfair liquidations, causing loss of funds.

Code Snippet

    function getPriceFromChainlink(address base, address quote) internal view returns (uint256) {
        (, int256 price,,,) = registry.latestRoundData(base, quote); // @audit missing check on timestamp
        require(price > 0, "invalid price");

        // Extend the decimals to 1e18.
        return uint256(price) * 10 ** (18 - uint256(registry.decimals(base, quote)));
    }

https://github.com/sherlock-audit/2023-05-ironbank/blob/main/ib-v2/src/protocol/oracle/PriceOracle.sol#L67

Tool used

Manual Review

Recommendation

Determine whether the sequencer is offline or not when attempting to retrieve a price from a Chainlink data feed.

Duplicate of #440

@github-actions github-actions bot added Medium A valid Medium severity issue Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label labels Jun 19, 2023
@sherlock-admin sherlock-admin added the Reward A payout will be made for this issue label Jun 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label Medium A valid Medium severity issue Reward A payout will be made for this issue
Projects
None yet
Development

No branches or pull requests

1 participant