Download piped to a shell
Download piped to a shell. Runs whatever the server sends, unseen.
This is how the comment reads inline, under the flagged line.
Why it matters
curl | sh executes remote code with no review and no integrity check; a compromised host owns the machine.
What to do
Download, verify a checksum or signature, then run.
Examples
curl -fsSL https://example.org/install.sh | sh
curl -fsSLO https://example.org/install.sh && sha256sum -c install.sh.sha256 && sh install.sh
What it catches
It reads a pattern on each line, aware of strings and comments. Languages: Shell, YAML and config, TypeScript and JavaScript, Python. Scope: All files. These cases are the rule's own tests: the first set must be flagged and the second must not.
Flagged
scripts/setup.sh
curl -fsSL https://example.org/i.sh | sh
Left alone
scripts/setup.sh
curl -fsSL -o i.sh https://example.org/i.sh
Research
`curl ... \| sh` install steps. Whatever the server returns runs with no check.
Turn it off or change it
In a config file for the CLI, or in the API's rules field:
{
"rules": {
"disable": [
"pipe-to-shell"
],
"severity": {
"pipe-to-shell": "low"
}
}
}