News for hackers. Stuff that matters.
Re:US Attorney Announces $3.36B Cryptocurrency Seizure in Co... by xyzzy4747 on Monday November 07, 2022 @10:48AM (#33507332)
True, but it’s still not trivial, unless you’ve thought of the race condition problems in advance. My guess is that instead of keeping all the withdrawal logic in a comprehensive DB transaction with good constraint checking, the code was broken up into multiple sequential PHP statements with transactions of simpler SQL (which is likely easier from a coding perspective) and with insufficient locking. This is the easier way to code it if you haven’t thought of or heard about race condition issues.
Re:US Attorney Announces $3.36B Cryptocurrency Seizure in Co... by pmontra on Monday November 07, 2022 @11:28AM (#33507978)
Yes, I'm sure that's what happened. The money withdrawal scenario is the classic example for locking in any database programming classroom but not everybody went through that or remembers it.
Re:US Attorney Announces $3.36B Cryptocurrency Seizure in Co... by ilyt on Monday November 07, 2022 @10:59AM (#33507517)
Even if you're not 100% sure in your DB code you can do defense in depth approach and have the code that does the money operations do some checking too.

Even executing queued operations with few seconds delay allow you to notice say a series of withdrawals putting account in negative

Re:US Attorney Announces $3.36B Cryptocurrency Seizure in Co... by Scoundreller on Monday November 07, 2022 @12:23PM (#33508923)
Yeah, and it’s Bitcoin withdrawals, nobody expects it to be anywhere near instant. I doubt the market place set its transaction fees very high either.

But then you have to create a queue that only runs 1 transaction per second. I guess another imperfect but simpler way is to create a batch file of transactions, execute hourly, but randomize or sort the sequence in a way to make sure related transactions aren’t executed together.