Reproduced Exploit
Burve — normalizing a single weight reverts the swap
Weight normalization turns an amount into a fraction with mulDivX256(weight, totalWeight). That helper requires the denominator to be strictly greater than the numerator. A one-element weight array has weight == totalWeight, so the require reverts, the swap reverts with it, and the 1000 underlying…
Chain
Other
Category
dos
Date
Jan 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. 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: 55213-h-02-normalizing-token-weights-can-result-in-a-revert-pashov. Standalone Foundry PoC and full write-up: 55213-h-02-normalizing-token-weights-can-result-in-a-revert-pashov_exp in the
evm-hack-registrymirror.
Vulnerability classes:
vuln/dos/frozen-funds·vuln/logic/wrong-condition
Key info#
| Protocol | Burve |
| Finding | Pashov Audit Group H-02, AuditVault 55213 |
| Vulnerable code | mulDivX256 requires denominator > num |
| Harm | The swap reverts and 1000 stays in the pool. The two-weight pool pays the trader 1000. |
| Chain | local synthetic |
TL;DR#
Weight normalization turns an amount into a fraction with mulDivX256(weight, totalWeight). That helper requires the denominator to be strictly greater than the numerator. A one-element weight array has weight == totalWeight, so the require reverts, the swap reverts with it, and the 1000 underlying deposited into the pool stays there. Weights 1 and 3 of a total of 4 pass the check, and that pool pays the trader 1000.
The vulnerable code#
self.weights[i] = FullMath.mulDivX256(
self.weights[i],
self.totalWeight
);
require(denominator > num, "0");
The report says to set the element to type(uint256).max when the two values are equal.
Root cause#
A single weight is the whole total. The fixed-point helper rejects that equality, so normalization cannot finish and every swap that normalizes first reverts.
Preconditions#
The pool's only weight is 100 and totalWeight is 100. The swap calls normalize before paying. The trader has deposited 1000 underlying into the pool in the same transaction.
Attack walkthrough#
weights(0)equalstotalWeight.- 1000 underlying is transferred into the pool.
swapcallsnormalize, which callsmulDivX256(100, 100).require(denominator > num)reverts. The swap frame reverts with it.- The pool still holds 1000 and the trader has received nothing.
- The control pool has weights 1 and 3. Both are below 4, normalization succeeds, and the trader is paid 1000.
Diagrams#
Impact#
The swap cannot complete, so the 1000 underlying that entered the pool in this call does not come back out. A pool whose weights are not equal to the total pays the trader that 1000.
Remediation#
When weight == totalWeight, store the full-scale value, type(uint256).max, instead of calling mulDivX256.
How to reproduce#
cd 55213-h-02-normalizing-token-weights-can-result-in-a-revert-pashov_exp
forge test -vv
Sources#
- AuditVault finding: https://github.com/Auditware/AuditVault/blob/main/findings/55213-h-02-normalizing-token-weights-can-result-in-a-revert-pashov.md
- Pashov report: https://github.com/pashov/audits/blob/master/team/md/Burve-security-review_2025-01-29.md
- Reviewed tree: https://github.com/itos-finance/Burve/tree/f0597768fee2d00c17429941f4721475e1ca5723
Sources & further analysis#
Reproductions & code
- Standalone PoC + full trace: 55213-h-02-normalizing-token-weights-can-result-in-a-revert-pashov_exp (evm-hack-registry mirror).
- AuditVault finding: 55213-h-02-normalizing-token-weights-can-result-in-a-revert-pashov.
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.