Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on No one expects command execution. Parent comment
It does:
irb(main):001:0> gets.tainted? foo => true
freya:~ flgr$ ruby -e '$SAFE = 1; system "tar bla bla #{gets}"' foo -e:1:in `system': Insecure operation: -r (SecurityError) from -e:1:in `<main>'
There are no comments on this comment yet.
It does:
You can even set $SAFE to 1 or higher to disallow the use of tainted strings in potentially dangerous commands: See http://phrogz.net/programmingruby/taint.html for more information.