8 ms·
Diablo III Economy Broken by an Integer Overflow Bug
- ebbv 14y ago420,081,335,014 is 420 billion not 420 trillion.
- unwind 14y agoEnglish is handy enough to have two "scales", where these words have different meanings. In the short scale, you'd be right, but the author probably uses the long scale. See http://en.wikipedia.org/wiki/Long_scale#Comparison http://en.wikipedia.org/wiki/Long_scale#Comparison. It's one of those things that makes English ... interesting to learn as a foreign language. :) EDIT: Actually no, I mis-read the table on the Wikipedia page. The author was simply mistaken, and has corrected that. Thanks to everyone who pointed this out.
- quarterto 14y agoAlso, basically no-one uses the long scale anymore. Which is a shame. -illiard is a fantastic suffix.
- danceonfire 14y agoNo. The long scale of 420,081,335,014 would be 420 milliards, short scale being 420 billion.
- jakub_g 14y agoIn Polish, there's one standard: million, milliard, billion. Every time I see some article in the press that tells about "billions" and seems to be based on some foreign data, I have to stop and think whether the author cited the original value unchanged, or converted it.
- ebbv 14y agoLong scale makes HIGHER numbers use LOWER terms, so you're completely backwards on this.
- gbaygon 14y agoIn the long scale ins't 420 trillons either, it's 420 millards. Source: your link.
- astrodust 14y agoLong-scale should be officially retired, it's needless. Keep rocking with fortnights and stone if you must, nobody else is laying claim to those. It's things like having three different "gallons" that all mean wildly different things that make communication difficult.
- lucian1900 14y agoOr perhaps short-scale should be retired instead, since pretty much all other languages use long-scale anyway.
- astrodust 14y agoShort's as much as a standard and pairs well with SI units. Long's an anachronism in comparison.
- csense 14y agoI'm a native English speaker (USA) with lots of math and science education, and I'd never heard of the long scale until you posted this article. It sounds so strange. Are you sure this isn't another Wikipedia hoax masterminded by Stephen Colbert?
- minimaxir 14y agoFixed. I suck at numbers. :P (or rather, fixed, but the server is getting hammered enough that it won't let me flush the cache) There was another screenshot which has an account balance in the trillions that Blizzard argued was fabricated. Given the ease in which this trick was performed, I wouldn't be surprised if it was authentic.
- ebbv 14y agoIf Blizzard says it's fabricated they're probably right. They're certainly in a position to know and have no motive to lie.
- illuminate 14y agoProbably. I'm not a huge fan of Blizzard's business model and design choices as of late, but I do trust that they would not straight-faced lie versus fakeable screenshots. They know their back-end.
- lmm 14y agoJust another reminder that it's never worth bypassing the normal deployment process. Every year or two I learn a similar lesson myself: it's so tempting, the fix is so small, it couldn't possibly break anything (heck, I once had a data-gathering script that made a bunch of read-only calls to our system's API cause a live issue). Just say no.
- mnarayan01 14y ago> heck, I once had a data-gathering script that made a bunch of read-only calls to our system's API cause a live issue I don't think you can just throw that out here with no story. Well...I guess you can, it just makes me sad.
- lmm 14y agoThe script was a permission checker; roughly, for each client check whether they had any object types they didn't have permission for, plus a bit more logic for things like "they have permission A which is a superset of B but don't have permission B", and output a report. There was a bug in the DB cache used by our security service (I think caused by a broken clone() implementation that shallow-copied when it should have deep-copied, but this was a while ago now) that meant that if permissions for two different clients were requested in quick succession, both would end up with the intersection of their permissions - which were then cached in the main application (I guess there must have been some logic like the API always triggered a refetch to ensure it returned the canonical value, whereas for the rest of the application performance was more important?). In theory it could've been happening already, but I guess we never had two clients loading the same webpage close enough to the same time (and they would have to both have had the local cache expire - plus almost all of our live clients had very similar permissions, whereas we had some "test" clients with no permissions at all), whereas of course my script just called as fast as possible. It was fairly easy to track down the bug once we passed the initial disbelief stage, and I don't think many clients noticed. But it could've been a lot worse - I'd been so close to running this last-thing on a Friday before I left.
- mnarayan01 14y ago
- sown 14y agoI remember World of Warcraft had a similar issue. The total amount of copper and in turn gold a player could have was the positive half of a signed 32-bit integer.
- josh2600 14y agoVery different issues. The total amount of the transaction is preserved. For this to be analogous you'd have to retain the copper after converting to gold and I'm not an expert on WoW but I don't ever recall that happening.
- minimaxir 14y agoThat didn't cause an exploit though. It just meant that the user couldn't get more than that amount of gold. Although back in those days, if you had that much gold, you were controlling the economy by yourself anyways.
- danceonfire 14y ago> ... where players volunteered to tested the patch to ensure that there were game-breaking exploits ... Is this an error? :) Although I assume the players would very well enjoy game-breaking exploits, as long as they are to their advantage.
- tlarkworthy 14y agoReminds be of a bug waaaay back. In the original Elite, you could obtained a missile lock on a space station, then dock and sell all your missiles, launch, and finally fire a missile (you still had the missile lock). Suddenly you have 255 missiles! 0-1 = 255 in unsigned 8 bit integer math! You could then sell all your new shiny missiles for loads of money. Made a hard game a bit easier.
- mickeyp 14y agoThose games (Frontier Elite and First Encounters included) had loaaads of bugs like that. Another one in FE had you put in passenger holds, fill them with passengers, then sell the holds -- this would obviously not work as you had to evict the passengers first, however the game logic credited you with the cash anyway because the check came after the money had changed hands.
- Luyt 14y agoThe amount of cash you had was stored in savegame files as 4 bytes. A few changes with a binary editor and suddenly you had millions of cash ;-)
- mickeyp 14y agoYeah but that's true of most things that're not obfuscated. I used to use the Amiga Action Replay on my Amiga to alter memory on the fly in games like that.
- eduardordm 14y agoHard to understand why people spend so much time on a short game like Diablo III. Even before I finished it on inferno the game didn't make much sense, I just finished for the sake of it, which I regret. Most Super Mario games requires way more abilities than that and less time. Don't waste your limited time on earth playing consumption-driven games. I've been trying Eve online for a few days, It does not looks promising, it seems that Eve also is also driven by item accumulation and not actual playing.
- minimaxir 14y agoI played enough to get a lv. 60 Monk and lv. 60 Demon Hunter. The problem with Diablo III, compared to Diablo II from 10 years ago, is that nowadays there are so many options for online games without monthly fees that there's little incentive to stick to just one. Then I started Guild Wars 2 a few months later, and played that to death. :)
- codeduck 14y agoDon't let the initial Eve gameplay get to you. Join an active faction and go on some roams. Pvp is where the game shines.
- jes5199 14y agoEvery time that I've been blown up in Eve, it's happened so quickly that the fight didn't even render on my screen. Just one second I'm in a spaceship, and the next I'm back at my home station. That feeling doesn't make me want to learn combat!
- outworlder 14y agoAnd you were probably travelling in a simple shuttle or cheap frigate, against multiple players or smartbombing idiots. Likely not consensual, and you were probably not expecting combat. Yeah, it sucks, but that too different from other MMOs (WOW, I am looking at you). Many of my small-scale engagements took several minutes to resolve, one way or the other. Not to mention fleets. In fact, one of my fondest memories was taking part in Agony Unleashed's PVP classes. That took several hours of intense playtime - we had to have multiple 'bio breaks' for people to be able to go to the bathroom and eat something - while being guarded and with scouts to give early warnings to the fleet. And it was amazing. Instructors teaching game concepts and military-like tactics and command and control (and actually enforcing discipline). I've never seen a game getting even close to that sort of organization and discipline. CCP should hire those guys as teachers to introduce players to more advanced game concepts.
- seanalltogether 14y agoThe fact that the diablo economy has reached the point where users are running around with 6 billion gold shows its been broken for much longer.
- apetresc 14y agoWhy? It's just a matter of scale. Until very recently, Romania's currency was such that most middle-class families had 8-10 digits in their bank account at any given moment, and the economy is relatively healthy. Good items sell for hundreds of millions. The number of zeroes doesn't matter, as long as the balance between items and monetary value is stable.
- falcolas 14y ago"The number of zeroes doesn't matter, as long as the balance between items and monetary value is stable." And you're not just starting the game. The way that D3 drops work, the first few times you're visiting the auction house, it's to buy, not sell (unless you get very lucky). The game was also balanced around the auction house - meaning fewer high quality items drop, with the belief being that you're selling those few high quality items & kitting yourself out from the auction house. When I first played, the difference between playing with just the drops I got versus kitting myself out from the auction house were vast. Some people might enjoy the challenge of just playing with dropped gear, but just as many do not.
- zplesivcak 14y ago" The game was also balanced around the auction house - meaning fewer high quality items drop, with the belief being that you're selling those few high quality items & kitting yourself out from the auction house." AFAIK, Blizzard collects interest on each real money transaction, so if they're optimizing for maximization of that interest (I'm assuming they do) they aren't minimizing occurrence of the rarest of the items. They should behave like diamond cartel...
- illuminate 14y ago"The number of zeroes doesn't matter" Did in this particular case ;)
- archgrove 14y agoI remember a similar bug in the original Asherons Call (amazingly, still running with regular content updates!). Three or four years in, they added a new, very expensive object to the game (a "Pyreal Scarab" for anyone who cares). It cost a lot, so the idea was that people wouldn't be (at that point in the economy) buying many. Now, in Asheron's Call, the world is huge. There are hundreds, if not thousands of vendors. And three of these vendors were set to sell their goods in stacks of up to 1000. Unfortunately, Cost of Pyreal Scrab * 1000 > 2^31, which wrapped. I can't remember if you either just got the goods for free (which you then sold back for huge profit), or if you actually got paid to take these things. Either way, overnight, the economy was destroyed. The entire game state had to be reset from backups; a dreaded rollback. Worse, the developer took a few days to do this. Trust me, out of all the customers whose data you don't want to muss with, it's hardcore MMORPG players. Even though I was just a player, I can still remember the outrage all these years later. It taught me to always use appropriate types for objects with "value", and I've never accidentally used signed or floating point storage for currency again.
- sveiss 14y agoThat was the first thing which came to my mind when I read this, too. Of course, Asheron's Call didn't have an (official) real-money trading system to deal with too. A nightmare scenario for the developers in both cases.
- georgemcbay 14y agoAsheron's Call had a very viable (unofficial) real-money trading system via ebay. I never even played the game but knew some people who did and they made fairly substantial amounts of money selling virtual crap on ebay. This was before the rise of the hardcore Chinese gold farming industry, in-game limitations on item trading (ala WOW), ebay restrictions, etc.
- EvilLook 14y ago>Trust me, out of all the customers whose data you don't want to muss with, it's hardcore MMORPG players. Welp, that's what happens when you have only online play on only official servers. Single player offline wouldn't be affected - cheat all you want! Online play on unofficial servers means server admins can take whatever action they want - ban offenders, leave offenders alone, or rollback - depending on what the admin and the players want.
- bloaf 14y agoKingdom of Loathing had an integer overflow bug way back in 2004. It let players set their currency (in this case: meat) to the max value of a 64-bit integer. The game spent the next several months setting up meatsinks in an attempt to reduce the amount of meat in circulation. http://kol.coldfront.net/thekolwiki/index.php/Black_Sunday http://kol.coldfront.net/thekolwiki/index.php/Black_Sunday http://kol.coldfront.net/thekolwiki/index.php/Bugmeat http://kol.coldfront.net/thekolwiki/index.php/Bugmeat http://kol.coldfront.net/thekolwiki/index.php/Meatsink http://kol.coldfront.net/thekolwiki/index.php/Meatsink
- russellsprouts 14y agoIt's nice that they resolved that mostly in-universe. They didn't go and ban everyone, but instead changed the gameplay to compensate.
- meerita 14y agoI told this in their forums many times: you cannot have both real world money and one digital currency at the same time. Farming gold is hillarious. You need to implement instead something like bitcoin and it's the only way to stop the inflation.
- WhoIsSatoshi 14y agois the link down? Can't access content - keeps loading here..
- astrodust 14y agoIt is odd that they're using 32-bit numbers when you'd be hard pressed to find a 32-bit only CPU and machines with over 4GB of memory are the standard. Good luck overflowing a 64-bit unsigned.
- gknoy 14y agoSomeone could do it, I'm sure. Use a bignum implementation that has no limit.
- astrodust 14y agoI mean in terms of bounded numbers as you might find in a game, or in real economies, not theoretically. It's entirely conceivable that people have billions in currency, but not quintillions. Though perhaps Zimbabwe serves as a counter-point to this. They've had to slash twelve zeroes off their currency valuation on at least one occasion.
- mckilljoy 14y agoI don't find it that odd. 32-bit applications are still very common, if not the standard. Most processes don't need more than 4GB. More importantly, blindly increasing all of your 32-bit integers to 64-bit is going to double your memory usage, and ultimately just mask the real issue (i.e. improper bounds checking).
- kabdib 14y agoThe actual money fields are probably small compared to the infrastructure used to track them. It's not going to double the amount of memory usage. I'd be surprised if memory use, network traffic and database I/O went up by more than a percent or two.
- mckilljoy 14y agoI agree for this one integer, they obviously should have been using 64-bit. I just take issue with the implication that Blizzard is somehow at fault or unusual for (presumably) not running a 64-bit stack. They made a mistake for sure, but 32-bit vs. 64-bit architectures should not be on trial.
- login1234 14y agosad mirror: http://pastebin.com/YYPM4uQK http://pastebin.com/YYPM4uQK
- yoster 14y agoHeh, this reminds me of when I played Diablo 2. I duped so many sojs/items that I had multiple accounts just filled to the brim. I rarely play Blizzard games nowadays, but as long as there are games with any type of currency that can be sold, it will always be exploited.
- tikhonj 14y agoThis is what happens when we let machine constraints trump semantics. When you say int, you usually want an actual integer, not an integer with an arbitrary limit. In this day and age, having that limit there is simply premature optimization. I think having a nice bignum type--one that looks and feels just like a normal numeric type--is very important. It should also probably be the default; you should only switch to a machine type if you have a good reason. With gmp, big integers perform well enough to be used widely.
- jcrites 14y agoCompletely agree about big integers. I expect that the next generation of programming languages will offer a "number" type that's big integer or decimal by default, and then allow engineers to refine the type as an optimization. One trouble is the data storage layer - typical database fields are fixed size and don't naturally accommodate big integers. Thus where MMOs are concerned, using big integers will still require some deliberate effort.
- aidenn0 14y agoSounds like common lisp (though I doubt it was the first to have a flexible number type).
- lispm 14y agoLisp before Common Lisp had it. But the Common Lisp language sorted it out, such that other languages copied it partly.
- hedgie 14y agopython has this now after 2.5, iirc. it's handy when you want an unbounded calculator =D
- vinkelhake 14y ago> In this day and age, having that limit there is simply premature optimization. You say this with certainty. Do you know of studies of real-world programs where machine-sized integers were replaced whole-sale with bignums?
- Glyptodon 14y agoI feel sorry for the players who were amused by this and will now likely get banned. I don't know when video games started to be like a bad elementary school where you get punished for experimenting or finding a loophole, but it seems like it's punishing one of the fundamental joys of games. Or at least one of the joys I remember being particularly rewarding as a child.
- gebe 14y agoI agree to some degree but MMO games in general are serious business and a special breed, especially when real currency is involved. It was most definitely against the ToS and I am sure that most of the players who participated in the exploit knew that. Also there were people who were using this bug to make real life money through the real money auction house, those people in particular can't be surprised that they were banned.
- Glyptodon 14y agoI don't know... wasn't there an article on here a few days ago celebrating how EVE online doesn't ban people for doing the exact same kinds of things?
- omegaham 14y agoI think the difference is that this completely broke the economy, while the exploit in EVE was much more fixable. All they had to do in EVE was take away some people's loot and they were good.
- chc 14y agoWell, when you're messing with a real-money economy, I think that's a pretty big tip-off that you'll be punished for experimenting or finding a loophole. The same thing happens with other games that deal in real money, such as the stock market. Also, AFAIK the only parties who exploited this bug were gold-farming bots. The computers won't mind, especially since their owners probably made bank off this.
- mikevm 14y agoThe scary thing is that integer overflows are considered rare so unlike things like null-pointer dereference no one really checks for them (heck, it seems impractical checking for it). In this case, how should they defend against an overflow? Impose an arbitrary limit on gold?
- nsxwolf 14y agoIs this sort of hyperinflation intentional? Or a sign of economic ignorance? I don't get it. Gold is as common as dirt, and players are pumping huge amounts of it into the economy on a constant basis.
- kabdib 14y agoI hear the D3 Auction House was written in Oracle. This explains /everything/.
- doublec 14y agoBitcoin has also suffered from an overflow bug, requiring a fork to fix it: https://en.bitcoin.it/wiki/Common_Vulnerabilities_and_Exposures#CVE-2010-5139 https://en.bitcoin.it/wiki/Common_Vulnerabilities_and_Exposu...
- yekko 14y agoComing soon to the real world with Ben's continued money printing. Maybe we can rollback the bank accounts to pre-1999!
- pilif 14y agoSomething like this used to work in Sim Farm too: buy and sell a piece of land and watch taxes grow until they flow over and you get a bunch of money instead of paying. If only this worked in real life :-)
- pilif 14y agoSomething like this used to work in Sim Farm too: buy and sell a piece of land and watch taxes grow until they flow over and you get a bunch of money instead of paying. If only this worked in real life :-)
- pilif 14y agoSomething like this used to work in Sim Farm too: buy and sell a piece of land and watch taxes grow until they flow over and you get a bunch of money instead of paying. If only this worked in real life :-)
- pilif 14y agoSomething like this used to work in Sim Farm too: buy and sell a piece of land and watch taxes grow until they flow over and you get a bunch of money instead of paying. If only this worked in real life :-)