Hot take: If we added a "--install" option to #curl, we could optimize many a "| sh -" pipeline away.

Finally a truly universal installer.

I am uncertain if that's the patch I want to be known for though.

But I have set a reminder for in 32 days.

@larsmb You could then extend https://xkcd.com/1654/ with `curl --install "https://get${1}.dev/install.sh" &`
Universal Install Script

xkcd

@larsmb honestly this could be an improvement to security. for example, it could:

1. require HTTPS
2. guard against truncation attacks
3. check against a malicious blacklist

which simply piping the output can't do

@larsmb
--insecure is implicit in this mode, correct?
@vyskocilm Snark aside, with "https" probably as (in)secure as getting the respective package from any community distribution.
@larsmb But does it also leak to the server that you're using "--install" and not just try to download the file so that when you're trying to just download the malicious script the server can send you a version without the malware instead?
@larsmb @agowa338 Lets have curl add a "Variant: without_vulnerabilities" header when --install is specified.

@pianosaurus @larsmb @agowa338

I think RFC 3514 "The Security Flag in the IPv4 Header" have place here.

https://www.rfc-editor.org/rfc/rfc3514

RFC 3514: The Security Flag in the IPv4 Header

@agowa338 @larsmb I think it should not only leak that you're using --install but also the OS. That way you can just do `"curl --install whatever.com`" without caring about the full path (saves even more typing) and they can not only detect that you want to install their product but also deliver the right installer for whatever OS you're using. ☝️
@larsmb This should work fine with openclaw!! You are ahead of the time.
@larsmb 🤣 I was shortly thinking that that is a chicken/egg situation if you want to install cURL via the `--install` option... 🙈
@larsmb @heiglandreas Let's just do a Microsoft, and ship every OS with something that isn't curl aliased as curl.
@larsmb @heiglandreas @pianosaurus so if their curl also implement --install, one can indeed install curl via "curl".
@larsmb better naming: "--submit" or "--infect"
@larsmb This is much longer to type than |sh -

@larsmb Bonus, it would stop people getting confused from typing `sudo curl $URL | sh -` instead of `curl $URL | sudo sh -`

...nope, still nope! 😆

@larsmb What could possibly go wrong? :)
@larsmb Or `curl --bash`
@amenonsen @larsmb how about a curlsh where you type in URLs in the prompt and the response is then executed as shell commands?
@larsmb This is a plan without a flaw nor any possibility of error!
@larsmb it should default to sudo to make things easy.
@larsmb please make it check a malware filter before passing it to $shell

@larsmb

Not sure how "| sh" is any less secure than what people do 99.9% of the time anyway, which is download an installer or executable and not bother or validate it.

If you really want to change the world, work out an actually secure mechanism (tall order!) and have --install implement it. Not sure what that would look like: https requirement, maybe a database of known/vetted installations, a means to report issues. Very tall order.

@tbortels Well that's, like... a package manager? Let's call it cURL Universal Package System and abbreviate it CUPS... oh damn.

@christopherkunz

Sadly I think I trust Badger and friends to get it right more than my package manager.

CUPS. Now that's a name I've not heard in a long time...

@christopherkunz @tbortels Package managers are so awesome we have hundreds.

@larsmb @christopherkunz

There is *always* a relevant XKCD:

https://xkcd.com/927

Standards

xkcd
Universal Install Script

xkcd
@larsmb
"| sh" _IS_ the curl install option
@larsmb pair it with some yet-to-be-specified `integrity` parameter to check the file and we're there.
@larsmb maybe --execute will be a better option because its not always a Installation script.
@nyansen Ohhh how about "--rootkit"
@larsmb for a curl anti cheat system?
@larsmb @nyansen curl --yolo 😉. Although that is a short form. So it should probably only be one dash.
@larsmb this breaks the great idea of Unix where tools are simple, do one job well, and can be chained together for more complex tasks.
@larsmb @bagder The true systemd way would be to build a POSIX shell into curl, right?

@goetz No, the true systemd way would be to replace it with systemd-urld, a DBus service that is configured via plenty of .unit/.service files and a systemd-url-ctl CLI

But it can also no longer download to the same locations you used to use, since those are now immutable.

Oh, and a SELinux policy, with a different context for every domain.

@goetz @larsmb @bagder hmm.. The aim here is surely to make installation of programs easier. Logically therefore what is required is to provide access to the largest marketplace of programs - which is Windows.

Therefore Curl should have an integrated PE executable decoder, and all of WINE included in it.

@larsmb hot take , people that do that should not be allowed root privileges (and I`m being extremely gentle here..)
@krisbuytaert @larsmb Never would do that. I solely use npm install.
@der_mit_ph @larsmb I see why you stayed away from Fosdem and CfgMgmtCamp this week :)
@larsmb If the URL returns HTML curl should crawl the entire website for any .sh files and run them, that way you can just do "curl --install $DOMAIN" without path to type even less.
@larsmb
... And truly risky😉
@larsmb soon curl is a complete operating system in itself with a pretty decent http client

@larsmb @bagder It’s too bad it got so normalised to let scripts from the internet run unchecked on our computers. That’s universally a bad idea, do we need to make it any easier?

https://mastodon.social/@stevenodb/116022371751014959

@stevenodb @bagder I'm not actually sure that's entirely true.

Package managers _also_ run "scripts from the Internet". And the next step they do is run the program that was just so installed. So if you don't trust the dev, you're still screwed.

Yes, there are many issues, and people surely shouldn't point it at random URLs either, but for a legitimate upstream project? I'm not sure the "security implications" are all that real.

(Sorry, my original post was snark, this reply isn't :-)

@larsmb --thefuck option for ai-driven speling correction and automated suid execution
@byteborg `curl --as-prompt`, instead of downloading anything from the internet, generate the content of what the URL likely would have delivered.
@larsmb not agentic enough to meet today's standards 🤣