Slashdot Mirror


Integer Overflow Bug Leads To Diablo III Gold Duping

Nerval's Lobster writes "Online economies come with their own issues. Case in point is the Auction House for Diablo III, a massively multiplayer game in which players can pay for items in either in-game gold or real-world dollars. Thanks to a bug in the game's latest patch, players could generate massive amounts of virtual gold with little effort, which threatened to throw the in-game economy seriously out of whack. Diablo series publisher Blizzard took corrective steps, but the bug has already attracted a fair share of buzz on gaming and tech-news forums. 'We're still in the process of auditing Auction House and gold trade transactions,' read Blizzard's note on the Battle.net forums. 'We realize this is an inconvenience for many of our players, and we sincerely apologize for the interruption of the service. We hope to have everything back up as soon as possible.' Blizzard was unable to offer an ETA for when the Auction House would come back. 'We'll continue to provide updates in this thread as they become available.' Diablo's gold issue brings up (however tangentially) some broader issues with virtual currencies, namely the bugs and workarounds that can throw an entire micro-economy out of whack. But then again, 'real world' markets have their own software-related problems: witness Wall Street's periodic 'flash crashes' (caused, many believe, by the rise of ultra-high-speed computer trading)." It seems likely the gold duping was due to a simple integer overflow bug. A late change added to the patch allowed users to sell gold on the Real Money Auction House in stacks of 10 million rather than stacks of 1 million. On the RMAH, there exists both a cap ($250) and a floor ($0.25) for the value of auctions. With stacks of 1 million and a floor of $0.25, a seller could only enter 1 billion gold (1,000 stacks) while staying under the $250 cap. When the gold stack size increased, the value of gold dropped significantly. At $0.39 per 10 million, a user could enter values of up to 6.4 billion gold at a time. Unfortunately, the RMAH wasn't designed to handle gold numbers above 2^31, or 2,147,483,648 gold. Creating the auction wouldn't remove enough gold, but canceling it would return the full amount.

