# Not decreasing oracle timestamp validation leads to DoS for protocol users

Velar Artha's oracle.vy requires non-decreasing RedStone price timestamps, so a newer-timestamp tx reverts all pending txs carrying slightly older valid price data.

- Payout: Audit contest
- Severity: medium
- Program: Velar Artha
- Found by: KupiaSec
- Disclosed: 2024-08-22
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2024-08-velar-artha-judging/issues/79
- Library page: https://bugbountylibrary.com/r/sherlock%3A2024-08-velar-artha%3AM-5
- Tags: area:web3 domain:web3 impact:dos kind:contest platform:sherlock sev:medium tech:solidity technique:source-review vuln:dos vuln:oracle-manipulation

**Target:** Vyper oracle contract consuming RedStone calldata payloads
**Root cause:** oracle.vy asserts the extracted RedStone price timestamp is >= the stored TIMESTAMP and then overwrites it, enforcing monotonic timestamps across all users even though RedStone permits prices from 3 minutes old up to 1 minute in the future.
**Steps:**
1. User A fetches RedStone payload at T1, user B at T2, user C at T3 with T3>T2>T1, all within RedStone's validity window (3 minutes old to 1 minute future).
2. Each attaches the payload as calldata to their Velar Artha call.
3. If the T3 tx lands first, `assert ts >= self.TIMESTAMP` in `extract_price` reverts the T1 and T2 txs; if T2 lands first, T1 reverts.
4. Attacker can repeatedly submit newest-timestamp payloads to keep reverting other users' slightly older but valid payloads.
**How found:** Code review of oracle.vy's `extract_price`; noticed the monotonic timestamp assertion conflicts with RedStone's documented 3-minute-old price tolerance, then reasoned about concurrent users fetching payloads at different times.
**Exploitation:** Griefing: an attacker (or simply any faster user) submits a transaction with the freshest RedStone payload, advancing the stored TIMESTAMP and causing all in-flight transactions carrying older-but-valid timestamps to revert. No capital needed; repeatable each block.
**Insight:** When a contract stores a monotonic oracle timestamp from user-supplied calldata, compare it against RedStone's own validity window instead: any user can advance the stored value and grief everyone else's still-valid payloads.

## Proof of concept (copied exactly from the original report)

**Oracle timestamp non-decreasing assertion**

```
# Redstone allows prices ~10 seconds old, discourage replay attacks
  assert ts >= self.TIMESTAMP, "ERR_ORACLE"
  self.TIMESTAMP = ts
```

