Re:Don't Pipe to your Shell
by FiloSottile on Thursday October 31, 2013 @11:13PM
(#6651584)
Again, here is the counter-point of the author
> This might be unlikely, but the results of this happening, even once, could be catastrophic.
Also, you don't have to kill any process, that was a PoC by the author. The scenario is a connection drop.
Counterpoint to the author: have you ever heard of anyone ever having anything catastrophic happen because of this, ever? Have you ever heard of anyone even having it fail with garbage?
I haven't.
Re:Don't Pipe to your Shell
by mikegirouard on Friday November 01, 2013 @01:22AM
(#6651942)
Catastrophic? I can't claim that. But I can tell you that I had a server drop out on me when installing software this way. Here's a quick quote of the bug report I sent to Linode when I was installing Longview.
> Bug: Update the nginx (?) error pages to be bash friendly
>
> root@marius ~]# curl -s https://lv.linode.com/nGiB | sudo bash
> bash: line 1: html: No such file or directory
> bash: line 2: syntax error near unexpected token `<'
> 'ash: line 2: `<head><title>502 Bad Gateway</title></head>
>
> This could be done by just dumping out echo statements since its already
> being parsed by the shell. Additional meta about the request (headers, etc)
> could be dumped into comments too…
>
> # 502 Bad Gateway
> echo
> echo "Uh oh: Something went sideways during the install!"
> echo "("
> echo "Re-running the installer should clear things up."
> echo
> echo " sudo !!"
> echoYep, I agree this is generally bad practice and is prone to error conditions, but I am mainly addressing the article since it is claiming that this should never be done because of the possible catastrophic consequences, and I just don't think that scenario is likely enough to mount a campaign to abolish this practice :)
How many would talk about a catastrophic failure that was caused because of their stupidity.
Many wouldn't.
You're right, let's ignore completely realistic failure modes just because nobody's had it happen yet.
Statistically a cosmic ray flips a few bits in your RAM every year. Theoretically those bit flips could transform a benign program into a malicious one, and I'm sure that's happened to somebody somewhere sometime.
But it's very unlikely to happen to you tomorrow. You could use ECC RAM to prevent this from happening, but how many people do that?