Reproduced Exploit
Xyro UpDown — a late report refunds the loser and the winner only gets their stake
Two hours after the end, the report still on hand is 30 minutes old. It is more than 10 minutes after endTime and more than 10 minutes before the current block, so both clauses of the freshness check fail and finalizeGame reverts. The game master refunds every player, including the side that lost.…
Chain
Other
Category
oracle
Date
Aug 2024
Source
AuditVault
EVM Playground
Source-level debugger — step opcodes and Solidity in sync
The attack is replayed in an in-browser EVM preloaded with the exact dumped fork state. The execution tree shows every call; step by Solidity line or by opcode across all depths — source, Stack, Memory, Storage, Balances (native / ERC-20 / NFT), Transient storage and Return value stay in sync. Click a tree node, opcode, or source line to jump. Query opens a search over the trace: previous and next writes, balance changes and calls, breakpoints, and a diff of everything that changed between two steps. No backend, no live RPC.
Source & credit. Reproduction of a public audit finding curated by AuditVault — the original finding: 45672-finalizing-a-game-after-10-minutes-will-lock-users-earned-fu. Standalone Foundry PoC and full write-up: 45672-finalizing-a-game-after-10-minutes-will-lock-users-earned-fu_exp in the
evm-hack-registrymirror.
Vulnerability classes:
vuln/oracle/stale-price·vuln/logic/wrong-condition
Key info#
| Protocol | Xyro UpDown |
| Finding | Zokyo, AuditVault 45672 |
| Vulnerable code | finalizeGame freshness require |
| Harm | Down is refunded 100. The end-time report pays up 200 on the control. |
| Chain | local synthetic |
TL;DR#
Two hours after the end, the report still on hand is 30 minutes old. It is more than 10 minutes after endTime and more than 10 minutes before the current block, so both clauses of the freshness check fail and finalizeGame reverts. The game master refunds every player, including the side that lost. The true winner gets their 100 stake back, not the 200 pot. Submitting the report from endTime itself still pays the winner 200.
The vulnerable code#
require(
priceTimestamp - endTime <= 10 minutes || block.timestamp - priceTimestamp <= 10 minutes,
"Old chainlink report"
);
A report timestamp equal to endTime still passes the first clause at any later block. A report that is merely "recent" does not, once it is more than 10 minutes after the end and more than 10 minutes old.
Root cause#
The check is an OR of two windows. It does not mean "you may finalize only within 10 minutes." It rejects the report that is actually available after a delay, and the only recovery in this reduction is refund, which returns stakes to both sides.
Preconditions#
The block timestamp is 1700000000. endTime is two hours earlier. The available report is from 30 minutes ago, so it is 90 minutes after the end. The end-time price is 1100 and the later price is 900. Starting price is 1000. Each side staked 100.
Attack walkthrough#
- The game is opened with
endTime = block.timestamp - 2 hours. finalizeGameis called with the 30-minute-old report.- Both comparisons fail and the
requirereverts. refundsends 100 to up and 100 to down.- The control is finalized with
priceTimestamp == endTime. Price 1100 pays up 200. Down receives 0.
Diagrams#
Impact#
Down, who lost on the end-time price, is refunded 100 instead of losing that stake. Up is paid 100 rather than 200. The control pays up the full 200 and pays down nothing.
Remediation#
Accept the report from endTime at any later block, and reject every other timestamp. Do not force a full refund when finalizing is merely late.
How to reproduce#
cd 45672-finalizing-a-game-after-10-minutes-will-lock-users-earned-fu_exp
forge test -vv
Sources#
- AuditVault finding: https://github.com/Auditware/AuditVault/blob/main/findings/45672-finalizing-a-game-after-10-minutes-will-lock-users-earned-fu.md
- Zokyo report: https://github.com/solodit/solodit_content/blob/main/reports/Zokyo/2024-08-29-Xyro.md
- Game contract, fixed on main: https://github.com/xyro-io/smart-contracts/blob/main/contracts/UpDown.sol
Sources & further analysis#
Reproductions & code
- Standalone PoC + full trace: 45672-finalizing-a-game-after-10-minutes-will-lock-users-earned-fu_exp (evm-hack-registry mirror).
- AuditVault finding: 45672-finalizing-a-game-after-10-minutes-will-lock-users-earned-fu.
Alerts & third-party analyses
These dashboards index community alerts tweets, post-mortems, and independent write-ups. Reach them through the protocol name above to cross-check this reproduction against other analyses.