News for hackers. Stuff that matters.
Re:BTC Stolen from Poloniex by ck2 on Tuesday March 04, 2014 @11:32AM (#7341243)
Dang it people. Race conditions. Security.

I know it's not easy but it is important to get it right.

Re:BTC Stolen from Poloniex by curveship on Tuesday March 04, 2014 @11:49AM (#7341349)
Seriously. I thought this bit of code from the MtGox leak was interesting. Sure looks like a potential double-spend race condition:

  $out = \DB::DAO('Money_Bitcoin_Block_Tx_Out')->searchOne(array('Hash' => $bean->Hash, 'N' => $bean->N));
  if ($out) {
      if ($out->Claimed == 'Y') {
          $bean->Available = 'N';
          $bean->commit();
          continue;
      }
  }
What if someone else claims $out between the read and commit? Is no one at BTC exchanges really asking these kinds of questions?
Re:BTC Stolen from Poloniex by stcredzero on Tuesday March 04, 2014 @11:45AM (#7341325)
This is exactly what Erlang would excel at implementing. Not that one couldn't do it wrong in that language as well. Same goes for Go and Clojure and a number of other languages with advanced concurrency features.
Re:BTC Stolen from Poloniex by pistle on Tuesday March 04, 2014 @11:44AM (#7341319)
It's not as hard as these hacks make it seem.

Not checking for negative balance??? It doesn't get much more freshman CS than this.