Live data from Hacker News

Show HN: Checksum.sh verify every install script

checksum.sh

71–77 of 77 posts

Re: Show HN: Checksum.sh verify every install script

#71

I think this is a worthy cause, but maybe a little misguided: the problem with "curl-piping" isn't so much the fact that you're throwing a random shell script into your shell, but the fact that you're downloading arbitrary code in a way that's disconnected from the normal integrity/authenticity guarantees of a package manager. In other words: you can be confident in the bootstrapping script you've just downloaded bec…

> the fact that you're downloading arbitrary code in a way that's disconnected from the normal integrity/authenticity guarantees of a package manager.

I'm old enough to remember when apt packaging got burned because it used http instead of https even though apt packages get signed.

If you're downloading software from websites protected with HTTPS, and that's good enough for you, then downloading and executing a script from those same websites using HTTPS is also good enough.

Would it be better if those things were signed with a key for which there is a code signing certificate? Eh, maybe, yes, if the PKI for the code signing is sufficiently better than WebPKI, which... is not necessarily obvious. Meanwhile, access to that PKI is probably sufficiently harder to come by than WebPKI TLS server certificates that a lot of people don't bother, and rightly so.

Now suppose you say "I don't trust this, I'm just going to clone their github repo and build from source". Do you get more protection that way? Maybe, maybe not.

Now, if you get packages from Debian and the like, you get them signed, and maybe the person who contributed the package to their repository did a thorough code review and audit of the upstream they are packaging, or maybe not, who knows.

This is why containerizing this stuff helps. But it's not really accessible to people yet.

What might be nice is that any program that a user executes automatically gets some level of isolation corresponding to how it was delivered, authored by whom, etc. So programs from the OS get the least isolation, and programs written by the user less isolation, and programs of unknown provenance get the most isolation.

Re: Show HN: Checksum.sh verify every install script

#72

>I've found it a really useful tool for installing things like Rust or Deno. For Rust you can ignore sh.rustup.rs and just download and set up rustup manually. CARGO_HOME="${CARGO_HOME:-$HOME/.cargo}" mkdir -p "$CARGO_HOME/bin" curl -Lo "$CARGO_HOME/bin/rustup" 'https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-gnu/rustup-init' chmod +x "$CARGO_HOME/bin/rustup" hash -r rustup set auto-self-update disable…

Awesome, that avoids downloading and running executable code from the Rust project!

Re: Show HN: Checksum.sh verify every install script

#73

I don't know; what's the threat model here? If the script is deliberately malicious as originally published, then the publisher will provide a valid checksum; so it doesn't help. If the script source is subverted by an attacker, then it only helps if the attacker doesn't also have the means to change the published checksum too. If an attacker can modify the site which publishes the URL for the script and the checksum…

That’s right. The checksum shouldn’t be provided by the site. I’m producing the checksum myself after reviewing the install scripts manually. Once I produce the checksum I can keep relying on it. The install scripts don’t tend to change very often.

That makes some kind of sense. The original post makes you sound like you're one of those crazy people who thinks e.g. Flatpak is fine but curl | bash is horribly insecure.

However I'm still not sure it really makes sense. Do you also manually review the code of the binaries that the bash scripts download?

Re: Show HN: Checksum.sh verify every install script

#74

>I've found it a really useful tool for installing things like Rust or Deno. For Rust you can ignore sh.rustup.rs and just download and set up rustup manually. CARGO_HOME="${CARGO_HOME:-$HOME/.cargo}" mkdir -p "$CARGO_HOME/bin" curl -Lo "$CARGO_HOME/bin/rustup" 'https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-gnu/rustup-init' chmod +x "$CARGO_HOME/bin/rustup" hash -r rustup set auto-self-update disable…

Awesome, that avoids downloading and running executable code from the Rust project!

rustup is still executable code you are downloading from the Rust Project. It then downloads Cargo and rustc, which are both executable code, downloaded via the Rust project.

The only difference here is that you’re running a few commands by hand instead of running them in a single invocation of a shell script.

Re: Show HN: Checksum.sh verify every install script

#75

Earlier quoted context omitted.

Awesome, that avoids downloading and running executable code from the Rust project!

rustup is still executable code you are downloading from the Rust Project. It then downloads Cargo and rustc, which are both executable code, downloaded via the Rust project. The only difference here is that you’re running a few commands by hand instead of running them in a single invocation of a shell script.

Yeah, the only thing this achieves is not having to worry about the `curl | sh` step. The rest of the threat model is exactly the same.

Re: Show HN: Checksum.sh verify every install script

#76

Earlier quoted context omitted.

Awesome, that avoids downloading and running executable code from the Rust project!

rustup is still executable code you are downloading from the Rust Project. It then downloads Cargo and rustc, which are both executable code, downloaded via the Rust project. The only difference here is that you’re running a few commands by hand instead of running them in a single invocation of a shell script.

Of course; I was being sarcastic.

Re: Show HN: Checksum.sh verify every install script

#77

Earlier quoted context omitted.

rustup is still executable code you are downloading from the Rust Project. It then downloads Cargo and rustc, which are both executable code, downloaded via the Rust project. The only difference here is that you’re running a few commands by hand instead of running them in a single invocation of a shell script.

Of course; I was being sarcastic.

Poe’s law strikes again, my bad!
Post reply on HN