# Current heartbeat implementation may lead to a prolonged DoS for Chainlink Oracles

Wise Lending's recalibrate sets Chainlink heartbeat to second-largest gap of last 50 updates, letting anyone force oracle to be flagged dead and DoS the market.

- Payout: Contest reward
- Severity: medium
- Program: Wise Lending
- Credited: 00xSEV
- Disclosed: 2024-05-03
- Write-up quality: 6/10
- Original: https://github.com/code-423n4/2024-02-wise-lending-findings/issues/87
- Library page: https://bugbountylibrary.com/r/c4%3A2024-02-wise-lending%3AM-14
- Tags: domain:web3 impact:dos impact:funds-loss kind:contest platform:code4rena sev:medium tech:evm tech:solidity technique:source-review vuln:access-control vuln:dos vuln:oracle-manipulation

**Target:** WiseOracleHub OracleHelper Chainlink price feed wrapper
**Root cause:** heartBeat is derived from the second-largest time gap among the last 50 Chainlink updates; after a burst of fast updates followed by calm, this yields a tiny heartbeat so _chainLinkIsDead returns true during normal inactivity.
**Steps:**
1. Fork mainnet at a block where FEI/ETH feed had 50 rapid updates then a long gap.
2. Deploy OracleHelperMock, addOracle(FEI, FEI_ETH_FEED), call recalibrate(FEI).
3. recalibrate sets heartBeat[FEI] to the second-largest gap (~1 minute).
4. Advance to a block ~24h after last update; chainLinkIsDead(FEI) returns true, reverting all oracle reads.
**How found:** Read _recalibratePreview and noticed heartBeat equals second-largest inter-update gap; reasoned that Chainlink's deviation-triggered bursts followed by calm produce a tiny heartbeat, then validated with a mainnet fork PoC.
**Exploitation:** Attacker calls permissionless recalibrate() during a high-volatility burst so heartBeat becomes ~1 minute; once updates slow, every price read reverts, blocking liquidations, deposits and withdrawals across the market until Chainlink updates again.
**Escalation:** Combined with block stuffing or high gas prices delaying Chainlink updates, the dead window lengthens, accruing bad debt and griefing users.
**Insight:** When a protocol derives liveness thresholds from historical update gaps, check whether bursty-but-legitimate update patterns (deviation-triggered oracles) collapse the threshold and let anyone trigger a DoS via the permissionless recalibration path.
