Skip to content

Instantly share code, notes, and snippets.

View 0xhexrecon's full-sized avatar

0xrecon 0xhexrecon

View GitHub Profile
@0xhexrecon
0xhexrecon / poc-oracle-staleness.test.ts
Created April 4, 2026 11:05
Granite Protocol — Oracle Staleness PoC (10 tests: AV1 wrongful liquidation + AV2 overborrow + WHALE tests using real aeUSDC market position)
/**
* PoC: Oracle Staleness — Attacker Guarantees Stale Price via `none` VAA
*
* VULNERABILITY:
* All oracle-reading functions (borrow, remove-collateral, liquidate-collateral)
* accept pyth-price-feed-data as (optional (buff 8192)). Passing `none` is
* explicitly a no-op in update-pyth() — it returns SUCCESS immediately WITHOUT
* touching oracle storage. The subsequent read-price() call then uses whatever
* stale price is in storage.
*