Reproduced Exploit

Regnum Aurum: anyone can pull a FeeCollector allowance

borrowWithInsurance requires the user to approve the insurance fee to FeeCollector before the pool will borrow. collectFee is public. It checks the fee type and the token, then transferFroms target for amount. An attacker names the victim as target and takes the whole allowance. The victim has not…

May 2025•Ethereum•access-control•3 min read

Loss

1000 USDC pulled from a victim who only approved an insurance fee

Chain

Ethereum

Category

access-control

Date

May 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. 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.

Loading fork state…

Source & credit. Reproduction of a public audit finding curated by AuditVault — the original finding: 66189-h-27-unrestricted-feecollectorcollectfee-enables-unauthorize. Standalone Foundry PoC and full write-up: 66189-h-27-unrestricted-feecollectorcollectfee-enables-unauthorize_exp in the evm-hack-registry mirror.


Vulnerability classes: vuln/access-control/missing-auth · vuln/logic/missing-check

Key info#

FieldValue
Loss1000 USDC pulled from a victim who only approved an insurance fee
Vulnerable contractFeeCollector.collectFee
Attacker EOA0x1111111111111111111111111111111111111111
Attack contractExploit
Attack txExploit.run()
Chain / block / dateEthereum model · block 0 · 2025-05
Compilersolc 0.8.27, cancun, via IR
Bug classcollectFee transferFroms an arbitrary target with no caller check

TL;DR#

borrowWithInsurance requires the user to approve the insurance fee to FeeCollector before the pool will borrow. collectFee is public. It checks the fee type and the token, then transferFroms target for amount. An attacker names the victim as target and takes the whole allowance. The victim has not borrowed. Their 1000 USDC balance is now in the collector.

The vulnerable code#

SOLIDITY
function collectFee(address token, address target, uint256 amount, bytes32 feeType) external returns (bool) {
    if (amount == 0 || amount > MAX_FEE_AMOUNT) revert InvalidFeeAmount();
    if (feeTypes[feeType] == bytes32(0)) revert FeeTypeDoesNotExist();
    if (!isTokenSupported[token]) revert TokenNotSupported();
    MockUSDC(token).transferFrom(target, address(this), amount); // @> VULN
    collected[token] += amount;
    return true;
}

The report's fix is to stop requiring a standing allowance and to pull the fee inside borrowWithInsurance, the way lending fees are pulled.

Root cause#

The allowance is granted to the collector, and the collector will spend any target's allowance for any caller. Nothing binds msg.sender to the lending pool or to target.

Preconditions#

  • USDC is a supported token and keccak256("INSURANCE_FEE") is a registered fee type.
  • The victim holds 1000 USDC and has approved FeeCollector for 1000 USDC, which is what the borrow path demands before it will run.
  • The victim does not need to call borrowWithInsurance.

Attack walkthrough#

  1. The victim approves FeeCollector for 1000 USDC.
  2. The attacker calls collectFee(usdc, victim, 1000, INSURANCE_FEE).
  3. The token, amount, and fee-type checks pass. There is no caller check.
  4. transferFrom moves 1000 USDC from the victim into FeeCollector. The allowance is spent.

Diagrams#

flowchart TD A["Victim approves FeeCollector for the insurance fee"] --> B["Attacker calls collectFee with the victim as target"] B --> C["VULN transferFrom pulls the victim with no caller check"] C --> D["Victim balance is 0 and the collector holds 1000 USDC"] C --> E["Fix pulls the fee inside borrow instead of a standing allowance"]

Impact#

The victim loses the full approved amount, here 1000 USDC, whether or not they ever borrow. The tokens sit in FeeCollector. A later borrow also fails the allowance check, because the allowance is already gone.

How to reproduce#

BASH
cd 66189-h-27-unrestricted-feecollectorcollectfee-enables-unauthorize_exp
forge test -vv

test_collectFee_pulls_victim_allowance asserts the victim's balance is 0 and the collector holds 1000 USDC.

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.