Skip to content
Access control Write-up Advanced

One Zodiac Roles key drained a $6.45M Safe | OKcontract Labs

A leaked key for a Zodiac Roles module on a Safe multisig was used to move about $6.45M out of the Safe. The role's policy allowed a swap function where the executor address was not restricted, so the attacker set themselves as executor and received the tokens.

medium.com

Published on medium.com

Ethereum Blockchain

OKcontract Chainwall, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 8 min read.

Context

On 16 November 2026, about $6.45M left a Safe multisig on Ethereum in a single transaction, and none of the Safe's owners signed it. The Safe had a Zodiac Roles Modifier attached. That module lets an owner attach a policy to a role and assign addresses to the role; an address holding the role can make the Safe perform whatever the policy covers, without owner signatures. Teams use this so a bot or an operations person can run routine treasury moves without collecting owner signatures every time.

Part of the drained money came out of a Morpho vault, which makes the incident easy to misread as a Morpho hack. The vault did what it was asked, and the funds left through the permissions module on the Safe. No bug has been reported in the Morpho, Gauntlet or Maple contracts.

The Safe's owner has not been publicly identified.

Setup

The relevant components, as described in the incident:

  • A Safe multisig on Ethereum with a Zodiac Roles Modifier installed, running Roles v1.
  • A role member key, [redacted], which had held its role since 26 June 2024, the day the module was set up.
  • A role policy scoped to Augustus's swapExactAmountIn with two conditions: the beneficiary had to be the Safe, and the destination token had to be on an allowlist of 71 addresses. The function was scoped this way on 14 January 2025. The token list started at 36 addresses and reached 71 on 4 December 2025. No other field of the call was ever restricted.
  • The module's configuration was last changed on 30 March 2026, so the attacker used the policy exactly as they found it.

Zodiac says it never had access to the wallet's keys and did not write its permissions. Safe confirmed that no owner signed and that the module was installed outside Safe{Wallet}.

Finding it

The report does not describe how the policy weakness was first noticed. What it reconstructs is the shape of the policy: with Roles, the caller writes the full calldata and the policy compares selected fields of it. Any field the policy does not mention is open. Here the beneficiary was pinned to the Safe, but the executor, the address Augustus hands the source tokens to, was left unrestricted. That open field is what decided where the money went.

The policy can be read from the module's logs, which record every scope change. Nobody has said how the key leaked.

Exploitation

Everything happened in one Ethereum transaction: [redacted].

Step 1: call the modifier with a batch

The role member key calls the Zodiac Roles Modifier on the Safe with a MultiSend batch of five calls. The modifier checks each call against the role's policy and allows all of them.

Step 2: withdraw from the Morpho vault

The Safe withdraws 4,387,188 USDC from the Gauntlet USDC Prime vault on Morpho with itself as receiver. That withdrawal is an ordinary vault operation and the USDC went to the Safe itself, so nothing on the Morpho side misbehaved.

Step 3: approve the router

The Safe approves the Velora (ParaSwap) Augustus V6.2 router for USDC and for syrupUSDC.

Step 4: swap with an attacker-chosen executor

The Safe calls swapExactAmountIn on Augustus once per token, naming [redacted] as the executor with a minimum output of 1 unit. Augustus moves 4,387,188 USDC and 1,717,919 syrupUSDC from the Safe to that executor, and the Safe gets 0 back.

Path of the drain, from the leaked key to the attacker’s address From the original on medium.com

Path of the drain, from the leaked key to the attacker's address

Both policy conditions still passed: the beneficiary was the Safe and the destination token was on the allowlist. The attacker put their own address in the executor field with a minimum output of 1 unit, so the tokens went to the attacker and the swap returned nothing to the Safe.

syrupUSDC is Maple's yield-bearing USDC token. At about $1.19 per token the 1.72M syrupUSDC was worth about $2.04M, which puts the total near $6.43M. PeckShield, relaying on-chain investigator Specter, reported $6.45M.

Zodiac looked at the transaction and said its contracts were fine. In their words, the key sent a transaction that "a custom policy allowed but likely never intended."

From the original on medium.com

