Geschichten aus dem Serverraum

Wall of Shame: curl | sh

01. Juni 2022 — Felix Pankratz


Many online tutorials explaining how to install software provide installation instructions similar to this:

curl -sSL | sudo sh

This is bad advice. You should not run commands like this blindly!


The above command gets a script file from the internet, and executes it as root without you knowing what's going on. This also applies to installations in your user context (no sudo/su). Call me weird, but I like to take a look at what a script from the internet is doing before I run it.

Even if you trust the source, there still exists the possibility of a compromised supply chain - someone unauthorized might have added something nasty to Filip has a very nice blog post about the attack surface offered.

So please, for your own and your devices safety, review installation scripts.



$ curl --proto '=https' --tlsv1.2 -sSf | sh

"The Rust Programming Language", also known as "the book", is the very first thing recommended to people wanting to learn Rust by the official website. The installation section provides this snippet.


sh -c "$(curl -fsSL"

sh -c "$(wget -O -)"

We're getting advanced - providing both curl and wget directly on the homepage!


curl | sudo bash

Now what is this, a Step 2 in the install instructions for Ubuntu and Debian.

Tags: wip, en, admin, security