4 ms·
Interesting read, but as a programmer I wonder.. Who builds a feature that allows users to input arbitrary strings, turns them into unchecked commands from a pr
by atoav 5y ago
Interesting read, but as a programmer I wonder.. Who builds a feature that allows users to input arbitrary strings, turns them into unchecked commands from a process that runs as root and has no logging and after all of this doesn't realise this on the spot with the hands still on the keyboard that this smells like trouble? If any collegue of mine would do this I either suspect a backdoor or incompetence on such scale they shouldn't have the job in the first place.
This is like seeing a four inch crack during the construction of a bridge and still pressing on till it collapses. No, it actually is like planning a four inch wide crack into a bridge and finding it through a random inspection a year after. It should not only never happen, it should never even have been considered.
I understand that implementing a quick "do whatever you want"-feature might be practical but:
- anything that could get arbitrary strings from network input (or from anything other that has network input) needs to be validated and sanitized
- anything that dispatches commands on a machine from user/network input should run with the lowest possible privilege
- whitelisting is always simpler than blacklisting, but never understimate what a few whitelisted unix commands with arbitrary arguments can do. Maybe writing your own simple DSL is better for such a use case. It could even turn out to be a selling factor if it has a nice GUI
- brianpan 5y agoLet me make this quick tool for the development environment. I'm not sure what else we'll need, let me add some pre/post flexibility. We have this useful tool let's use it for more things. Let's standardize on this. Who wrote this? It's ok, we'll do a readiness review. We have WHAT in production? This is going to make a crazy blog post.
- atoav 5y agoI understand that, but the blog post specifically wrote about customers running that code. Sure I sometimes have a little high standards compared to others, but how are we ever gonna fix software if we don't stop with the "let me quick..." If you e.g. handle private data of people you should code as if every character you type had the ability to leak a persons data forever (because often it has). Programming is beautiful because it multiplies. If you do a good job, the fruits of your work can make many peoples lives better. The same is true into the other direction: With great power comes great responsibility. I also happen to be a certified electrical engineer. There you also have situations where you'd want to "just quickly" fix something. Only that you don't do it because you would be liable if you burn someone's house down or kill them. I'd love for the whole field to get a little bit more serious about the impact our work has if done badly.
- cranekam 5y ago"Customer" here meant "another team at the same company running code on the same common platform". It's not like this thing was providing backdoor access to a Mom & Pop pizza shop. (Source: familiar with the incident)