10 ms·
Slightly related but very interesting: the 2010 Twitter bug where simply tweeting "Accept [username]" would automatically force them to follow you. My understa
by ClassyJacket 9y ago
Slightly related but very interesting: the 2010 Twitter bug where simply tweeting "Accept [username]" would automatically force them to follow you.
My understanding is that for the sake of simpler interfaces such as SMS, which they let hold the whole service back for a long long time, they had a "follow [username]" feature - and if the person had to approve follow requests, it would send one to them. To accept the request, you just sent "accept [username]" and the follow would happen. However, they never actually checked that a request had ever been sent before allowing you to accept it, allowing you to simply force anyone to follow you with a single tweet.
Next time you make a seemingly obvious mistake, don't feel too bad. Even Twitter did it.
https://techcrunch.com/2010/05/10/does-this-twitter-bug-force-anyone-to-follow-you/ https://techcrunch.com/2010/05/10/does-this-twitter-bug-forc...
- CGamesPlay 9y agoA similarly lulzy but much more sinister-looking bug happened at Facebook, where an index into an array of users was mistakenly treated as a user id, so the message intended for user 4 in the array ended up going to the user with ID 4, aka zuck.
- weberc2 9y agoThat sounds like a pretty PHP-specific bug. Downvoters: most programming languages don’t silently convert strings (i.e., usernames) to array indices. Even Python doesn’t do this. While this particular bug probably wouldn’t be possible in most other languages, I’m only commenting because it’s rare and amusing to see bugs that are so language specific. I’m not making a generic “lol PHP” joke.
- kemitche 9y agoBoth array indices and user IDs are numbers. And it's certainly possible in Python to accidentally use a map as a list or vice versa, if the map has integer keys.
- chrfrasco 9y agoPython doesn’t do any implicit coercion (apart from ints and floats etc), right?
- icebraining 9y agoWell, booleans are integers, so you can do: >>> True + 1 2
- ubernostrum 9y agoThat's not "coercion", though. That's Python obeying the LSP, because bool is a subclass of int.
- deleted 9y ago[deleted]
- chrfrasco 9y agofizzbuzz = lambda n: [print((“fizz” * m % 3 == 0) + (“buzz” * m % 5 == 0) or m) for m in range(n)] Not sure if this is great or terrible
- ben509 9y agoIt depends what you mean by coercion. For instance: class Foo: def __getitem__(self, x): return x i = iter(Foo()) print(next(i)) print(next(i)) That works because any object that provides __getitem__ "implements the iterable protocol."[1] I bring up __getitem__ because people familiar with Java are scratching their heads, "not only did you not declare any interfaces, this is just a convention, but there's also an __iter__ method. Huh?" But interfaces are just one way to declare a type. The question is, did it convert it to a new type? Well, what type was it before? If you want to talk about LSP[0], you're a bit stuck here since you can't prove anything about a method in python. (And here, we declared its type, and we said nothing about it being iterable or a sequence.) You have to run it because you don't know that a. Foo has __iter__ or __getitem__, b. that they accept the arguments you're going to pass, c. let alone that they're designed to, d. that the object won't simply delete them halfway through. All that iter() is going to do is look for those methods and make assumptions that if you wrote __getitem__ that you meant it. At which point maybe LSP works, after all, you'll prove that it has that property by running the code and fixing it if it breaks. But... python nevertheless will nevertheless construct this proxy to use your class based on inspection, which seems an awful lot like coercion to me. [0]: Quoth Wikipedia: Let 𝜙(𝑥) be a property provable about objects 𝑥 of type T. Then 𝜙(𝑦) should be true for objects 𝑦 of type S where S is a subtype of T. [1]: https://docs.python.org/3/glossary.html#term-iterable https://docs.python.org/3/glossary.html#term-iterable
- ipsum2 9y agoI've been bitten by this bug before, PHP's associative arrays are pretty strange compared to other languages.
- osrec 9y agoI find it easier to think of them as an "ordered" hash map rather than an array...
- igravious 9y agohttp://php.net/manual/en/language.types.array.php http://php.net/manual/en/language.types.array.php First sentence, “An array in PHP is actually an ordered map.”
- pmarreck 9y agoI just read at least half that page and this idiotic design confirms exactly why I feel PHP should be considered harmful
- osrec 9y agoI don't think it's harmful. You just need to know what you're doing. PHP gets a bad rep round here unfairly. It's actually a very useful language which has proven itself over and over again in the wild. I wonder what you think of JavaScript?
- agency 9y agoJavaScript does. var arr = ["one", "two", "three"]; arr["2"] === "three"; // true
- marcins 9y agoJavaScript object property keys are always strings, so technically it’s `arr[2]` that has the 2 coerced to a string.
- Legogris 9y agoActually, that is incorrect. Arrays are different in JavaScript. I don't have time to look up the exact reference, but to get an idea: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe... > Arrays cannot use strings as element indexes (as in an associative array) but must use integers. Setting or accessing via non-integers using bracket notation (or dot notation) will not set or retrieve an element from the array list itself, but will set or access a variable associated with that array's object property collection. The array's object properties and list of array elements are separate, and the array's traversal and mutation operations cannot be applied to these named properties.
- Zalastax 9y agoIt's true that object keys are strings, but the array and object situation of JavaScript is quite confusing. Arrays are indexed by numbers, but still accept string indices, leading to behavior like this: https://stackoverflow.com/q/9526860 https://stackoverflow.com/q/9526860
- CivilEngineer 9y agoDon't make the PHP zealots angry!
- V-eHGsd_ 9y agoanother facebook doozy was their "view my profile as <user>" feature. Apparently for some time after that it was released, when you used it view your profile, you could interact with facebook as <user>; including chatting as them, reading their messages, etc. but then, I've had my share of turrible bugs too, so i'm not here to poke fun.
- djsumdog 9y agoI first started using Twitter in the late 2000s and got my friends using it with SMS. We used it similar to a group chat/hangouts. ..it did get annoying after a while.
- smelendez 9y agoFacebook had this bug as far as accepting group requests very early on, maybe around 2010. Early enough that groups were limited to your college. I wrote a script to accept invitations to every group ID from 1 to 10000. It even added me to groups that didn't exist yet, presumably just adding my ID and the group ID to a table. So when someone created a group to rant about me being in all their groups, I was in it and, as the first member, an admin. Facebook fixed the bug when I reported it and first kicked me out of my legitimate groups, then fixed that too, though they didn't pay bounties then.
- rayascott 9y ago“Next time you make a seemingly obvious mistake, don't feel too bad. Even Twitter did it.” There most infamous “mistake”, at least as I see it, was neglecting to backup their database data. That was just unforgivable.
- pmarreck 9y agoI bet they had a backup, it was just never tested... pretty common mistake
- rayascott 8y agoNope, no backups were even created when Dorsey was in charge: “Oh, and while he was in charge, there was no backup of Twitter’s database.” From the Fortune article “Let's remember why Jack Dorsey was fired as Twitter's CEO” http://fortune.com/2015/09/30/jack-dorsey-twitter-ceo-fired/ http://fortune.com/2015/09/30/jack-dorsey-twitter-ceo-fired/
- pmarreck 8y agowhat... the fuuuu
- muthuraj57 9y agoTheir