Co-founder Johannes Moormann told Cointelegraph the key belonged to a long-standing role member and was most likely compromised.

Root cause

The mistake was in the policy, not in the module's code. The role's scope for swapExactAmountIn constrained only two fields: the beneficiary and the destination token. The executor was never restricted, and the caller writes the full calldata, so any field the policy does not mention is open. The attacker supplied their own executor and a minimum output of 1 unit, and the policy had nothing to compare those against.

The Safe's signature threshold does not apply to actions the policy covers, so for those actions a single key is enough. The scope took effect as soon as it was set in January 2025 and stayed in place for 22 months. A review of the module's code could in principle have caught the earlier three incidents, but not this one, because the risky part was a policy the wallet's own operators wrote, and Zodiac enforced it as written.

Impact

With one compromised role key, the attacker moved 4,387,188 USDC and 1,717,919 syrupUSDC out of the Safe in a single transaction, with no owner signature. The total is reported as about $6.45M, or near $6.43M at the stated syrupUSDC price.

Part of the proceeds has been traced into Monero purchases, and the trackers report different amounts:

  • PeckShield: about $813,000 spent buying XMR on Hyperliquid.
  • Specter: about $1.2M converted through Wagyu.
  • Bitquery: its initial count tracked about $1M of XMR1 purchases across five Hyperliquid accounts funded from the Safe.

These may be overlapping or separate conversions, and no one has accounted for the full $6.45M. Bitquery noted the route looks like one used after a separate Lighter drain but found no transfers linking the two.

Fix

The report does not say that the Safe's policy was changed. It describes how the same attack plays out against a Chainwall vault, OKcontract's product, with the attacker holding the same operator key, and what to do if you run a Roles setup today.

How Chainwall changes the model

Chainwall keeps the rules for a vault in an onchain registry. It holds the allowlisted contracts and tokens together with the registered interactions. Policies in the same registry set which groups approve an action and how many approvals it needs. The vault only runs interactions that are registered there, and the whole check is repeated when the operation executes. Changes to the registry itself, like editing a policy or adding someone to a group, go through timelocks that you set per category.

A Chainwall interaction is a script stored in the registry that builds the calls itself, and the operator supplies only the arguments that script declares. A swap script that does not take an executor argument gives the attacker no executor to choose, and the attacker cannot assemble a custom batch of calls either. Using one model for verification and execution also makes review easier: the script is both the rule and the mandate that runs, so you read it and see where the tokens can go. With a Zodiac policy you have to work out what every unrestricted field of the calldata could do, and that is the step that was missed here.

A poorly written interaction can be registered in Chainwall too, but adding or changing one goes through the interaction timelock, so with a delay set, other reviewers get a window to catch it before it goes live.

If treasury movements sit under a policy with a threshold, say 2 of 3, the attacker can propose the withdrawal and the swaps but holds only one approval. Approvals are onchain calls from group members and membership is checked again at execution, so the operation reverts.

If the team did want that operator to move funds alone for day to day work, you could create a single-actor policy and put a budget meter on it. Daily and monthly meters ship as templates, and with a 250,000 USDC daily meter a 4.39M USDC movement reverts.

Attack replay on a Chainwall vault. Example policy: 2 approvals, daily budget meter From the original on medium.com

Attack replay on a Chainwall vault. Example policy: 2 approvals, daily budget meter

The operator key cannot change the rules either. Policies and group membership are changed through registry governance. The Safe itself sits behind OKGuard, which only lets it call Chainwall's Interact contract or delegatecall the singleton migrator, and which blocks Safe self-calls. Enabling a module is a self-call, so nobody can attach a second executor to the vault later.

Scripts can also only call contracts that resolve from the registry, and the operation's hash covers the interaction, its arguments, its dependencies and the policy. By default, if any of that differs at execution, the operation is refused.

The threshold is a field on the policy and the meter comes from a template. The CLI repo also includes a chainwall-operations agent skill, so you can have your coding agent deploy the vault and register both.

If you run a Roles setup today

You can lower your risk without migrating anything:

  1. Open your Roles configuration and work out, for each role member, the largest amount that key could move on its own. If that number is more than you would keep in a hot wallet, narrow the policy.
  2. For every function a role can call, check each address parameter and not only the recipient. Here the beneficiary was pinned to the Safe while the executor was left open.
  3. Look hardest at roles that were set up a long time ago, because the key used here had held its role since June 2024.

Variants to test

  • Enumerate every function a role can call and list each address parameter in its calldata. A positive result is any address field that the policy does not constrain and that influences where tokens end up, such as the executor here.
  • Check output and slippage fields.
  • Check whether the beneficiary condition alone is sufficient. A positive result is a call where the beneficiary is the Safe but the tokens still leave to a third party.
  • Review the module's logs for scope changes and compare the current scope with what was intended. A positive result is a scope that took effect as soon as it was set and has stayed unchanged for a long time.
  • For each role member, compute the largest amount that key could move on its own. A positive result is a figure larger than the team would keep in a hot wallet.
  • On a Chainwall-style setup, test whether an operator can supply arguments the registered script does not declare, or assemble a custom batch. A positive result is any path that lets the operator choose an address the script does not expose.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 15 min read.

What happened, in plain words

On 16 November 2026, about $6.45M left a Safe multisig on Ethereum in a single transaction, and none of the Safe's owners signed it. A Safe is a shared crypto wallet: several people hold keys, and normally a set number of them must approve before money moves. Here that did not happen. The money left through a permissions module attached to the Safe, and one key was enough.

Part of the drained money came out of a Morpho vault, which makes the incident easy to misread as a Morpho hack. A vault here is a place where crypto deposits sit and earn yield, like a savings account managed by a program. The vault did what it was asked, and the funds left through the permissions module on the Safe. No bug has been reported in the Morpho, Gauntlet or Maple contracts.

The Safe's owner has not been publicly identified.

The pieces involved

Before the steps make sense, here are the parts of the setup, as described in the incident:

  • A Safe multisig on Ethereum with a Zodiac Roles Modifier installed, running Roles v1. Zodiac is a set of add-on tools for Safe wallets. The Roles Modifier is the add-on that lets a key act on the Safe's behalf within limits written down in advance.
  • A role member key, [redacted], which had held its role since 26 June 2024, the day the module was set up. A key here is a long string of characters that proves who you are, like a password that a program can check automatically. A role is a named set of permissions, like a staff badge that opens certain doors.
  • A role policy scoped to Augustus's swapExactAmountIn with two conditions: the beneficiary had to be the Safe, and the destination token had to be on an allowlist of 71 addresses. A policy is the written rulebook for what a role may do. A beneficiary is the address that should end up with the result. An allowlist is a list of addresses that are permitted, and anything not on it is refused. The function was scoped this way on 14 January 2025. The token list started at 36 addresses and reached 71 on 4 December 2025. No other field of the call was ever restricted.
  • The module's configuration was last changed on 30 March 2026, so the attacker used the policy exactly as they found it.

Zodiac says it never had access to the wallet's keys and did not write its permissions. Safe confirmed that no owner signed and that the module was installed outside Safe{Wallet}.

How the weakness was found

The report does not describe how the policy weakness was first noticed. What it reconstructs is the shape of the policy: with Roles, the caller writes the full calldata and the policy compares selected fields of it. Any field the policy does not mention is open.

calldata is the block of instructions a program sends to a smart contract: which function to run and with which values. Think of a paper form with many boxes. The policy checks only the boxes it names. Every other box is left blank for the sender to fill in however they like.

Here the beneficiary was pinned to the Safe, but the executor, the address Augustus hands the source tokens to, was left unrestricted. That open field is what decided where the money went.

The policy can be read from the module's logs, which record every scope change. Nobody has said how the key leaked.

The attack, step by step

Everything happened in one Ethereum transaction: [redacted].

A transaction is a single recorded action on the blockchain, the public ledger that keeps track of who owns what. The long string is its identifier, like a receipt number you can look up.

Step 1: call the modifier with a batch

The role member key calls the Zodiac Roles Modifier on the Safe with a MultiSend batch of five calls. The modifier checks each call against the role's policy and allows all of them.

A batch is several actions packed together and sent as one. MultiSend is the tool that does the packing. The modifier is the gatekeeper: it reads each action, compares it with the policy, and lets it through if the policy allows it. All five passed.

Step 2: withdraw from the Morpho vault

The Safe withdraws 4,387,188 USDC from the Gauntlet USDC Prime vault on Morpho with itself as receiver. That withdrawal is an ordinary vault operation and the USDC went to the Safe itself, so nothing on the Morpho side misbehaved.

USDC is a digital dollar: a token designed to stay worth about one US dollar. Withdrawing from a vault is like taking your savings out of an account. The money went to the Safe, which is exactly what a normal withdrawal does, so the vault is not at fault.

Step 3: approve the router

The Safe approves the Velora (ParaSwap) Augustus V6.2 router for USDC and for syrupUSDC.

A router is a service that finds and carries out trades between tokens. An approval is a permission slip: it tells the router it may move a certain token out of the Safe. Without it, the router could not touch the funds.

Step 4: swap with an attacker-chosen executor

The Safe calls swapExactAmountIn on Augustus once per token, naming [redacted] as the executor with a minimum output of 1 unit. Augustus moves 4,387,188 USDC and 1,717,919 syrupUSDC from the Safe to that executor, and the Safe gets 0 back.

swapExactAmountIn is the trade function: you say how much you put in, and it works out what comes out. The executor is the address that receives the tokens being sold before the trade completes. The minimum output is the smallest amount the trade will accept back. Setting it to 1 unit means the trade will go through even if almost nothing comes back.

Path of the drain, from the leaked key to the attacker’s address From the original on medium.com

Path of the drain, from the leaked key to the attacker's address

Both policy conditions still passed: the beneficiary was the Safe and the destination token was on the allowlist. The attacker put their own address in the executor field with a minimum output of 1 unit, so the tokens went to the attacker and the swap returned nothing to the Safe.

syrupUSDC is Maple's yield-bearing USDC token. Yield-bearing means it slowly grows in value, like a savings account that pays interest. At about $1.19 per token the 1.72M syrupUSDC was worth about $2.04M, which puts the total near $6.43M. PeckShield, relaying on-chain investigator Specter, reported $6.45M.

Zodiac looked at the transaction and said its contracts were fine. In their words, the key sent a transaction that "a custom policy allowed but likely never intended."

From the original on medium.com

Co-founder Johannes Moormann told Cointelegraph the key belonged to a long-standing role member and was most likely compromised.

Why it worked

The mistake was in the policy, not in the module's code. The role's scope for swapExactAmountIn constrained only two fields: the beneficiary and the destination token. The executor was never restricted, and the caller writes the full calldata, so any field the policy does not mention is open. The attacker supplied their own executor and a minimum output of 1 unit, and the policy had nothing to compare those against.

The Safe's signature threshold does not apply to actions the policy covers, so for those actions a single key is enough. A signature threshold is the number of owners who must approve, like needing two of three housemates to agree before the front door opens. The policy is a side door that skips that rule.

The scope took effect as soon as it was set in January 2025 and stayed in place for 22 months. A review of the module's code could in principle have caught the earlier three incidents, but not this one, because the risky part was a policy the wallet's own operators wrote, and Zodiac enforced it as written.

What it cost

With one compromised role key, the attacker moved 4,387,188 USDC and 1,717,919 syrupUSDC out of the Safe in a single transaction, with no owner signature. The total is reported as about $6.45M, or near $6.43M at the stated syrupUSDC price.

Part of the proceeds has been traced into Monero purchases, and the trackers report different amounts:

  • PeckShield: about $813,000 spent buying XMR on Hyperliquid.
  • Specter: about $1.2M converted through Wagyu.
  • Bitquery: its initial count tracked about $1M of XMR1 purchases across five Hyperliquid accounts funded from the Safe.

Monero, also called XMR, is a cryptocurrency built to hide who sends and receives it, which makes money hard to follow once converted. Hyperliquid and Wagyu are services where such conversions happened. These may be overlapping or separate conversions, and no one has accounted for the full $6.45M. Bitquery noted the route looks like one used after a separate Lighter drain but found no transfers linking the two.

The fix

The report does not say that the Safe's policy was changed. It describes how the same attack plays out against a Chainwall vault, OKcontract's product, with the attacker holding the same operator key, and what to do if you run a Roles setup today.

How Chainwall changes the model

Chainwall keeps the rules for a vault in an onchain registry. A registry is a list kept on the blockchain itself, so anyone can read it and no one can quietly edit it. It holds the allowlisted contracts and tokens together with the registered interactions. An interaction is a prepared action, a small script that says exactly which calls to make. Policies in the same registry set which groups approve an action and how many approvals it needs. The vault only runs interactions that are registered there, and the whole check is repeated when the operation executes. Changes to the registry itself, like editing a policy or adding someone to a group, go through timelocks that you set per category.

A timelock is a waiting period: a change is announced, then sits for a set time before it takes effect, like a notice period before a rent increase. That gives other people a chance to spot a mistake.

A Chainwall interaction is a script stored in the registry that builds the calls itself, and the operator supplies only the arguments that script declares. An argument is a value you hand to a script, such as an amount. A swap script that does not take an executor argument gives the attacker no executor to choose, and the attacker cannot assemble a custom batch of calls either. Using one model for verification and execution also makes review easier: the script is both the rule and the mandate that runs, so you read it and see where the tokens can go. With a Zodiac policy you have to work out what every unrestricted field of the calldata could do, and that is the step that was missed here.

A poorly written interaction can be registered in Chainwall too, but adding or changing one goes through the interaction timelock, so with a delay set, other reviewers get a window to catch it before it goes live.

If treasury movements sit under a policy with a threshold, say 2 of 3, the attacker can propose the withdrawal and the swaps but holds only one approval. Approvals are onchain calls from group members and membership is checked again at execution, so the operation reverts. To revert means to cancel and undo: the action is refused and nothing changes.

If the team did want that operator to move funds alone for day to day work, you could create a single-actor policy and put a budget meter on it. A budget meter is a spending cap that resets over time, like a weekly allowance. Daily and monthly meters ship as templates, and with a 250,000 USDC daily meter a 4.39M USDC movement reverts.

Attack replay on a Chainwall vault. Example policy: 2 approvals, daily budget meter From the original on medium.com

Attack replay on a Chainwall vault. Example policy: 2 approvals, daily budget meter

The operator key cannot change the rules either. Policies and group membership are changed through registry governance. The Safe itself sits behind OKGuard, which only lets it call Chainwall's Interact contract or delegatecall the singleton migrator, and which blocks Safe self-calls. A guard is a filter in front of the wallet that checks every outgoing action. A self-call is the wallet instructing itself, which is how a new module gets attached. Enabling a module is a self-call, so nobody can attach a second executor to the vault later.

Scripts can also only call contracts that resolve from the registry, and the operation's hash covers the interaction, its arguments, its dependencies and the policy. A hash is a short fingerprint computed from content: change any part and the fingerprint changes. By default, if any of that differs at execution, the operation is refused.

The threshold is a field on the policy and the meter comes from a template. The CLI repo also includes a chainwall-operations agent skill, so you can have your coding agent deploy the vault and register both. A CLI is a command-line tool: a program you drive by typing commands. An agent skill is a packaged set of instructions that an AI coding assistant can follow.

If you run a Roles setup today

You can lower your risk without migrating anything:

  1. Open your Roles configuration and work out, for each role member, the largest amount that key could move on its own. If that number is more than you would keep in a hot wallet, narrow the policy. A hot wallet is a wallet connected to the internet, convenient but exposed, so you keep only small amounts there.
  2. For every function a role can call, check each address parameter and not only the recipient. Here the beneficiary was pinned to the Safe while the executor was left open.
  3. Look hardest at roles that were set up a long time ago, because the key used here had held its role since June 2024.

What to test for

  • Enumerate every function a role can call and list each address parameter in its calldata. A positive result is any address field that the policy does not constrain and that influences where tokens end up, such as the executor here.
  • Check output and slippage fields. Slippage is the gap between the price you expected and the price you actually got.
  • Check whether the beneficiary condition alone is sufficient. A positive result is a call where the beneficiary is the Safe but the tokens still leave to a third party.
  • Review the module's logs for scope changes and compare the current scope with what was intended. A positive result is a scope that took effect as soon as it was set and has stayed unchanged for a long time.
  • For each role member, compute the largest amount that key could move on its own. A positive result is a figure larger than the team would keep in a hot wallet.
  • On a Chainwall-style setup, test whether an operator can supply arguments the registered script does not declare, or assemble a custom batch. A positive result is any path that lets the operator choose an address the script does not expose.

Glossary

  • Safe multisig: a shared crypto wallet that requires several key holders to approve before funds move.
  • Ethereum: a public blockchain network that records transactions and runs smart contracts.
  • Transaction: a single recorded action on a blockchain, identified by a long string.
  • Blockchain: a public ledger that keeps a permanent, ordered record of transactions.
  • Smart contract: a program stored on a blockchain that runs automatically when called.
  • Zodiac Roles Modifier: an add-on for Safe wallets that lets a key act within a written policy without owner signatures.
  • Role: a named set of permissions, like a staff badge that opens certain doors.
  • Policy: the written rulebook for what a role may do.
  • Scope: the part of a call that a policy actually checks.
  • Key: a long string that proves identity to a program, like a password it can check.
  • Compromised key: a key that someone else has obtained, so they can act as its owner.
  • calldata: the block of instructions sent to a smart contract: which function and which values.
  • Field: one named value inside a call, such as an address or an amount.
  • Beneficiary: the address that should end up with the result of an action.
  • Executor: the address that receives tokens being sold before a trade completes.
  • Allowlist: a list of addresses that are permitted; anything else is refused.
  • MultiSend: a tool that packs several actions into one batch.
  • Batch: several actions sent together as one.
  • USDC: a digital dollar token designed to stay worth about one US dollar.
  • syrupUSDC: Maple's yield-bearing USDC token, which slowly grows in value.
  • Yield-bearing: a token that grows in value over time, like an account paying interest.
  • Morpho vault: a place where crypto deposits sit and earn yield, managed by a program.
  • Gauntlet USDC Prime vault: the specific Morpho vault the Safe withdrew from.
  • Router: a service that finds and carries out trades between tokens.
  • Velora (ParaSwap) Augustus V6.2: the router used in this transaction.
  • Approval: a permission slip letting a router move a token out of a wallet.
  • swapExactAmountIn: a trade function where you state how much you put in and it works out the output.
  • Minimum output: the smallest amount a trade will accept back; 1 unit means almost nothing.
  • Slippage: the gap between the expected price and the price actually received.
  • Signature threshold: the number of wallet owners who must approve an action.
  • Module: an add-on attached to a Safe that can act on its behalf.
  • Logs: the recorded history of changes a module keeps.
  • Onchain: stored on the blockchain itself, readable by anyone.
  • Registry: an onchain list of allowed contracts, tokens and interactions.
  • Interaction: a prepared script that says exactly which calls to make.
  • Argument: a value handed to a script, such as an amount.
  • Timelock: a waiting period between announcing a change and it taking effect.
  • Governance: the process by which rules and membership are changed.
  • OKGuard: a filter in front of a Chainwall vault that checks every outgoing action.
  • Self-call: the wallet instructing itself, which is how a new module gets attached.
  • delegatecall: a way for a contract to run another contract's code in its own context.
  • Singleton migrator: the single contract that Chainwall allows the vault to delegate to.
  • Hash: a short fingerprint computed from content; change any part and it changes.
  • Revert: to cancel and undo an action so nothing changes.
  • Budget meter: a spending cap that resets over time, like a weekly allowance.
  • Hot wallet: a wallet connected to the internet, convenient but exposed, so it holds only small amounts.
  • CLI: a command-line tool driven by typing commands.
  • Agent skill: a packaged set of instructions an AI coding assistant can follow.
  • Monero (XMR): a cryptocurrency built to hide who sends and receives it.
  • Hyperliquid: a service where XMR purchases were made.
  • Wagyu: a service through which funds were converted.
  • PeckShield, Specter, Bitquery: organisations that track and report on blockchain activity.
  • Lighter drain: a separate earlier incident whose route looked similar.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.