Skip to content
Access control Write-up Advanced

Critical Web3 Vulnerability: Full Account Takeover via Arbitrary Internal Self-Calls in Smart…

A smart wallet's batch execution function allowed calls to the wallet's own address, so an attacker could make the wallet call its own privileged validator-management function. This let the attacker add themselves as a validator and take full control of the wallet.

HackerMD Follow

Published on medium.com

How a missing target validation led to a complete compromise of a modular smart contract wallet.

Hacker MD, 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.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

The batch execution function did not block the wallet's own address as a call target, so a user-supplied call could invoke privileged self-only functions.

Impact

The attacker gains full administrative control over the victim's wallet and can drain its funds.

What the attacker needed

Victim has a modular smart wallet; attacker can obtain a valid signature for a batch; wallet allows self-calls

The fix

The execution loop should explicitly reject the wallet's own address as a call target, or route any necessary internal calls through a dedicated, sanitised function.

How it was found

  1. Craft a call whose target is the victim wallet and whose data calls the validator-status function for the attacker's address.
  2. Obtain a valid signature for the malicious batch using a low-privilege or accessible validator context.
  3. Submit the batch to the wallet's execution function.
  4. The wallet calls itself, so the privileged function sees the wallet as the caller and adds the attacker as a validator.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

A smart wallet is a program on a blockchain that holds funds and checks who is allowed to move them. This wallet had a function that could run several actions at once, and it did not stop an action from targeting the wallet itself. Because the wallet trusted calls coming from itself, an attacker could use that to give themselves admin rights.

What is Access control?

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.

More by HackerMD

View all

7 more disclosed reports, best first.

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.