You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Insufficient checks to confirm the correct status of sequencerUptimeFeed in DebitaChainlink.sol
Summary
The missing check for a 0 value in sequencerUptimeFeed.startedAt will cause inaccurate sequencer status validation for the Debita platform as getThePrice() will pass incorrectly when startedAt is 0 and answer is also 0, failing to validate the sequencer status effectively.
Root Cause
In DebitaChainlink.sol:61, the lack of a startedAt != 0 check in checkSequencer() fails to confirm an updated sequencer status during invalid rounds.
Making sure startedAt isn't 0 is crucial for keeping the system secure and properly informed about the sequencer's status.
Internal pre-conditions
checkSequencer() to be called within getThePrice().
sequencerUptimeFeed to have both answer and startedAt set to 0.
External pre-conditions
experiencing a brief downtime with delayed updates in Chainlink's L2 uptime feed.
Invalid round leading to a startedAt value of 0.
Attack Path
The sequencer feed returns answer == 0 and startedAt == 0 due to invalid round.
checkSequencer() executes without startedAt check, passing verification even though sequencer status is unconfirmed.
Impact
Debita suffers an approximate security vulnerability, as the contract mistakenly assumes sequencer uptime, exposing protocol to outdated or incorrect oracle data.
Add a require(startedAt != 0, "Invalid sequencer status"); check in checkSequencer().
DebitaChainlink.sol
DebitaChainlink.sol
function checkSequencer() public view returns (bool) {
(, int256 answer, uint256 startedAt, , ) = sequencerUptimeFeed.latestRoundData();
// Check if the sequencer is up
bool isSequencerUp = answer == 0;
if (!isSequencerUp) {
revert SequencerDown();
}
+ // Ensure that startedAt is valid and non-zero+ require(startedAt != 0, "Invalid sequencer status");
// Calculate the time since the sequencer came back up
uint256 timeSinceUp = block.timestamp - startedAt;
if (timeSinceUp <= GRACE_PERIOD_TIME) {
revert GracePeriodNotOver();
}
return true;
}
The text was updated successfully, but these errors were encountered:
sherlock-admin3
changed the title
Silly Flaxen Goose - Insufficient checks to confirm the correct status of sequencerUptimeFeed in DebitaChainlink.sol
0xmujahid002 - Insufficient checks to confirm the correct status of sequencerUptimeFeed in DebitaChainlink.solDec 12, 2024
0xmujahid002
High
Insufficient checks to confirm the correct status of
sequencerUptimeFeed
inDebitaChainlink.sol
Summary
The missing check for a
0
value insequencerUptimeFeed.startedAt
will cause inaccurate sequencer status validation for the Debita platform asgetThePrice()
will pass incorrectly whenstartedAt
is0
and answer is also0
, failing to validate the sequencer status effectively.Root Cause
In DebitaChainlink.sol:61, the lack of a
startedAt != 0
check incheckSequencer()
fails to confirm an updated sequencer status during invalid rounds.Making sure
startedAt
isn't0
is crucial for keeping the system secure and properly informed about the sequencer's status.Internal pre-conditions
checkSequencer()
to be called withingetThePrice()
.sequencerUptimeFeed
to have both answer andstartedAt
set to0
.External pre-conditions
startedAt
value of 0.Attack Path
answer == 0
andstartedAt == 0
due to invalid round.checkSequencer()
executes withoutstartedAt
check, passing verification even though sequencer status is unconfirmed.Impact
Debita suffers an approximate security vulnerability, as the contract mistakenly assumes sequencer uptime, exposing protocol to outdated or incorrect oracle data.
FYR: Chainlink smartcontractkit/documentation#1995
PoC
A recent pull request to update the chainlink docs
Mitigation
Add a
require(startedAt != 0, "Invalid sequencer status");
check incheckSequencer()
.DebitaChainlink.sol
The text was updated successfully, but these errors were encountered: