Show HN: Inspect questionable scripts before piping them to sh or bash
github.com
github.com
It is known that piping unknown scripts to bash is a bad thing. So when somebody decides to pipe into bash, they are either (1) sure of the source or (2) completely clueless about what the hell they are doing. In case (1) there is no need for the tool, and in case (2) asking "do you really want to run this?" will not make any difference since they just typed 'curl <whatever> | sh' into their shell.
Just: $ sandbox 'curl http://whatever | sh'
With predefined permission profiles or interactive permission system.
An even better idea is jails, or something like Docker.
Jails or Docker are practically heavyweight sandboxes and they need root access.
curl ... | lessThats generally what I do when I encounter the curl -> bash instructions on the web.
EDIT More info. Yes this is better than curl ... | sh. But less has a lot of functionality (more than you'd expect) and a carefully written script could exploit some of this.
Basically the tldr is that gnu less is a program that has been engineered to do a lot of things over the years and this has created attack surfaces which mean that if someone was to curl .... | less on a carefully designed payload it could allow the payload to obtain a shell.
I wasn't saying that it isn't safer just that it isn't totally safe.
We live in an era of unsigned images and arbitrary code. This is about time and money, and I don't think any amount of astonishment from the larger community is going to reverse that trend.