39 of 160 comments (clear)

  1. Limit checking by girlintraining · · Score: 5, Insightful

    And this class, is why we use explicit type casting and do sanity checks (checking limits) prior to processing. Now, if you'll look on your screens, you'll see another example of this. Here is a failed mission to Mars, caused because the wrong unit of measurement was put into the computer, a problem caused by the lack of the human brain's compiler to make use of any data type except 'variant' and 'object'... So, what have we learned?

    --
    #fuckbeta #iamslashdot #dicemustdie
    1. Re:Limit checking by Samantha+Wright · · Score: 2

      That Ada prevails in all things?

      --
      Bio questions? Ask me to start a Q&A journal. Computer analogies available for most topics!
    2. Re:Limit checking by Anonymous Coward · · Score: 2, Funny

      tat puters' is hard.

    3. Re:Limit checking by Anonymous Coward · · Score: 2, Interesting

      So, what have we learned?

      That C is scaryscary and we're too lazy to do type checking, so we'll keep using the trendy, make-money-now languages, treating this as an outlier that won't happen to us, since we're so smart?

    4. Re:Limit checking by TubeSteak · · Score: 5, Funny

      So, what have we learned?

      That 2^31 gold ought to be enough for anybody?

      --
      [Fuck Beta]
      o0t!
    5. Re:Limit checking by Austerity+Empowers · · Score: 4, Insightful

      So, what have we learned?

      Gamers gonna game, and real money auction houses are a bad idea...

    6. Re:Limit checking by girlintraining · · Score: 2, Informative

      That 2^31 gold ought to be enough for anybody?

      Gryfindor loses 50 points.

      --
      #fuckbeta #iamslashdot #dicemustdie
    7. Re:Limit checking by djlowe · · Score: 2
      Hi,

      That Ada prevails in all things?

      Well, I suspect that you're being snarky, but you have a point. Sort of, in the sense that "If we can't trust the programmers to write good code, always, then we can force them to use a language that at least forestalls the worst of their blunders."

      The real issue, of course, is NOT technical, at the programmer/developer level, for such a project. It's administrative, in the sense that, regardless of the chosen programming language, bad code that would allow this should NEVER have passed review.

      Assuming that they set up such properly, of course, which apparently isn't the case.

      And the latter, too, isn't a technical matter either, really.

      Just my opinion.

      Regards,

      dj

    8. Re:Limit checking by Jesus_666 · · Score: 4, Funny

      So, what have we learned?

      To always use 64-bit numbers, duh.

      --
      USE HOT GRITS WITH STATUE OF NATALIE PORTMAN (NAKED AND PETRIFIED)
    9. Re:Limit checking by Samantha+Wright · · Score: 2

      That's basically it, yes. If I had my radical hat on, I might even go so far as to say this is yet more evidence that C (or, in this case C++) is not suitable for non-high-performance application-layer programming... but I dunno, it's getting pretty late.

      --
      Bio questions? Ask me to start a Q&A journal. Computer analogies available for most topics!
    10. Re:Limit checking by broken_chaos · · Score: 3, Informative

      One bug, which I reported about WoW two years ago, shows an integer underflow on a character statistics page under certain conditions. It still hasn't been fixed. Minor? Yeah, but give a bit of a pattern.

    11. Re:Limit checking by WilyCoder · · Score: 2

      When you type 'Gryffindor' and use two f's, Gryffindor has two f's.

      But when you type 'Gryfindor' and use one f, then Gryfindor has one f.

    12. Re:Limit checking by Samantha+Wright · · Score: 3, Insightful

      If you have a coding floor, your codebase should generally not have any room for "the work of genius." It should be straight-forward, accessible, and maintainable. Sophisticated optimizations are rarely necessary, except perhaps in kernel mode (scheduling, drivers...) or graphics.

      --
      Bio questions? Ask me to start a Q&A journal. Computer analogies available for most topics!
  2. ah the day of the diablo II trainer by Revek · · Score: 5, Funny

    I remember the day when you could strip the gear off anyone playing a multiplayer game with the trainer. I usually used it on jerks who came in collecting ears. If someone came in you could quickly look at their inventory and if they had several ears you could clear out their inventory and gear. They wouldn't know visually until they tried to hit you at which time they would be completely naked. It was really fun when they re-spawned and came back to loot their body and you started dropping some of the ears they collected on the ground.

    1. Re:ah the day of the diablo II trainer by Revek · · Score: 3, Interesting

      You mean the guy with the duped jacked up account that guaranteed that they could one hit you every time? Yeah I messed with his world. Now the guy without the duped jacked up shit I could handle myself. I had fun but I mostly used it to contain the guy who would come in at the 11th hour and whack all of us with his duped gear and finish the game to get some legit gear all to himself. So yes if they played the game like a luser I spanked them.

  3. Beginner's Mistake by Anonymous Coward · · Score: 2, Funny

    What a beginner's mistake. I wonder what the rationale was for not using a 64-bit integer; "It's wasteful!"

    1. Re:Beginner's Mistake by Anonymous Coward · · Score: 2, Insightful

      It's simple really...

      They elected to buy 2 newbie programmers for the price of 1 experienced one! And the new guys will work all night! It's win-win!

  4. Confused by Murdoch5 · · Score: 3, Insightful

    Why are they using a signed int for the gold amount? If the lowest gold amount is 0 then you should use an unsigned int which would double the possible value. Although in either case a simple if statement could of prevented this entire issue.

    1. Re:Confused by UnknownSoldier · · Score: 2

      Lazy programers with no foresight.

      It is same reason people "assumed" a 32-bit IP address would be enough instead of just using 64-bit from the beginning.

      There is never time to do it right, but there is always time to do it over!

    2. Re:Confused by Anonymous Coward · · Score: 5, Informative

      You couldn't be more wrong. Signed ints are usually the best way to go in C/C++.

      >in C an unsigned int must behave in a very predictable manor

      "unsigned int x = -3;" generates no compile errors or warnings.

      If you don't believe me, listen to the creator of C++ (Bjarne Stroustrup):

      "The unsigned integer types are ideal for uses that treat storage as a bit array. Using an unsigned instead of an int to gain one more bit to represent positive integers is almost never a good idea. Attempts to ensure that some values are positive by declaring variables unsigned will typically be defeated by the implicit conversion rules."

    3. Re:Confused by c++0xFF · · Score: 5, Insightful

      Integer underflow. Imagine a situation where a player has 100 gold and a bug in the code subtracts 101 gold for whatever reason. If you use a 32-bit unsigned integer, that player now has 4,294,967,295 gold. A 64-bit unsigned is even worse, of course.

      A simple if statement would catch this as well, right? But think of how often you do addition and subtraction (and everything else) throughout your code! Do you put an if around each one? Can you handle the error situation in each case? How do you ensure that you found every addition and subtraction, including future changes?

      A better solution is to make a Money class with well-defined operations, and throw an exception if you try to exceed the boundaries. Sounds easy ... but it has to be flexible enough to handle all situations (the class has to be used for all intermediate values -- it's no good to resort to an int, where problems might come back) while still being robust. ("I know, I'll use a class!" ... now you have two problems. "I know, I'll use exceptions!" ... now you have three.)

      This is not an easy problem to solve for non-trivial software, which is why bugs like this come up periodically.

    4. Re:Confused by flargleblarg · · Score: 5, Interesting

      You couldn't be more wrong. Signed ints are usually the best way to go in C/C++.

      Actually, he's not wrong at all. He said signed integers don't behave in a very predictable manner, and he's right. Signed integers have undefined (actually, to be more precise, implementation-defined) behavior for mod and div of negative values. You cannot be sure whether -4 / 3 is -1 or -2, without knowing how your compiler implements it. Some round toward zero, others toward negative infinity. Recent drafts of C++ are trying to fix this.

    5. Re:Confused by Common+Joe · · Score: 2

      A simple if statement would catch this as well, right? But think of how often you do addition and subtraction (and everything else) throughout your code! Do you put an if around each one?

      I use a program to automatically put a try-catch-finally statement around every line of code including my try-catch statements. When I'm contracting, no one can read my code so they'll have to hire me to fix or update anything. When I'm a permanent employee, then the number of lines of code I generate grows significantly so the bosses think I'm a great and productive programmer. Profit!

    6. Re:Confused by ShakaUVM · · Score: 3, Funny

      Baldur's Gate stored various things as unsigned shorts, IIRC.

      There was a monster called the nishruu that would drain charges off your magic items. So after one combat, I found I now had a charged magic item with 32,000-ish charges on it.

      Since the gold value of magic items was proportional to the number of charges remaining, I sold it and never needed to worry about money again in the game.

  5. Re:Arrests will be made... by fuzzyfuzzyfungus · · Score: 4, Insightful

    And several arrests - this is computer hacking of exploiting a known bug to your advantage.

    It will actually be interesting to see. Historically, people who come up with glitch exploits, even in multiplayer and MMORPG contexts, just get banned for some ToS reason. Blizzard's precious little 'Auction House', of course, might change that. However, I suspect that Blizzard really doesn't want to push the idea that 'in-game items are legally real value' too seriously, both because that could complicate things if players end up 'owning' them, rather than the current "Everything in this game is just intellectual property of blizzard...yadda yadda, licensed not sold,etc.", and because it would be a real blow, to the US customer base, if it were decided that Blizzard was running something closer to a very complex flavor of video poker, rather than a mere video game that you can buy some DLC for.

    Obviously Blizzard won't be happy, and the banhammer will see some use; but they might want to tread lightly.

  6. Re:Bad PR? by gl4ss · · Score: 4, Insightful

    What could Blizzard do? Performing a roll-back would wipe all progress obtained by players for the patch day, which would result in a lot of bad PR. But leaving the economy as-is will devalue all items in the game (and Diablo III is all about getting items).

    In the end, Blizzard has not done a roll-back, but instead banned anyone who duped, and refunded anyone who spent real money. The bug was temporarily fixed by reverting the patch note which caused the entire mess.

    Why would rolling back 1 day of gameplay be such a disastrous event?

    why? because people spent actual money and made actual money?

    --
    world was created 5 seconds before this post as it is.
  7. Re:Integer overflow you say? by gl4ss · · Score: 2

    How quaint. I can't remember the last time I saw one of those (except where deliberately created for loop counters etc.).

    well, this serves more as an example of how fucked up the game economics already were in D3, because the problem came up from having to increase stack sizing from 1 to 10 million.

    I mean, wtf, is diablo 3 set in zimbabwe?

    --
    world was created 5 seconds before this post as it is.
  8. Re:Perspective... by UnknownSoldier · · Score: 2

    Agreed.

    Auction House Simulator, aka, Diablo 3, is boring.

    Path of Exile is the true spiritual sucessor to Diablo 2, not that piece of garbage called Diablo 3 with cardboard cutout characters. The PoE designers understand the ONE word that made Diablo 2 fun: itemization.

  9. Luls. by neminem · · Score: 3, Informative

    Basically this exact thing happened to Kingdom of Loathing... like 9 years ago... at a time when that game was basically still in beta, and was basically the work of two people, neither of whom would actually have called themselves "programmers" at the time... as opposed to the work of a giant team of professionals releasing a triple-A title... that is mega hilarious.

    (Black Sunday: August 8th, 2004, someone discovers that using a particular item, "meat vortex", which under normal circumstances subtracts a handful of the game's currency from your inventory, if you had 0 meat would instead wrap around and give you max meat minus a few, because the game was storing meat in an unsigned int. Fun times!)

    1. Re:Luls. by ais523 · · Score: 3, Interesting

      What's probably more interesting was their fix for the problem. Instead of trying to do any sort of rollback (although they did find people with impossibly high currency amounts and reduce them to saner values), they put a large amount of very expensive trophy items for sale which didn't do anything useful, in the hope that people would put their newfound wealth to an amusing trivial cause.

      --
      (1)DOCOMEFROM!2~.2'~#1WHILE:1<-"'?.1$.2'~'"':1/.1$.2'~#0"$#65535'"$"'"'&.1$.2'~'#0$#65535'"$#0'~#32767$#1"
  10. Macintosh Pirates, circa 1989 by BenJeremy · · Score: 3, Funny

    I discovered a bug with the gold in Pirates! while watching somebody play on my roommate's Mac (we were stationed in Okinawa on Camp Kinser)... he went into port with damage, and while he did not have enough money, it offered to repair his damaged ships for more money than he had.

    Needless to say, the underflow was done to a UINT16 used to track gold (in 10-gold increments), so you'd end up with around 655350 gold after the transaction. That kept your crews happy, and let you buy lots of things.

    I also enjoyed the mental image of 1200 pirates hanging off a sloop after I sold off my fleet.

    We put in ungodly hours into that game.

  11. Re:Perspective... by Anonymous Coward · · Score: 2, Insightful

    because the wall street would be really out of business if someone managed to dupe shares.

    Sorry. What you call "duping shares" they call "naked short selling", and they are still very much in business.

  12. The interesting thing about this.... by The_Revelation · · Score: 3, Insightful

    ... is that Blizzard have often touted the very reason the game carries an always connected requirement is so that they can ensure the economy works correctly and to limit exploits through 3rd party applications. It seems rather clear, however, that the 1st party application is the only one you need to exploit the system. And, as usual, the question must be asked "does this make the game more fun?".

    As I see it, this has been Blizzard's only metric for success with Diablo 3, not profitability, as we will see later. They claimed that by breaking the existing mould, they were providing a 'more fun' experience. So, the question then becomes, does the AH or RMAH make the game more fun? Interestingly, Blizzard don't appear to be packaging these components with the Playstation 3 edition. Is that because it turns out all of the changes to Diablo 3 were 'not fun', or is it because Playstation 3 users don't deserve 'as much fun', or is playing with a controller rather than a mouse and keyboard 'so much more fun' that their combination with the AH/RMAH turned into a 'fun overload' that had to be dialled back in order not to blow our puny little minds?

    It also asks another important question about the business model. Is always-on net requirements 'more fun', particularly when they don't add anything to play beyond what a direct/lan connection might provide. When you try to enumerate the pros/cons, you see something like:
    Pros: Everyone uses the latest version all the time if they want to play
    Everyone playing has to have a working key

    Cons: Internet Connection must be working to play
    Need a server farm in every retail country so that paying customers can play (well, they don't even now, and charge people in those countries more money per copy so that they can have a game that they don't have local server access play)
    Servers have to be working in order to play
    User account has to be working in order to play
    If we rolled out a dodgy patch, everyone will be broken at once
    We have to know the product life-cycle prior to release in order to cost all of our servers' TCO correctly.
    We have to keep talking to everyone to make sure the game is working to their expectations and forever hear about shortcomings

    Economically, I don't understand how game companies are able to turn a profit on a title with those kinds of restrictions and ongoing costs. As a small example, lets say one of your servers can host 200 users at a time, but the server cost $20k, thats $100 per concurrent user before you turn the thing on. Maybe it can host 2000 users at a time, sure but thats still $10 per concurrent user before you turn it on or pay any support personnel, or for space on the floor. Surely, over the life of your product, you would be operating a negative margin without some sort of subscription service. I have read other places that, while you can't place a cost on piracy, you can place a cost and a metric on product returns. Diablo 3 is one of the few games I've ever returned, it was unusable for the first week, and is still, in most parts of the world (outside the US/EU/ASIA) mostly unplayable. Despite that, the parts of the game that were modified to provide 'more fun' actually provided, for me, a fan of the Diablo franchise, 'a lot less fun'.

    So, to say that another way, by insisting on Always-Connected, Blizzard not only have to pay a bunch of additional ongoing expenses to run (apparently) necessary infrastructure, its also alienating their core user-base which must be very costly to their bottom line. I don't understand how this course of action renders any kind of net commercial advantage.

    1. Re:The interesting thing about this.... by GigaplexNZ · · Score: 2

      Economically, I don't understand how game companies are able to turn a profit on a title with those kinds of restrictions and ongoing costs. As a small example, lets say one of your servers can host 200 users at a time, but the server cost $20k, thats $100 per concurrent user before you turn the thing on. Maybe it can host 2000 users at a time, sure but thats still $10 per concurrent user before you turn it on or pay any support personnel, or for space on the floor. Surely, over the life of your product, you would be operating a negative margin without some sort of subscription service.

      They do it by selling hundreds of millions of copies worldwide and assume that not every user will log in simultaneously 24/7, and that some users will abandon the game shortly after purchase. Oversubscription leads to higher profit margins at the cost of release day meltdowns.

  13. And nothing of value was lost by Eightbitgnosis · · Score: 4, Insightful

    Diablo 3 was a bad game that had a garbage economy before this event, and it's still a bad game that has a garbage economy after

  14. Re:Perspective... by GigaplexNZ · · Score: 2

    Path of Exile is the true spiritual sucessor to Diablo 2

    That title goes to the Torchlight series.

  15. Diablo 3 is not a game by SD-Arcadia · · Score: 3, Interesting

    The "game" part is just packaging around the pointless grind and universal trade at the auction house. No one does anything for fun after the first time they get through the quests. The game mechanics and itemization are utterly boring and without character. There is not a single aspect of skill involved either. You spend most of your time staring at your skill cooldowns and life-mana pool because the terrain and monsters don't really matter. It's rote repetition and an utter waste of time. Worst purchase I ever made. I'd much MUCH rather have a Diablo 2 expansion with new content and a higher resolution support than this PoS.

    --
    https://dalgamotor.wordpress.com/ - Elektronik beyinlere ozgurluk asisi (Turkish)
  16. and then when the IRS drops in and says it's incom by Joe_Dragon · · Score: 3, Insightful

    and then when the IRS drops in and says it's income then all kinds of other laws drop in.

  17. Re:and then when the IRS drops in and says it's in by fuzzyfuzzyfungus · · Score: 4, Funny

    and then when the IRS drops in and says it's income then all kinds of other laws drop in.

    The epic hilarity starts if they decide that you'll probably have to account for different sorts of loot in different ways... Did you get the Helm of Epic Bashing while you were wandering around and slaying monsters(self employed), while doing a quest for the Mysterious Feckless Questgiver NPC(Independent Contractor), or should it be reflected in the W-2 that the Ratslayer's Guild submitted to cover your work as an employee with them?

    You should probably also get an opinion from your tax lawyer on whether the depletion of the charges stored in your Staff of Fireball is simply part of the depreciation of that capital good, or whether charges are just a business expense like copier paper or potions of stamina...