News for hackers. Stuff that matters.
Re:Null by pixl97 on Thursday January 14, 2021 @12:28AM (#25772481)
>While I’m not a QA or security professional, I have developed a knack for doing “stupid” things with software which causes it to malfunction.

A person after my own heart.

I've had many a dev go "why would you do that"

In which I answer "it doesn't matter, but if you accept my input it's your job to ensure the app doesn't crash"

Re:Null by rkangel on Thursday January 14, 2021 @08:56AM (#25776261)
We have an excellent (and big) QA department, but 13 years ago when I started at this company we were only just beginning to hire dedicated testers. We had a mature product which was a communication handset and it worked well and was stable. Our software engineers had pressed every button they could think of in every menu and there weren't any problems.

Then we hired Kevin.

Kevin had the handset for 40 minutes before piping up "crashed it". The lead comes over to have the sequence explained to her, and says "huh, nice edge case". Half an hour later "crashed it again" (in a completely different way). Explains the sequence to the lead again. An hour later this happens again and he explains the sequence and she finally bursts out "Why would you even do that?! How did you think of pressing those buttons like that with that timing?!!".

Good testers just think differently than software engineers.

Re:Null by Ashanmaril on Thursday January 14, 2021 @11:03AM (#25777971)
I'm pretty sure I subconsciously try to use my software safely and as-intended cause I don't want to crash it. Obviously saying out loud I know this is dumb, but why would I want to break something I created?!

There aren't any bugs as long as I don't look for them!

Re:Null by nkrisc on Thursday January 14, 2021 @10:50AM (#25777760)
A good tester looks at all the expected cases, and then infers all the cases that exist in between those. They explore the negative space between what we're supposed to do.
Re:Null by thih9 on Thursday January 14, 2021 @10:20AM (#25777326)
> Good testers just think differently than software engineers.

I'm sure in some cases it's useful to detect all possible crashes, e.g. to make an app as secure as possible. In other cases I'd watch out for diminishing returns; perhaps instead of "think differently than software engineers" it would be enough to "think in the similar way as product users".

Re:Null by rkangel on Thursday January 14, 2021 @10:30AM (#25777492)
There's a consideration about number of users. If 100k users are using your product a lot, in a similar way to the 'million monkeys' thing they're accidentally going to find bugs.

Software engineers tend to use products in a consistent way (based on how they know it's meant to be used) whereas good testers explore the space of possible inputs in a much more 'creative' way.

Re:Null by thih9 on Friday January 15, 2021 @06:32AM (#25789635)
> good testers explore the space of possible inputs in a much more 'creative' way.

My point is that the extent of testing should depend on the actual product; eliminating all bugs is not the primary goal of every team.

Some companies might decide on other goals and prioritize e.g.: just paying users (giving them better support to resolve issues), or acquiring new users, or something else.

Re:Null by ygra on Thursday January 14, 2021 @09:47AM (#25776887)
For a long time I've had my full name as user name on my machine, which meant that my user profile path contains both a space (evil) and a non-ASCII character (even more evil, although it's in Latin 1 at least). A lot of things break on one or both of those things and at times it's a bit annoying to deal with. Some bug reports have also been closed as "Won't fix, just don't do that. Who needs spaces in paths, anyway?". I haven't tried to use non-Latin Unicode in my user name and profile directory, which would break everything that uses the old ANSI APIs on Windows instead of the Unicode ones, and that's probably way too much breakage. But broken nonetheless, and that includes a lot of new, recent, and still-maintained software :-/

In a similar vein, I've also used U+2212 as minus sign in my regional settings. There's a lot of software that refuses to parse numbers it previously happily emitted.

I've given up on that too, by now, though. The only thing I still do is using English as UI language (so I don't have to deal with bad translations of software), but German as my regional settings (with ISO 8601 dates). There's a lot of software out there (I think GNU gettext is broken in that way on Windows) that assumes that the way I want my dates and numbers formatted has any bearing on the language I want to see in an application. Many others don't care about the regional settings and use the UI language to also format dates, times, and numbers. That's annoying, but at least nothing breaks, so that's the only deviation from the standard user I still use, to still be able to work.

Re:Null by josephg on Thursday January 14, 2021 @12:49AM (#25772606)
Mine too.

I write a lot of javascript and the string "null" is pretty harmless in most code. But there's all sorts of fun bugs (and often security vulnerabilities) you can find if you make an identifier "__proto__". (If code ever uses that as the key in an object, you're off to the races!)

Re:Null by steinuil on Thursday January 14, 2021 @03:53AM (#25773861)
Nice, I never thought of testing with "__proto__"! "constructor" is also a fun one.
Re:Null by msh on Thursday January 14, 2021 @02:45AM (#25773387)
Why do you require software to be more resilient than other things?

If I pour water in the gastank of my car, it will also fail to drive. Or gas in the sprinkler tank. So the car should somehow prevent the enduser putting the wrong thing in the tank?

Re:Null by Mountain_Skies on Thursday January 14, 2021 @03:19AM (#25773630)
The answer to this should vary by the functionality of the software. If I have a program that calculates projected weight loss and it's only used by me on my computer, crashing or displaying obviously incorrect values from accepting negative values for weight or body fat percentage only impacts me so it's mostly a user friendliness issue. If I'm entering my billable time into my employers time tracking system, anything that could corrupt data impacts more than just me. While I could intentionally lie about my billable hours without detection, I shouldn't be able to accidentally or intentionally enter that I worked -5 hours or 5000 hours on a particular day. Accepting either is undesirable and impacts others.

I'm confused why the parent comment is being downvoted. It's a valid question. It might sound naïve to some but it's still worth discussing.

Re:Null by unhammer on Thursday January 14, 2021 @06:30AM (#25775120)
If cars were used like software, fire engines would be dragging around truckloads of cars turned sideways with their gas tanks filled with water. Long-range drones would be flying around filling tanks of random parked cars with glue/sugar/squirrels/nuts covered in glue/sugar/other cars/fire engines/the tank itself.
Re:Null by tener on Thursday January 14, 2021 @04:42AM (#25774242)
We require software to be resilient because it is used as a building blocks for large (sometimes exteremely so) systems. The deeper in the stack something is, the more costly the failure. A human may not input any of those strings. Another software (which does not reason in any way about the data it is processing, unlike the human) may do whatever.
Re:Null by rakoo on Thursday January 14, 2021 @05:39AM (#25774782)
If you look at the bugs in the article, they're not that foolish. They're basically perfectly valid things to be able to do: entering text in a text field, or pressing buttons to do things. There is a specific set of valid input for your gas tank, but anything that is text should be accepted for text input.

The analogy would be something like that:

- if I throw spaghetti on my windshield, my car shouldn't break down

- if I hold the wiper's stick to the position that runs it once (instead of putting it in the position to continually run) my car shouldn't break down

Re:Null by pjc50 on Thursday January 14, 2021 @05:37AM (#25774765)
If I pour water in my gastank and it gives me the private social media posts of a million people, that might be a problem for more than just me.
Re:Null by masklinn on Thursday January 14, 2021 @03:11AM (#25773556)
> Why do you require software to be more resilient than other things?

Because software by virtue of not requiring physical access is much easier for bad actors to mess with.

Abuse of such also seems to be classified very differently than abuse of physical systems by human brains e.g. almost no rando would think of putting sugar in your gas tank while walking near your car, but nobody blinks at fucking with your input fields.

Re:Null by david422 on Thursday January 14, 2021 @10:25AM (#25777402)
I think the answer is - because the software can. And most of the time, the software can be more resilient with a trivial amount resource usage.

If there was a physical device that could filter gas and non-gas liquids that could be installed in a car we would expect car manufacturers to do that.

I have seen software that puts the onus on users to use it correctly "Hey user, don't enter more than 5 items in this list". Because the software can't be bothered. And if the user enters 6 items in the list and the software crashes and the user loses all their work, everybody can point at the user and tell them it's their fault for not following directions. But personally I'd be embarrassed if that was my software.

Re:Null by pitay on Friday January 15, 2021 @12:18AM (#25787287)
If there was a physical device that could filter gas and non-gas liquids that could be installed in a car we would expect car manufacturers to do that.

There is one thing they could do to stop people putting the wrong liquid in their car. That is to key the nozzle to only fit cars which support their fuel, so petrol pumps nozzles only correctly fit petrol cars, diesel pumps only fit diesel cars.

Completely agree with you on you main point, software should be made correct and resilient (more than other things) because it can be made so.

Re:Null by seren1 on Sunday January 17, 2021 @02:33AM (#25808952)
Having owned a diesel car, I can confirm this is actually the case. The nozzles where I live are are keyed to prevent mishaps.
Re:Null by iforgotpassword on Thursday January 14, 2021 @02:56AM (#25773457)
Holding down the button for your hazard lights should not break your car. Holding down a key should not crash an app.
Re:Null by mcosta on Thursday January 14, 2021 @07:58AM (#25775790)
Holding down a pedal probably is going to crash your car.
Re:Null by ultinick on Thursday January 14, 2021 @09:10AM (#25776400)
Only 1 in 3 chance
Re:Null by jfk13 on Thursday January 14, 2021 @09:20AM (#25776509)
I see you don't drive an automatic.
Re:Null by CRConrad on Friday January 15, 2021 @07:24AM (#25790112)
I think I can sit in my car with a foot on the brake pedal all day long and it won't break the car.

Your proposed problem will probably only affect bad spellers, who have a break pedal.

Re:Null by taneq on Thursday January 14, 2021 @05:20AM (#25774619)
Because software has hundreds or thousands of tanks, compartments, cogs, levers, buttons and switches. And if it's not designed robustly, using any one of those things slightly wrong (or even right, but there's a bug in the software) can make the entire thing disappear in a cloud of smoke, taking your groceries with it.
Re:Null by yitchelle on Thursday January 14, 2021 @05:26AM (#25774673)
The funny thing about this comment is that it is also applicable to the software in the car. The amount of software in today's car is mind boggling, and it grow exponentially as more and more features make it to the public roads.
Re:Null by taneq on Thursday January 14, 2021 @06:23AM (#25775062)
Absolutely! And we're even less tolerant of software errors (even ones without safety implications) in vehicles (and other appliances) than on computers.
Re:Null by jl6 on Thursday January 14, 2021 @02:55AM (#25773454)
“Using it wrong” is usually quite obvious with real-life machinery. Software has many more ways of using it wrong that are very unobvious, that the user has no reason to suspect could be dangerous, and that have never been seen before.
Re:Null by martijnvds on Thursday January 14, 2021 @03:01AM (#25773492)
Pumps for different types of fuel have differently shaped nozzles here, making it very hard/impossible to fill up with the wrong kind.

Of course if you're trying to break it, everything is possible.

Re:Null by gvb on Thursday January 14, 2021 @09:46AM (#25776867)
I don't know where your "here" is, but here in the USA, you cannot put diesel in a vehicle's gas tank, but you can put gas in a vehicle's diesel tank. Putting gas in a diesel vehicle is very bad.

Reason: The gas nozzles dispensing unleaded gas were made smaller to prevent people from putting leaded gas into a vehicle that required unleaded gas (which would poison the catalytic converter). The diesel nozzles remained unchanged and leaded gas (with the big nozzles) went away.

Re:Null by imoverclocked on Thursday January 14, 2021 @09:58AM (#25777022)
Consumer diesel vehicles often have a mechanism to (try to) prevent the insertion of a gas nozzle.

Source: I had one of those “evil” Jetta’s

Re:Null by toast0 on Thursday January 14, 2021 @12:46PM (#25779488)
As imoverclocked mentioned, some vehicles (VWs mostly AFAIK) have contraptions in the filler tube to attempt to prevent filling with unleaded gas. Of course, they don't quite work (at least the retrofit ones don't), which I know because some of the diesel pumps have the unleaded size nozzle, and I've filled with those, it just takes a lot longer.
Re:Null by lvturner on Thursday January 14, 2021 @04:05AM (#25773945)
Re:Null by bregma on Thursday January 14, 2021 @07:45AM (#25775706)
Sugar is a fuel and it just slides right in to the tank. Try it.
Re:Null by gfxgirl on Thursday January 14, 2021 @06:00AM (#25774921)
maybe not relevant here but my first thought to your question out of context is scale. My house can be easy entered by anyone determined to enter it. They can bust the door down, break the windows, crash a vehicle into it. And yet, almost no one is actually trying to get into my house. Conversely, 1000s of people and possibly hundreds of thousands of bots are trying to break into any software they can that is exposed on the internet (or possibly exposed in other ways like I have no idea if every app on my PC/Mac/Phone/Tablet is scanning my network for devices with known exploits)

So, the security of my house (at least where I live) does not have to be so resilient but the security of much of my software does.

https://www.youtube.com/watch?v=VPBH1eW28mo

Re:Null by enobrev on Thursday January 14, 2021 @08:59AM (#25776295)
With physical things, if I do something stupid, I blame myself. With software, if it allows me to do something stupid, I blame the software. Unfortunately, the same mindset carries for clients, employers, and other various people using software who will report said stupidity to me, my client, or my employer.
Re:Null by FalconSensei on Thursday January 14, 2021 @05:03PM (#25783311)
Like, putting water on the gas tank is obviously wrong, as it's called a gas tank, and gas cars don't tend to run on water.

Clicking a button that was enabled for me and does many things in the background is not so obvious.

Also, cars have been accessible to everyone way longer that PCs and smartphones. Most people alive today (in developed countries/areas) saw their dads driving when they were kids. A person in their 60s didn't have a PC when growing up

Re:Null by CRConrad on Friday January 15, 2021 @07:28AM (#25790143)
I think not even most people in their fifties did. Forties, maybe.
Re:Null by huffmsa on Thursday January 14, 2021 @04:50AM (#25774338)
There are also warning labels all over the various fill caps on a vehicle. "Unleaded gasoline only". Which are like real-world input validation. It's just not feasible to check the fluid before allowing it in. But is is feasible to add a data validation layer to your application.
Re:Null by alpaca128 on Thursday January 14, 2021 @06:33AM (#25775147)
The car equivalent would rather be something like entering "null" as address in the car's GPS and this causing the entire town's traffic light control to crash. Wouldn't be that funny, would it?

Then there's just annoying stuff like the case where someone paid to have "null" on their car's license plate, which suddenly caused him to get all traffic tickets that could not be correctly addressed.

Re:Null by layer8 on Thursday January 14, 2021 @06:49AM (#25775271)
Because with software you can’t generally predict the consequences, even more so as software tends to not be static, but evolves and starts to interact with more and more other software.

Validate your inputs. Be very careful with in-band special values and escaping syntax. Don’t make any assumptions about what is “reasonable” input. If you have to make assumptions, document them and validate all input for conformance. Always check what requirements and preconditions the code you call has on the values you pass to it. Don’t just make assumptions about it.

Re:Null by bregma on Thursday January 14, 2021 @07:51AM (#25775749)
Because it's just software. You can just change it and it costs nothing. Redesigning the powertrain in your car to be resilient when non-gasoline is introduced into the combustion chamber is expensive. Redesigning software is just changing some code; you just need to say something like 'Zoom. Enhance.' or 'It's a Unix system! I know this!' and it will take care of itself after a dozen rapid random keystrokes.
Re:Null by FalconSensei on Thursday January 14, 2021 @04:57PM (#25783231)
> If I pour water in the gastank of my car, it will also fail to drive.

But I'm pretty sure the manual say you shouldn't do that. Like microwaves say you can't put living animals in it.

Re:Null by 3pt14159 on Thursday January 14, 2021 @02:56AM (#25773461)
Because often times crashes in an app lead to information exfiltration or remote code execution.
Re:Null by mikeyjk on Thursday January 14, 2021 @02:56AM (#25773462)
Security implications, I would imagine.
Re:Null by Lazare on Thursday January 14, 2021 @08:47AM (#25776180)
There's a few answers here.

First off, we expect all things to be as resilient and reliable as makes sense via a cost benefit analysis. If it's cheap to fix, and expensive not to fix, we expect it to be done. If it's expensive to fix and cheap to ignore, we expect it not to be done. And of course, if it's impossible to fix, we definetly expect it to be ignored. :)

So, we expect that cars should NOT catch fire when rear-ended, because it's possible to design them not to do so, it's not that expensive to design them not to do so, and innocent people could be seriously harmed through no fault of their own.

But water in a gas tank? I can't think of a way to stop someone doing that. And it would just disable the car if you did it. And since cars have locking fuel tank covers, you're really limited in your ability to maliciously harm other peoples cars.

So in the case of cars "explodes when rear ended" is not okay but "stops driving when you fill the tank with water" is okay.

Software, by its design, is often more fixable than other things. You can filter the inputs to a log in form whereas you can't really filter "things people might put in their kitchen blender".

Second, note that software is, bluntly, a lot less resilient than most things. I've got a hammer sitting in my garage, and it's just going to sit there until I do something with it. It won't randomly stop working, it won't auto-update to a version that is incompatible with my nails, it won't be remotely hijacked by Russian scammers to break into local businesses, it doesn't need patching. There will never be a CVE for this hammer. :) I've had it for many, many years, and I'll have it for many many more, and it will be just as good a hammer in 10 years as it was when I got it. We can't say the same thing for software. And since software is just way more of a dumpster fire than "normal" things, we have to expect that more work will need to be done to counteract that.

(There is, as always, at least one relevant XKCD here. In this case, I think https://xkcd.com/2030/ is on point. The more you know about software engineering, the more you'll realise the entire thing is held together with bailing wire, duct tape, luck, and an intern trying to live edit the production database to fix the data errors before anyone notices.)

Third, and very much related to the last two points, consider the scale. Your car's gas tank, or your building;s sprinkler tank, are vulnerable to various attacks, but it's not vulnerable to being attacked remotely and untraceably by almost anyone on earth via a number of low skill attacks. And of course, software also can yield larger rewards. If the local corner store has a dodgy lock, maybe you could break into it (at significant risk to yourself!) and steal some cash from the till. If you can compromise the head office network of a major retailer, you could steal millions of dollars.

Edit: Also, I'm aware of a nationwide outage for a pizza chain caused by a phonebook. There was an internal webpage that some stores looked at occasionally to show stock levels or something similar. It was quite a slow/expensive page to load, but because it was loaded quite rarely, and only by a small number of internal users, it didn't have a lot of cacheing or rate limiting on it. Someone in one store shifted something on their desk, then walked off. This caused a phonebook to shift, and depressed their F5 key. That caused their browser to start refreshing this page very, very rapidly - multiple times per second. The load from this actually overloaded the central servers, and the entire system went down, stopping orders from being placed or printing out. So it might seem silly to say "hey, what happens when I do this thing I shouldn't do", but actually, over time, all sorts of things that "shouldn't happen" will happen for some reason or other. If the result is that every store of a nation-wide chain goes offline, that is....not great. And software is just way more prone to these sorts of things than others. If you tell me there's a vulnerability that lets people easily open the door of any hotel room at a large chain, I'll instantly bet you $20 it involves smart locks, NOT traditional mechanical keyed locks. (And indeed, that's happened more than once, and it's always been a smart lock to my knowledge.)

Re:Null by bhrgunatha on Thursday January 14, 2021 @01:52AM (#25773033)
A favourite technique of one of my colleague's was just to mash the keyboard randomly to see if the app breaks.

It's very crude and not at all foolproof. For the lack of sophistication it's shockingly effective at highlighting a huge amount of assumptions we make about how software is / can be used.

Re:Null by capableweb on Thursday January 14, 2021 @05:35AM (#25774752)
This even has a name, "monkey testing". Basically some software that pretends to be a monkey in front of a computer and mashes random buttons and keys to make the application behave badly. Usually you only care about the application not breaking in monkey tests. Can be used similarly to "fuzzing" but for UIs as well, see Gremlins.js: https://marmelab.com/blog/2020/06/02/gremlins-2.html
Re:Null by chowells on Thursday January 14, 2021 @06:08AM (#25774956)
Re:Null by sethammons on Thursday January 14, 2021 @07:59AM (#25775808)
This is how, at age 12 or so, I discovered in the old Windows game “Chip’s Challenge” that you could cheat and unlock (nearly all) levels.

If you tried ctrl+n (I think), you could advance to the next level, but only if you had beaten the current level or had the pass code for the level. In a bout of frustration, I rando-mashed the keyboard and advanced to the next level, and could then ctrl+n to the last level! I could reproduce the effect, but never worked out the actual combination that unlocked it. Good times :)

Re:Null by jsrcout on Thursday January 14, 2021 @03:14AM (#25773575)
One of my professors back in college loved to do that. "Shockingly effective" is exactly the right term. Learned a lot from that little exercise.
Re:Null by jannes on Thursday January 14, 2021 @04:15AM (#25774008)
This makes me wonder if there's a tool that can auto-generate random inputs and send them to the application. (maybe excluding Alt-Tab to avoid switching away from the application)

Fuzzing is a pretty popular testing technique for libraries, but GUI software has not seen the same attention.

Re:Null by dgellow on Thursday January 14, 2021 @05:12AM (#25774563)
GUI fuzzing is a thing, yes. I've seen it mostly on mobile apps but I'm sure you have it for other type of GUIs.

Example of tools: https://www.fuzzingbook.org/html/GUIFuzzer.html

Re:Null by taneq on Thursday January 14, 2021 @05:25AM (#25774660)
GUI fuzzing was a thing way back on the original Macintosh: https://www.folklore.org/StoryView.py?project=Macintosh&stor...

Something similar should be reasonably easy to build these days using AutoHotKey or the like. I bet it's been done.

Re:Null by vsareto on Thursday January 14, 2021 @10:14AM (#25777236)
>In which I answer "it doesn't matter, but if you accept my input it's your job to ensure the app doesn't crash"

This is how try/catch alls get added :(