Reproduced Exploit

Entangle Trillion — dynamic delegatecall lets a compromised master drain Compounder

Compounder.compound accepts a callee and payload from its authorized master then runs the pair with delegatecall. If that master EOA is compromised, it can run arbitrary code with Compounder authority and move every held underlying token.

Feb 2024Otherdependency2 min read

Chain

Other

Category

dependency

Date

Feb 2024

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: 51376-vulnerability-in-compounder-contract-allowing-compromised-eo. Standalone Foundry PoC and full write-up: 51376-vulnerability-in-compounder-contract-allowing-compromised-eo_exp in the evm-hack-registry mirror.


Vulnerability classes: vuln/dependency/unsafe-external-call · vuln/access-control/missing-auth

Reproduction: Fully local, cheatcode-free synthetic. Run forge test -vvv in this folder.

Key info#

FieldValue
ProtocolEntangle Trillion
FindingAuditVault 51376
ImpactHigh
ReproductionLocal synthetic; no mainnet fork
Vulnerable contractCompounder
CompilerSolidity 0.8.24

TL;DR#

Compounder.compound accepts a callee and payload from its authorized master then runs the pair with delegatecall. If that master EOA is compromised, it can run arbitrary code with Compounder authority and move every held underlying token.

Vulnerable code#

The minimized contract preserves the reported operation with an @> VULN marker in the synthetic.

Root cause#

The authorization check validates only the caller. It does not constrain dynamic delegatecall targets or payloads to a trusted allowlist, so the authorized caller can select arbitrary executable code in the Compounder context.

Preconditions#

The master SynthChef authorization is compromised or malicious, and Compounder holds an underlying asset balance.

Attack walkthrough#

The synthetic seeds Compounder with 100 tokens. Its compromised master submits a call configuration pointing to a malicious payload. Delegatecall makes that payload transfer the Compounder balance to the master, and the proof verifies a zero Compounder balance.

Diagrams#

flowchart TD A["Compounder holds 100 tokens"] --> B["Compromised master calls compound"] B --> C["Master supplies payload and callee"] C --> D["VULN: Compounder delegatecalls payload"] D --> E["Payload transfers reserve to master"]

Impact#

Compromise of the master authorization becomes a direct loss of all underlying assets held by Compounder. The test uses a 100-token reserve and proves the transfer is executed in the Compounder context.

Remediation#

Do not delegatecall dynamic callee and payload inputs. Restrict allowed code to immutable or governance-controlled trusted implementations, validate each selector, and minimize master authority.

How to reproduce#

BASH
cd /workspaces/RustroverProjects/audits/evm-hack-registry/51376-vulnerability-in-compounder-contract-allowing-compromised-eo_exp
forge test -vvv

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.