Reproduced Exploit

Mellow Flexible Vaults — protocol fee multi-accrual in submitReports

1. Each handleReport accrues protocol fees from last timestamp → now. 2. updateState only writes the timestamp when the asset is the base asset. 3. Non-base-first batch re-accrues the same year three times → >300e18 fees vs 100e18 fair.

Jul 2025Otherlogic2 min read

Chain

Other

Category

logic

Date

Jul 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: 62109-h-4-protocol-fee-multiple-accrual-in-oraclesubmitreports-she. Standalone Foundry PoC and full write-up: 62109-h-4-protocol-fee-multiple-accrual-in-oraclesubmitreports-she_exp in the evm-hack-registry mirror.


Vulnerability classes: vuln/logic/fee-calculation · wrong-state · fee-accounting

Reproduction: self-contained Foundry PoC with only forge-std. Full trace: output.txt. PoC: test/62109-h-4-protocol-fee-multiple-accrual-in-oraclesubmitreports-she_exp.sol.

AuditVault taxonomy: severity/high · sector/oracle · platform/sherlock · fee-calculation · fee-accounting


Key info#

ImpactHIGH — same time window charged once per asset report; LPs diluted
ProtocolMellow Flexible Vaults Oracle / FeeManager / ShareModule
Vulnerable codeFeeManager.updateState returns early for non-base assets
Bug classFee timestamp not advanced per report / only on base asset
FindingSherlock 2025-07-mellow-flexible-vaults · #62109 · H-4
Reportsherlock-audit/2025-07-mellow-flexible-vaults-judging
SourceAuditVault
StatusFixed by protocol (PR #6). Reproduced as standalone local PoC.
Compiler^0.8.24 (PoC)

TL;DR#

  1. Each handleReport accrues protocol fees from last timestamp → now.
  2. updateState only writes the timestamp when the asset is the base asset.
  3. Non-base-first batch re-accrues the same year three times → >300e18 fees vs 100e18 fair.

The vulnerable code#

SOLIDITY
function updateState(address asset, uint256 priceD18) external {
    if ($.baseAsset[vault] != asset) {
        return; // @> VULN — timestamp not advanced
    }
    $.timestamps[vault] = block.timestamp;
}

Root cause#

Fee accrual is per-report, but the clock only advances on the base asset. Non-base reports leave timestamps[vault] unchanged, so each subsequent report in the same batch recharges the full elapsed interval.

Attack walkthrough#

  1. 1000e18 shares, 10% protocol fee, last timestamp = now − 365 days.
  2. submitReports([nonBase, nonBase, base]).
  3. Fee recipient receives >300e18 shares (finding threshold); fair single accrual is 100e18.

Diagrams#

sequenceDiagram participant Oracle participant Vault participant FeeManager Oracle->>Vault: handleReport nonBase Vault->>FeeManager: calculateFee full year FeeManager-->>Vault: 100e18 fees minted Vault->>FeeManager: updateState nonBase Note over FeeManager: early return timestamp stale Oracle->>Vault: handleReport nonBase2 Vault->>FeeManager: calculateFee full year AGAIN Oracle->>Vault: handleReport base Vault->>FeeManager: calculateFee full year AGAIN FeeManager->>FeeManager: timestamp finally updates

Impact#

Protocol fees can be charged N times per batch of N assets when non-base assets are ordered first, diluting LPs by minting excess fee shares.

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.