RE: Parity Multisig Wallet With Bugs -150,000 ETH (~30M USD) Stolen by steemboy

View this thread on steempeak.com

Viewing a response to: @kingscrown/parity-multisig-wallet-with-bugs-3-ethereum-icos-lost-money

· @steemboy ·
$0.85
The code that caused 150000 ethereums to be stolen
function() payable {  
  // just being sent some cash?
  if (msg.value > 0)
    Deposit(msg.sender, msg.value);
  else if (msg.data.length > 0)
    _walletLibrary.delegatecall(msg.data);
}
Basically:
If the method name is not defined on this contract…
And there’s no ether being sent in the transaction…
And there is some data in the message payload…
Then it will call the exact same method if it’s defined in _walletLibrary, but in the context of this contract.
Using this, the attacker called a method called initWallet(), which was not defined on the multisig contract but was defined in the shared wallet library:
function initWallet(address[] _owners, uint _required, uint _daylimit) {  
  initDaylimit(_daylimit);
  initMultiowned(_owners, _required);
}
Which calls the initMultiowned method...
function initMultiowned(address[] _owners, uint _required) {  
  m_numOwners = _owners.length + 1;
  m_owners[1] = uint(msg.sender);
  m_ownerIndex[uint(msg.sender)] = 1;
  for (uint i = 0; i < _owners.length; ++i)
  {
    m_owners[2 + i] = uint(_owners[i]);
    m_ownerIndex[uint(_owners[i])] = 2 + i;
  }
  m_required = _required;
}
👍  , ,
properties (23)
post_id7,795,633
authorsteemboy
permlinkre-kingscrown-parity-multisig-wallet-with-bugs-3-ethereum-icos-lost-money-20170721t073820604z
categoryethereum
json_metadata"{"app": "steemit/0.1", "tags": ["ethereum"]}"
created2017-07-21 07:38:21
last_update2017-07-21 07:38:21
depth1
children0
net_rshares211,868,412,875
last_payout2017-07-28 07:38:21
cashout_time1969-12-31 23:59:59
total_payout_value0.642 SBD
curator_payout_value0.212 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length1,186
author_reputation-4,629,728,841
root_title"Parity Multisig Wallet With Bugs -150,000 ETH (~30M USD) Stolen"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (3)