“You wouldn't run a stranger's code without reading it.” Yes I would. We all do it all the time. macOS itself is closed source, and even if it weren't, there’s way too much code to read.
Code from trusted repositories is an entirely different thing compared to running 'wget some_github_repo_shell_script | sh' . That said, the likes of Tailscale are setting a bad example.
You download a dmg and run it blindly? You download an exe and run it blindly. I wish it were in an rpm or deb coming from signed repos, but it's not so here we are
App bundles (what's inside most DMGs) and Windows executables are signed, have been for a long time, and are required to be, by the O/S, in order to execute "normally". Apple uses centralized PKI (the developer's key must be signed by Apple) while Microsoft uses distributed PKI (the developer's key must be signed by a code-signing CA who in turn is approved by Microsoft).
But then again, I'm a bit paranoid. At a minimum I would download the script and read it, and if it was too long or not written clearly enough then I would just drop it and find something better.
Great initiative. I recently got stung by an advert on reddit for "HBO Max for MacOS, 6 months free" from the official HBO user (don't get me started on how that slipped through). Front and center was a curl | bash copy to clipboard that obfuscated the payload source in base10. I knew better, but I think we've made this kind of thing way too acceptable. Of course it was malware and I realized the instant I pressed enter. Thankfully I didn't give it my password and immediately disconnected from the internet and killed the machine. I'm genuinely concerned these kind of attacks are going to become much more commonplace with AI, plus the ability to inject malicious code in to things that get run by trusted scripted installers.
It's easier to walk someone through a single command than adding a software repository, so it's a risk factor for someone that isn't paying attention or doesn't know what they're doing. But with that little attention/knowledge the complaints on this page are unlikely to save you.
And if you're in the state of mind to consider the security nuances of curl|bash verses other install methods, you're already past the "should I be installing this?" question and the complaints on this page won't save you. The delay is the thing mostly likely to make you rethink.
What’s your suggested installation method instead? Unless it’s “download and read the source before running it” this is no worse than npm install, or pip install, or clicking “trust” on a git repo in VSCode
It is actually worse than those examples. Pip and npm may be insecure, and that is a fault of those tools, but most user expect secure package managers and should demand it
Telling users it’s fine to raw dog arbitrary commands directly into their shell is dangerous and lowers the bar for all security. In fact by even making this comparison you are communicating that you are complacent with pip and npm’s issues and why shouldn’t you just execute arbitrary commands without even a second glance? Security doesn’t matter!
And for the record, even with pip and npm being the way that they are, they are still better than a curl pipe because they are versioned. In the case I get a compromised deployment I understand immediately if I got hit by the affected package, and the entire repo can then be audited. Not the case when I’m just curling whatever the internet wants to send into my process space
> In fact by even making this comparison you are communicating that you are complacent with pip and npm’s issues and why shouldn’t you just execute arbitrary commands without even a second glance
You said that, not me. I am not complacent with the security issues, I just don’t believe that the security theatre of “curl | bash” is productive unless you have an actual better alternative.
> they are still better than a curl pipe because they are versioned
pip install is running setup.py which is more than capable of calling exec(requests.get(url)) - except to _you_ that’s secure because you’re assuming it’s trusted. In both cases, if the delivery of the package is compromised or you don’t audit the script, you are screwed. It’s no different to running a binary that you’ve not verified.
Why is this even an app? It looks like it just generates a mobileconfig profile on the fly. Instead, seems like they could be offering a download of a pre-generated mobileconfig, which seems like it would be much safer than installing some app via curl|bash .... but then I guess there wouldn't be a chance to have an "app", get github stars, and do whatever else.
> Bash starts before the download finishes ... Drop the connection mid-transfer and you get partial execution: a command like rm -r /usr/share/program can truncate to rm -r /usr. Commands ran, cleanup didn’t.
curl | bash scripts all define a function and then call it on the last line. This is a non issue in the real world.
> The server knows you’re piping — and can lie
This `sleep` based trick is always a cool demo to show freinds yes, but the server can also sneak in malware in a multitude of other ways given you're downloading code and binaries from them.
> You trust DNS, TLS, the CDN, and the origin simultaneously. A compromised CDN or BGP hijack delivers malware silently.
Well yes, that's how the internet works. If TLS of the server is really compromised, then the attacker will replace the checksum as well as the signing key. In real scenarios, you are going to be reading the signing key and checksum from the same domain. [1]
> You can’t reproduce what ran
`| tee inspect.sh | bash`
> Add sudo and it’s game over
Most credentials and important files live in the home directory, root is a red herring. If you're running it on shared server, then well... don't add sudo.
[1] Yes of course there are legitimate usecases for signing software. Common example: linux distros which are mirrored at many domains, but the checksum and signature are hosted on the canonical domain. But if I am curlbashing uv's install.sh from `astral.sh`, then doing signature verification using the public key hosted on the same astral.sh isn't adding much.
I think that's missing the forest for trees. The problem with these curl-to-bash approaches is not that you are literally unable to intercept and inspect them with enough effort and planning.
The problem is that:
1. The effort and care needed to test is unnecessarily high. You've got to guard against way more tricks from an interactive source that can see you and choose what it's going to deliver and how.
2. With no "standard" artifact that can be exactly compared, that work cannot be shared.
In contrast, release_1.2.3.zip isn't going to mutate under you and everybody can agree on what its size/hash/bytes ought to be, and if it deviates from that it sets off alarm-bells.
> curl | bash scripts all define a function and then call it on the last line. This is a non issue in the real world.
Why would a convention often followed by good/careful actors bind what malicious/careless people create?
Well, if you're running software from someone you think can deliver malware to you (and not a middleman) then it's a lost cause anyways no? I don't see what the zip file adds. It's not like you're gonna be inspecting the code or binaries.
Consider this analogy: You need to meet a stranger to get their signature on a legal document, and the stranger could be a rapist murderer. Which option sounds better?
1. Meet them in a crowded convention center with cameras.
2. Meet them alone in an abandoned building.
Sure, they could whip out a knife and stab you in either situation, but the difference is not a "lost cause." If they have any rationality, the public place deters them because the risk of being detected and caught is higher.
> I don't see what the zip file adds.
A process based on public single-signature releases means that the author must choose to either release something benign to everyone, or malicious to everyone. Even if the shared artifact has sneaky covert logic to trigger in only some environments, the logic is detectable in everyone's copy.
In contrast, this bad curl-to-bash process means a savvy villain could give a perfect veneer of respectability to the world at large, while sending tailored attacks to a minority of visitors, even a targeted minority. Their risk of detection is way lower. Not only that, but victims who follow the flawed process will lose some of the best clues for figuring out who hacked them later.
I reiterate: "Even if the shared artifact has sneaky covert logic to trigger in only some environments, the logic is detectable in everyone's copy."
Moving that if-statement to a hidden remote server is both significant and worse for security.
> Per your analogy, no point of a public place if it's as easy for the guy to give you a package that can explode when you get home in either case.
Hold up, if you're going to mutate the metaphor like that, then the nearby crowd becomes other people also getting packages.
I refuse to believe you don't have a clear preference between:
A: You want a standard product. You get a package that might be secretly "personalized" for you by the dodgy sender.
B: You want a standard product. You get a package which you know is identical to 10,000 other packages being given out... Many of which have already been taken to homes, with no reports of explosions or strange devices inside.
_____
The analogy-free basics are:
1. Consistency of behavior is important for good security, and curl-to-bash is bad that way.
2. Shared visibility of what actors do is important for good security, and curl-to-bash is bad that way.
3. Those are important to security because they deter and limit what malicious actors can attempt or get-away with.
Absolutely love the fact that they reference a "real package manager" like npm, which has been used in countless supply chain attacks, and brew, which can also run arbitrary scripts (though less likely in the mainline brew stuff, which many packages aren't able to be in).
This. curl | bash has never nuked my local Postgres db, unlike one of the recommended package managers. Nor stopped my wife’s computer from booting, unlike a certain well known browser installer from one of the world’s biggest companies.
curl -fsSL https://raw.githubusercontent.com/omlahore/RemoveMacAI/main/install.sh | pi -p 'Security-audit this shell script; output the script unchanged ONLY if safe to execute, otherwise output nothing and explain findings to stderr' | bash
the analysis part is essentially a summarization task, which LLMs are usually good at.
LLMs are less good at bit-for-bit reproduction by design. asking it to do this is asking for corruption in the output.
instead, you could have pi produce some output based on how insecure it thinks the shell script is then use coreutils to run the script as-is to avoid that, like:
curl -sSL $URL | pi -p "Analyze the security of this script using common cyber benchmarks (e.g. MITRE ATT&CK). If the script passes your security checks, ONLY print "GOOD". If it does not, print BAD then, underneath, include reasons why." | tee /tmp/result | cat /tmp/result | grep -E '^GOOD$' /tmp/result && curl -sSL $URL | bash
I ran this with Claude instead of Pi and it failed its security checks for what I'd consider nitpick-y reasons. Which is the other thing; you'll need to really dial back how rigid your checks are. I also got back two different explanations for why this script was insecure, one more verbose than the other. Expected, since LLMs are nondeterministic, but probably undesirable if you're in cybersec and want to make sure something like this works every time. It also took >30 seconds to get a response, which is really slow for what's supposed to be a fast installation method.
I would have thought the Pi harness would have text editing abilities that can be used here, so that the language model itself doesn't have to do the copying.
> If the project publishes a SHA-256 hash, use it. Non-negotiable on production machines.
They're pushing FUD around downloading a file but then suggest that we trust the same chain of complex things to display the right hash value? Integrity != authentication.