News for hackers. Stuff that matters.
Re:Shelling Out Sucks by joeyh on Sunday March 11, 2012 @11:40AM (#3690519)
Your quoting of "$0" does not protect it from the shell. An attacker need only provide an input such as: /tmp"; rm -rf /; "

There are pipeline libraries that avoid the shell for several languages. Some I can recommend:

* libpipeline http://libpipeline.nongnu.org/ easy, if somewhat verbose, pipeline construction in C.

* hsh https://github.com/jgoerzen/hsh/wiki makes pipelines in haskell, using operators so they really look like pipelines, but without involving the shell. Example: "ls -l" -|- "wc -l"

Re:Shelling Out Sucks by sigil on Sunday March 11, 2012 @01:24PM (#3690704)
Your quoting of "$0" does not protect it from the shell. An attacker need only provide an input such as: /tmp"; rm -rf /; "

Not true.

  $ sh -c 'ls "$0"' '/tmp"; rm -rf /; "'
  ls: cannot access /tmp"; rm -rf /; ": No such file or directory
If you were right, there would be no reasonable way to write shell scripts.
Re:Shelling Out Sucks by joeyh on Sunday March 11, 2012 @10:43PM (#3692133)
My mistake, not knowing python's variable interpoltion well, I thought that the $0 was expanded by it, not the shell. Which, if it were the case, would indeed be vulnerable.

Isn't it a bit harsh to downvote to -1 a comment which links to two completly on-topic libraries?

Re:Shelling Out Sucks by NinetyNine on Monday March 12, 2012 @04:11AM (#3692701)
Your comment would be correct if it were PHP.
Re:Shelling Out Sucks by sigil on Sunday March 11, 2012 @11:11PM (#3692188)
I didn't downvote you, fwiw.