# Don't pipe curl to bash in a Dockerfile

RUN curl -fsSL https://example.com/install.sh | bash builds whatever that URL returns today. The check reads the Dockerfile. It does not download the script.

Published 2026-11-16.

## The pipe is the finding

The line is `RUN curl -fsSL https://example.com/install.sh | bash`. `wget` piped to `sh` is the same shape. The remote-script check looks for a Dockerfile `RUN` that downloads with curl or wget and pipes it to sh or bash. It reads the Dockerfile text. It does not fetch the remote script.

A download that is saved to a file and not piped to a shell is not this finding. `RUN curl -fsSL https://example.com/install.sh -o install.sh` does not match. The same pipe in a package.json `postinstall` script is a different check.

## Read the file, then pin the sum

The suggested next step is to download the script, review it, and pin a checksum before you run it. Saving the file is what takes the line out of this finding. The checksum is still the next step the check names, because a later build can fetch a different file from the same URL. The check does not fetch the script, so it cannot tell you the sum is the one you read.

Write the script to a file, check `sha256sum -c` against the sum from the copy you read, then run that file. Drop the Dockerfile on the review and point at the `RUN`. A pipe to `bash` or `sh` is the line to change.

## Related

- [Remote script piped to a shell](https://skaleagents.com/checks/remote-script-piped-to-a-shell)
- [Package script piped to a shell](https://skaleagents.com/checks/package-script-pipes-a-download-to-a-shell)
- [End the Dockerfile on a user](https://skaleagents.com/blog/dockerfile-user-is-not-root)
