Reproduced Exploit
XPress: stale trader balance lends the 1000 reserve
withdraw transfers the token before it decreases traderBalance. The callback reads getTraderBalance and still sees 1000. The lender sends that amount from its own reserve.
Chain
Other
Category
reentrancy
Date
May 2025
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. No backend, no live RPC.
Source & credit. Reproduction of a public audit finding curated by AuditVault — the original finding: 53805-potential-read-only-reentrancy-mixbytes-none-xpress-protocol. Standalone Foundry PoC and full write-up: 53805-potential-read-only-reentrancy-mixbytes-none-xpress-protocol_exp in the
evm-hack-registrymirror.
Vulnerability classes: vuln/reentrancy/cross-function · vuln/logic/incorrect-order-of-operations
Key info#
| Protocol | XPress |
| Finding | MixBytes, AuditVault 53805 |
| Vulnerable code | LOB.withdraw |
| Harm | The trader withdraws 1000 and, while the stored balance is still 1000, the lender sends its 1000 reserve. The trader holds 2000. The fixed order leaves the lender with 1000. |
| Chain | local synthetic |
TL;DR#
withdraw transfers the token before it decreases traderBalance. The callback reads getTraderBalance and still sees 1000. The lender sends that amount from its own reserve.
The vulnerable code#
// @> VULN: traderBalance is reduced only after the token transfer returns
traderBalance[msg.sender] -= amount;
Root cause#
The view used by the lender is updated after the external transfer, so a callback observes the pre-debit balance.
Preconditions#
The trader's stored balance and the LOB's cash are both 1000. The lender holds a separate 1000 reserve and trusts getTraderBalance.
Attack walkthrough#
- Credit the trader 1000 and fund the lender with 1000. See output.txt.
withdrawtransfers 1000 before the storage write.- The callback reads a balance of 1000.
- The lender sends 1000.
traderBalanceis then set to 0.- The trader holds 2000 and the lender holds 0. The fixed path updates first, so the lender sends nothing.
Diagrams#
Impact#
The lender loses 1000. The trader receives their own 1000 plus that reserve. Updating the balance before the transfer makes the view return 0.
Remediation#
Decrease traderBalance before the token transfer.
How to reproduce#
cd 53805-potential-read-only-reentrancy-mixbytes-none-xpress-protocol_exp
forge test -vv
Sources & further analysis#
Reproductions & code
- Standalone PoC + full trace: 53805-potential-read-only-reentrancy-mixbytes-none-xpress-protocol_exp (evm-hack-registry mirror).
- AuditVault finding: 53805-potential-read-only-reentrancy-mixbytes-none-xpress-protocol.
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.