531 points · by liuandrewk · 3y ago · 133 comments
This is exceedingly sensible. By including the expected price, the client is saying "the user has agreed to purchase a, b, and c for tootal cost X." That price was the one being displayed to the user, and it was being calculated live on the client as the user fiddled with quantities and whatnot. The actual cost might be totally different if a card's price changes or a sale ends or who knows what, and charging a user a different value than what was displayed is totally unacceptable. It's a sanity check, or alternately a form of optimistic locking. It prevents a whole class of nasty billing bugs.
The same concerns apply for a typical shopping cart design. The price can change in between the time when you sent the price to the client, and the time when the user actually decides to buy.
There is a TTL on the shopping cart itself. However, that meant for a period of time you had a frozen cost per-line-item in a shopping cart.
- explicitly version every change to the store catalogue and require the version to be passed with a purchase, disallowing purchases from old catalogues
- make an expiring signed piece of data (like JWT) for each offer in the store catalogue and require it to be passed back with a purchase, accepting old prices briefly
- make the purchase API two-phase, locking in the price on the first phase and letting the client notice that it changed and potentially neglect to go through with the second phase
And tbh, I think they are okay with 10 hackers are ruining the game, as long as 1 thousand mothers are putting their credit card to pay for gems.
https://twitter.com/dan__mayer/status/1641669864460009472
As others have pointed out there are many games where the items _are_ easily converted back to dollars. Welcome to the beautiful world of game hacking! There are some really great talks about game hacking out there that you should check out, people make bank (and have a lot of fun) with it:
1) https://www.youtube.com/watch?v=ZAUf_ygqsDo 2) https://www.youtube.com/watch?v=QoNdhlLPX-g
It is not all fun and games though, game companies crack down on hackers profiting off of item duping and botting HARD. A bit related is the hacker who sold hardware to help play pirated games for the switch who has to pay Nintendo a third of his salary for eternity:
https://www.videogameschronicle.com/news/switch-hacker-gary-...
So be careful out there. Hack the planet!
https://kotaku.com/mtg-aftermath-leaks-pinkertons-wotc-magic...
The punishment is egregious (esp. jail time), should've been something like 3x his profits, but the guy definitely sold ROMs (and other people's circumvention software!) (which apparently they added their own switch-bricking anti-circumvention to!) for profit.
> The official charges are "Conspiracy to Circumvent Technological Measures and to Traffic in Circumvention Devices" and "Trafficking in Circumvention Devices", both of which are federal felonies in the United States.
Perfectly reasonable to assume the worst about the guy, but given that Nintendo is involved I will assume that anything the government couldn't prove is false.
> this left me stumped as to why the client-side calculation even exists
I suspect it is to validate that the price they showed you in the client was the same price they actually charged you. It seems reasonable enough anyway.
https://old.reddit.com/r/MagicArena/comments/1385b90/heistin...
Honestly this reads as "how do you do, fellow kids?"
You found a cool bug, then immediately reported it. That's not what the movie is about at all. Please don't corporatize hacker culture.
Disagree with what the poster is saying if you want, but he is accurate that the quote is being misused IMO
Your math is wrong. Instead of
(200 * 21474837) % 0xFFFFFFFF
It should be (200 * 21474837) % 0x100000000
Then you get 104. The integer wrap point is 0x100000000 (because 0x100000000 is congruent to 0 in a 32 bit int). Similarly, the math to calculate the quantity should be math.floor((0x100000000/200) + 1) if a 0 total cost isn't allowed, or math.ceil(0x100000000/200) if a 0 total cost is allowed.I assume it's to detect stale data. What if the price changes while they're looking at the screen? At the very least, you want to make sure the player sees how much they're paying for something if the price changes out from under them.
Another alternative is to honor the price they saw, but that can be more complicated. It's easier to do a price check on the server side, reject the wrong price, then have the client refresh with the correct pricing.
For certain e-commerce sites that would be a big loss. This is largely a solved distributed systems problem and I don’t see how passing the cursor back to the server is any more complex than calculating prices.
There are two M:tG online games, and Arena is the one with no way to transfer currency, cosmetics, or cards between accounts. The other one, M:tG Online, does allow for the ability to trade digital goods between accounts or redeem physical cards and, like grinding/botting on WoW or RuneScape, it's a way to earn reasonable money in South American countries (Brazil and Venezuela are the two I've heard about specifically).
But yeah, integer overflow and not buffer overflow.
One league takes about 1.5-2 hours to play, a challenge 5-8 hours depending on amount of players. 1 tix = $0.90, so you can see how hard it is to make a living.
I think there's only like 3-4,000 of us that play mtgo still, so the level of play is much higher than Arena (or even your average local FNM)
Makes me think that each HN submission should have two title fields: one for the exact title of the article or blog post or whatever, and one for an accurate consensus driven title!
Or if somehow content creators could be rewarded for accuracy in their headlines.
That is 76 characters too long for HN’s submit form.
I thought blizzard would find it easy to crack down on gold selling but I guess not, every once in a while he'd dump these massive amounts of gold to some random player he'd never interacted with and wouldn't get banned for it.
These days the way it works is he'd basically be a stringer for some big gold farming site. He'd farm, dump some big chunk to one of their sock accounts, and then they'd take that into bigger blobs of gold that would get banked or eventually parceled off into whatever amount a customer wanted.
The per hour price for his labor was pretty shit, better than in Venezuela of course but if I remember correctly not close to USA's 7$ or whatever it was at the time. It gave him access to USD though which was important, as USD can be used to buy more critical goods than venezuelan cash. Like computer components for example. And it's easily turned into local currency. So any time he could get his hands on usd he was keen.
It seemed like the better money was in levelling, where he'd log in onto your account and just level your character. In wow classic this was worth it cause the leveling gets insanely tedious around 48 to 58 (level cap 60). If you think it's silly to pay someone to play a game for you you're mostly right, but retail wow (the non classic redo) iirc sells level up potions, and so does guild wars 2, so presumably people buy them. Some people are more interested in end game than levelling.
Anyway for level up work he'd have to find a client through personal relationships, so harder to do, but more money cause no middleman. Plus he's just playing the game then which is more fun than grinding for gold.
Right now it sounds like the gold market is bereft, he's saying he can't find buyers right now, not sure what's happening there, but he hasn't grinded gold in months last I checked.
I now hire him on when I can for admin assist work, which I highly recommend doing even if you think you don't need an admin assist. I read Tim Ferris' "4 hour workweek" ages ago and remember him mentioning how an admin assist can save you time in ways you don't realize until you hire one on.
So far for me he's done asset placement in a tile map generator with data entry for a game dev contract we had, some project management related cleanup and admin work, photo editing of RAWs in Darktable (a skill he picked up in about 3 hours and became remarkably good at within two sets of photos), basic accounting and cleanup with data entry, and research with compilation. All for between 10-20usd/hour depending on what he feels comfortable charging (he wanted to charge less than 10 which is just too low for me to be comfortable with). Tldr I highly recommend exploring this sometime, I can recommend my buddy personally of course but there's also agencies and the like. Actually side note, incredibly, his venezuelan bank lets me make payments from my credit card. I have no idea what's happening in that country. I used to have to pay him in eth.
It's really remarkable the ingenuity folks in places like Venezuela have to have to make any kind of money. My buddy will be sniffing out these online working opportunities I'd never have dreamed of.
A good related book is Neal Stephenson's "Reamde," plot of which somewhat revolves around the transfer of digital games currency to real currency.
>Except not, because I reported this vulnerability to them and it has been patched. Shoutout to the WotC security and engineering teams for being lovely to work with and patching this bug in a timely manner!
A fun writeup on a bug they properly reported. I hope WotC reimbursed them in some way though.
[0] - https://reddit.com/r/MagicArena/comments/1385b90/_/jiwp6jk/?...
There may be something else more complete out there since I last worked on this, no idea.
If you did the same thing in MTGO, where you can actually trade those cards for event tickets, then sell those event tickets to a 3rd party for real money...well, then a bug like this has the potential to mess up that whole economy.
Discloser: former game hacker.
purchaseV2Req.currencyQty = client_PurchaseOption.IntegerCost * quantity;
> There aren't any checks for overflowsIn C#, this might actually be secure. There is a compiler option that enables overflow checking for all math in your code (but not in your dependencies). But I suppose the decompiler would have put a checked() around the operation in that case.
https://learn.microsoft.com/en-us/dotnet/csharp/language-ref... https://learn.microsoft.com/en-us/dotnet/csharp/language-ref...
That really is an interesting conclusion, because when I think about security, my mind is always like "don’t bother looking, surely there are no low-hanging fruit".
And then an article like this pops up and proves the opposite.
Well done and a nice read.
With all that said though, there's a certain trainer scene that has disappeared. From what I've seen, many have transitioned to the paid/freemium model (see things like WeMod and similar) and thus have to deal with somehow monetizing cheating; that tends to lead to some dark patterns and not so savoury behaviours. It was never the cleanest of scenes, but it feels particularly slimy these days.
I do miss the keygen and trainer chiptunes though.
I'm not so old that I would refer to myself as an 'old fart' in anything but jest, but I remember those times as well. I think it speaks to a broader issue that you almost _need_ to try to make a buck off everything to enjoy some comforts and luxuries.
It's a common practice.
Somewhere between a chuckle and a facepalm.