Reproduced Exploit

Remora — div-before-mul in `FiveFiftyRule::_updateEntityAllowance` exceeds caps

1. Allowance updates use (REMORA_PERCENT_DENOMINATOR / equity) amount. 2. Integer division truncates first → delta is smaller than DENOM amount / equity. 3. On the reduce path, allowance shrinks too little. 4. Entity + catalyst look-through exposure exceeds the configured cap.

Oct 2025Otherarithmetic3 min read

Chain

Other

Category

arithmetic

Date

Oct 2025

Source

AuditVault

EVM Playground

Source-level debugger — step opcodes and Solidity in sync

evm-hack-analyzer

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.

Loading fork state…

Source & credit. Reproduction of a public audit finding curated by AuditVault — the original finding: 63780-divide-before-multiply-loses-precision-in-fivefiftyrule-upda. Standalone Foundry PoC and full write-up: 63780-divide-before-multiply-loses-precision-in-fivefiftyrule-upda_exp in the evm-hack-registry mirror.


Vulnerability classes: vuln/arithmetic/division-before-multiply · vuln/arithmetic/precision-loss

Reproduction: self-contained Foundry PoC with only forge-std. Full trace: output.txt. PoC: test/63780-divide-before-multiply-loses-precision-in-fivefiftyrule-upda_exp.sol.

AuditVault taxonomy: lang/solidity · platform/cyfrin · has/github · has/poc · severity/high · sector/token · genome: division-before-multiply · precision-loss · indirect-loss · integer-bounds


Key info#

ImpactHIGH — when reducing entity allowance (add == false), truncated math leaves residual allowance too high so look-through exposure can exceed the catalyst cap
ProtocolRemora Dynamic Tokens
Vulnerable codeFiveFiftyRule._updateEntityAllowance(DENOM / equity) * amount
Bug classDivision before multiplication / precision loss
FindingCyfrin — Remora Dynamic Tokens v2.1, 2025-10-22 · #63780 · reporter 0xStalin
ReportCyfrin Remora report
SourceAuditVault
StatusFixed at commit de9a89a. Local synthetic PoC.
Compiler^0.8.24 (PoC)

TL;DR#

  1. Allowance updates use (REMORA_PERCENT_DENOMINATOR / equity) * amount.
  2. Integer division truncates first → delta is smaller than DENOM * amount / equity.
  3. On the reduce path, allowance shrinks too little.
  4. Entity + catalyst look-through exposure exceeds the configured cap.
  5. HARM: exposure > capAmountMicros after entity/catalyst receives.

The vulnerable code#

SOLIDITY
uint256 delta = (REMORA_PERCENT_DENOMINATOR / aData.equity) * amount; // @> VULN

Fix: REMORA_PERCENT_DENOMINATOR * amount / aData.equity.


Root cause#

Solidity integer division truncates toward zero. Dividing the large denominator by equity first collapses precision before scaling by amount.


Preconditions#

  • Entity with non-divisor-friendly equity (e.g. 333_334).
  • Entity and catalyst both hold balances after allowance updates.

Attack walkthrough#

  1. Create entity with equity 333_334 and a correctly computed initial allowance.
  2. Entity receives 1_500_000 tokens → allowance reduced by truncated delta.
  3. Catalyst holds 700_000 directly.
  4. Look-through exposure exceeds the 10% cap.

Diagrams#

flowchart LR BAD["DENOM / equity * amount"] --> SMALL["Truncated delta"] SMALL --> HIGH["Allowance too high"] HIGH --> CAP["exposure exceeds cap"] GOOD["DENOM * amount / equity"] --> OK["Correct residual"]

Impact#

Investors who both buy individually and via an entity can exceed the five-fifty / individual concentration cap — a compliance invariant break with economic over-exposure.


Sources#


Sources & further analysis#

Reproductions & code

Alerts & third-party analyses

  • Web3Sec X hacked database: search.
  • Rekt leaderboard: search.
  • Solodit incident search: search.

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.