News for hackers. Stuff that matters.
Re:Reverse-engineering the Starbucks ordering API by 13of40 on Thursday July 13, 2017 @12:44AM (#14758786)
Whenever you do this sort of thing, you should check whether they do negative number checking on the client side or in the API itself. You might be able to get 1 pizza with bacon and (1) pizza without, all for the price of the bacon.
Re:Reverse-engineering the Starbucks ordering API by Lazare on Thursday July 13, 2017 @03:31AM (#14759412)
I work for a company with a similar sort of online ordering API, and a while back some enterprising person discovered that:

1. Our API had a hidden "tip" feature; we hadn't exposed it in the storefront yet, mostly because the developer in charge of it had left with it halfway finished, and nobody had picked it back up yet

2. But the API itself was perfectly functional. If you manually submitted an order to the API with a tip set, it would be reflected in the total, would bill your credit card, etc.

3. Except (I'm sure you saw where this is going...) the now-departed dev hadn't added any validation yet. So if you ordered $40 worth of pizza and added a negative $39 tip...boom, nearly free pizza.

We learned a few valuable lessons for the cost of buying a college student a couple of pizzas. :)

Re:Reverse-engineering the Starbucks ordering API by dx034 on Thursday July 13, 2017 @03:35AM (#14759423)
At least you didn't sue them for that. There are enough companies that would've done so..
Re:Reverse-engineering the Starbucks ordering API by Lazare on Thursday July 13, 2017 @04:09AM (#14759573)
We actually debated offering them a job interview when they graduated. If they'd contacted us first, we might have. :) Instead we just fixed the bug, called it a day, and spent a few days reviewing the rest of the API for weak validation.
Re:Reverse-engineering the Starbucks ordering API by laythea on Thursday July 13, 2017 @12:39PM (#14762759)
I wonder what would happen if you order $40 worth of pizza and stated a -$41 tip! paid to eat pizza, hurray!
Re:Reverse-engineering the Starbucks ordering API by joombaga on Thursday July 13, 2017 @01:13AM (#14758889)
Good advice; I'm not sure I tried that. The goal wasn't to steal toppings or get free pizza though; it was an impromptu response to my desire for lots of bacon and encountering the duplicate limit, and then a busy signal on the phone. Once I figured out it didn't charge me for more, I just wanted to see what would happen. I figured they'd think it was a system glitch and call when they received the order.
Re:Reverse-engineering the Starbucks ordering API by BigJono on Thursday July 13, 2017 @02:35AM (#14759196)
I'm struggling to grok exactly how that would work.

1 pizza with bacon, -1 pizza (without bacon?)

Then what, hope the employee reads -1 as 1 and doesn't cancel the order and call you to find out what you wanted?

I must be missing something...

Re:Reverse-engineering the Starbucks ordering API by lambdas on Thursday July 13, 2017 @04:51AM (#14759755)
Being a negative, the delivery driver arrives and demands you give him a pizza.
Re:Reverse-engineering the Starbucks ordering API by thiagocsf on Thursday July 13, 2017 @02:38AM (#14759204)
The employee will ignore the negative sign in front of the number and make you that pizza anyway. The calculation of the total is where it might give you free pizza.
Re:Reverse-engineering the Starbucks ordering API by BigJono on Thursday July 13, 2017 @02:42AM (#14759224)
Yeah that's what I figured. The wording of the post made it sound like it had something to do with the bacon though. You could just do this for any arbitrary pizza.
Re:Reverse-engineering the Starbucks ordering API by TomMarius on Thursday July 13, 2017 @06:51AM (#14760213)
The bacon is there so you pay something, a free pizza would be weird even to a minimal wage employee (not that they're dumb, but they probably don't care).
Re:Reverse-engineering the Starbucks ordering API by XaspR8d on Thursday July 13, 2017 @11:50AM (#14762303)
Though that's assuming the people making online orders even bother looking at the amount paid. I don't necessarily see why they would (or why they wouldn't assume you had merely cashed in some sort of promo or balance).
Re:Reverse-engineering the Starbucks ordering API by ikeboy on Thursday July 13, 2017 @07:40AM (#14760463)
I've seen instances this works on gift cards.
Re:Reverse-engineering the Starbucks ordering API by fredley on Thursday July 13, 2017 @09:14AM (#14760935)
No pizza, half -1 bacon?
Re:Reverse-engineering the Starbucks ordering API by CamperBob2 on Thursday July 13, 2017 @04:21AM (#14759614)
Instructions unclear. Employee entered home and stole existing pizza from freezer.