New favorite tool 😍

  • FizzyOrange@programming.dev
    link
    fedilink
    arrow-up
    0
    ·
    1 year ago

    I wish this nonsense of piping a shell script from the internet directly into Bash would stop. It’s a bad idea, because of security concerns.

    I would encourage you to actually think about whether or not this is really true, rather than just parroting what other people say.

    See if you can think of an exploit I perform if you pipe my install script to bash, but I can’t do it you download a tarball of my program and run it.

    while requiring root access

    Again, think of an exploit I can do it you give me root, but I can’t do if you run my program without root.

    (Though I agree in this case it is stupid that it has to be installed in /opt; it should definitely install to your home dir like most modern languages - Go, Rust, etc.)

    • onlinepersona@programming.dev
      link
      fedilink
      English
      arrow-up
      2
      ·
      1 year ago

      I would encourage you to actually think about whether or not this is really true, rather than just parroting what other people say.

      I would encourage you to read up on the issue before thinking they haven’t.

      See if you can think of an exploit I perform if you pipe my install script to bash, but I can’t do it you download a tarball of my program and run it.

      Here is the most sophisticated exploit: Detecting the use of “curl | bash” server side.

      It is also terrible conditioning to pipe stuff to bash because it’s the equivalent of “just execute this .exe, bro”. Sure, right now it’s github, but there are other curl|bash installs that happen on other websites.

      Additionally a tar allows one to install a program later with no network access to allow reproducible builds. curl|bash is not repoducible.

      Anti Commercial-AI license

      • BatmanAoD@programming.dev
        link
        fedilink
        arrow-up
        0
        ·
        1 year ago

        But…“just execute this .exe, bro” is generally the alternative to pipe-to-Bash. Have you personally compiled the majority of software running on your devices?

        • DaPorkchop_@lemmy.ml
          link
          fedilink
          arrow-up
          1
          ·
          1 year ago

          No, it was compiled by the team which maintains my distro’s package repository, and cryptographically verified to have come from them by my package manager. That’s a lot different than downloading some random executables I pulled from a website I’d never heard of before and immediately running them as root.

    • tgt@programming.dev
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      1 year ago

      It is absolutely possible to know as the server serving a bash script if it is being piped into bash or not purely by the timing of the downloaded chunks. A server could halfway through start serving a different file if it detected that it is being run directly. This is not a theoretical situation, by the way, this has been done. At least when downloading the script first you know what you’ll be running. Same for a source tarball. That’s my main gripe with this piping stuff. It assumes you don’t even care about the security.