Home

A sneaky demonstration of the dangers of curl bash

$$2834
https://lemmy.radio/u/K3can posted on Feb 23, 2026 01:38

I set up a quick demonstration to show risks of curl|bash and how a bad-actor could potentially hide a malicious script.

It’s nothing new or groundbreaking, but I figure it never hurts to have another reminder.

https://lemmy.radio/post/12010162
Reply
$$2835
https://thebrainbin.org/u/osanna posted on Feb 23, 2026 01:39
In reply to: https://lemmy.radio/post/12010162

you’d have to be mad to willingly pipe a script to bash without checking it. holy shit

https://thebrainbin.org/m/selfhosted@lemmy.world/t/1440183/-/comment/10102108
Reply
$$2837
https://sh.itjust.works/u/wildbus8979 posted on Feb 23, 2026 01:44
In reply to: https://thebrainbin.org/m/selfhosted@lemmy.world/t/1440183/-/comment/10102108

And you better inspect and execute a downloaded copy, because a malicious actor can serve a different file for curl/wget than to your browser

https://sh.itjust.works/comment/23923854
Reply
$$2839
https://feddit.org/u/Flipper posted on Feb 23, 2026 01:54
In reply to: https://sh.itjust.works/comment/23923854

They can even serve a different file for curl vs curl|bash

https://feddit.org/comment/11669973
Reply
$$2840
https://lemmy.radio/u/K3can posted on Feb 23, 2026 02:00
In reply to: https://sh.itjust.works/comment/23923854

Yep. That’s what the post shows.

I created a live demo file, too, so that you can actually see the difference based on how you request the file.

https://lemmy.radio/comment/13269371
Reply
$$2841
https://sh.itjust.works/u/wildbus8979 posted on Feb 23, 2026 02:02
In reply to: https://feddit.org/comment/11669973

Yeah that do, I remember that the demo was pretty impressive ten fifteen years ago!

https://sh.itjust.works/comment/23924042
Reply
$$2853
https://piefed.ca/u/cecilkorik posted on Feb 23, 2026 02:53
In reply to: https://thebrainbin.org/m/selfhosted@lemmy.world/t/1440183/-/comment/10102108

And it’s wild how much even that has been absolutely normalized by all these shitty lazy developers and platforms. Vibe coding it just going to make it worse. All these programs that look nice on the surface and are just slop on the inside. It’s going to be a mess.

https://piefed.ca/comment/3612720
Reply
$$2855
https://lemmy.world/u/BluescreenOfDeath posted on Feb 23, 2026 03:06
In reply to: https://thebrainbin.org/m/selfhosted@lemmy.world/t/1440183/-/comment/10102108

The post is specifically about how you can serve a totally different script than the one you inspect. If you use curl to fetch the script via terminal, the webserver can send a different script to a browser based on the UserAgent.

And whether or not you think someone would be mad to do it, it’s still a widespread practice. The article mentions that piping curl straight to bash is already standard procedure for Proxmox helper scripts. But don’t take anyone’s word for it, check it out:

https://community-scripts.github.io/ProxmoxVE/

It’s also the recommended method for PiHole:

https://docs.pi-hole.net/main/basic-install/

https://lemmy.world/comment/22293839
Reply
$$2863
https://startrek.website/u/jtrek posted on Feb 23, 2026 03:45
In reply to: https://thebrainbin.org/m/selfhosted@lemmy.world/t/1440183/-/comment/10102108

Most developers I’ve looked at would happily just paste the curl|bash thing into the terminal.

I often would skim the script in the browser, but a. This post shows that’s not fool proof and b. a sufficiently sophisticated malicious script would fool a casual read

https://startrek.website/comment/21567831
Reply
$$2866
https://lemmy.nz/u/deadbeef79000 posted on Feb 23, 2026 03:48
In reply to: https://feddit.org/comment/11669973

Does curl send a different useragent when it’s piped?

Searching for those words just vomits ‘hOW to SeT cUrL’s UseRaGenT’ blog spam.

https://lemmy.nz/comment/20317064
Reply
$$2874
https://fedia.io/u/qupada posted on Feb 23, 2026 04:30
In reply to: https://lemmy.nz/comment/20317064

Not that I know of, which means I can only assume it’ll be a timing-based attack.

With strategic use of sleep statements in the script you should stand a pretty good chance of detecting the HTTP download blocking while the script execution is paused.

If you were already shipping the kind of script that unpacks a binary payload from the tail end of the file and executes it, it’s well within the realm of possibility to swap it for a different one.

https://fedia.io/m/selfhosted@lemmy.world/t/3492193/-/comment/14161078
Reply
$$2877
https://reddthat.com/u/mrnobody posted on Feb 23, 2026 04:38
In reply to: https://lemmy.world/comment/22293839

The reality is a lot of newcomers to Linux won’t even understand the risks involved, it’s run because that’s what they’re told or shown to do. That’s what I did for pihole many years ago too, I’ll admit

https://reddthat.com/comment/24941693
Reply
$$2880
https://lemmy.decronym.xyz/u/Decronym posted on Feb 23, 2026 04:40
In reply to: https://lemmy.radio/post/12010162

Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I’ve seen in this thread:

Fewer Letters More Letters
DNS Domain Name Service/System
HTTP Hypertext Transfer Protocol, the Web
PiHole Network-wide ad-blocker (DNS sinkhole)

[Thread #111 for this comm, first seen 23rd Feb 2026, 04:40] [FAQ] [Full list] [Contact] [Source code]

https://lemmy.decronym.xyz/comment/13067
Reply
$$2890
https://feddit.org/u/Flipper posted on Feb 23, 2026 05:25
In reply to: https://lemmy.nz/comment/20317064

Its timing based. Ehen piped a script, bash executes Dach line completly before taking the next line from the input. Curl has a limited output buffer.

  1. Operation that takes a long time. Like a sleep, or if zou want it less obvious. A download, an unzip operation, apt update, etc.
  2. Fill the buffer with more bash commands.
  3. Measure on the server if at some point curl stops downloading the script.
  4. Serve a malicious payload.
https://feddit.org/comment/11671759
Reply
$$2891
https://anarchist.nexus/u/Wildmimic posted on Feb 23, 2026 05:26
In reply to: https://thebrainbin.org/m/selfhosted@lemmy.world/t/1440183/-/comment/10102108

In addition to the other examples it’s also the default installation mode for node.js.

Ya cant even blame someone non-technical falling for this if they haven’t been explicitly informed - it’s getting reinforced as completely normal by too many “reputable” projects.

https://anarchist.nexus/comment/2765599
Reply
$$2901
https://sh.itjust.works/u/atzanteol posted on Feb 23, 2026 05:46
In reply to: https://reddthat.com/comment/24941693

I’ve been accused of “gate keeping” when I tell people that this is a shitty way to deploy applications and that nobody should do it.

https://sh.itjust.works/comment/23926015
Reply
$$2900
https://lemmy.nz/u/Dave posted on Feb 23, 2026 05:46
In reply to: https://thebrainbin.org/m/selfhosted@lemmy.world/t/1440183/-/comment/10102108

Is it different from running a bash script you downloaded without checking it? E.g. the installer that you get with GOG games?

Genuine question, I’m no expert.

https://lemmy.nz/comment/20317999
Reply
$$2903
https://thebrainbin.org/u/osanna posted on Feb 23, 2026 05:50
In reply to: https://lemmy.nz/comment/20317999

I have no problems with running scripts from the internet, AFTER you check them. Do NOT blindly run a script you found on the internet. As others have said download them, then check them, then and only then run them if they’re safe. NEVER pipe to bash, ever.

https://thebrainbin.org/m/selfhosted@lemmy.world/t/1440183/-/comment/10103937
Reply
$$2904
https://lemmy.nz/u/Dave posted on Feb 23, 2026 05:52
In reply to: https://thebrainbin.org/m/selfhosted@lemmy.world/t/1440183/-/comment/10103937

Ok but not everyone has that skill. And anyway, how is this different to running a binary where you can’t check the code?

https://lemmy.nz/comment/20318045
Reply
$$2907
https://thebrainbin.org/u/osanna posted on Feb 23, 2026 05:55
In reply to: https://lemmy.nz/comment/20318045

it’s exactly the same. Don’t run binaries you don’t trust fully. But i get what you mean. miley_cyrus_nude.jpg.exe is probably gonna end badly.

https://thebrainbin.org/m/selfhosted@lemmy.world/t/1440183/-/comment/10103964
Reply
$$2908
https://lemmy.ml/u/Ephera posted on Feb 23, 2026 05:56
In reply to: https://startrek.website/comment/21567831

Most developers I’ve looked at would happily just paste the curl|bash thing into the terminal.

I mean, I typically see it used for installing applications, and so long as TLS is used for the download, I’m still not aware of a good reason why you should check the Bash script in particular in that case, since the application itself could just as well be malware.

Of course, it’s better to check the Bash script than to not check it, but at that point we should also advise to download the source code for the application, review it and then compile it yourself.
At some point, you just have to bite the bullet and I have not yet seen a good argument why the Bash script deserves special treatment here…

Having said that, for cases where you’re not installing an application, yeah, reviewing the script allows you to use it, without having to trust the source to the same degree as you do for installing an application.

https://lemmy.ml/comment/24128776
Reply
$$2917
https://sh.itjust.works/u/csm10495 posted on Feb 23, 2026 06:32
In reply to: https://sh.itjust.works/comment/23923854

Hit the nail on the head. Download the file, inspect, then run that local copy.

https://sh.itjust.works/comment/23926386
Reply
$$2919
https://mander.xyz/u/porcoesphino posted on Feb 23, 2026 06:32
In reply to: https://anarchist.nexus/comment/2765599

I’m pretty sure brew on mac is the same too

https://mander.xyz/comment/25434053
Reply
$$2918
https://lemmy.nz/u/Dave posted on Feb 23, 2026 06:33
In reply to: https://thebrainbin.org/m/selfhosted@lemmy.world/t/1440183/-/comment/10103964

Yeah I get that, but I would install docker, cloudflared, etc by piping a convenience script to bash without hesitation. I’ve already decided to install their binary, I don’t see why the install script is any higher risk.

I know it’s a controversial thing for everyone to make their own call on, I just don’t think the risk for a bash script is any higher than a binary.

https://lemmy.nz/comment/20318349
Reply
$$2921
https://thebrainbin.org/u/osanna posted on Feb 23, 2026 06:36
In reply to: https://lemmy.nz/comment/20318349

the difference though is you can check a script. if it’s an open source project, you can also compile from source. but I get what you mean

https://thebrainbin.org/m/selfhosted@lemmy.world/t/1440183/-/comment/10104224
Reply
$$2922
https://lemmy.nz/u/Dave posted on Feb 23, 2026 06:40
In reply to: https://thebrainbin.org/m/selfhosted@lemmy.world/t/1440183/-/comment/10104224

You can, but to me it seems weird to say it’s crazy to pipe to bash when people happily run binaries. If anything, the convenience script is lower risk than the binary since people have probably checked it before you.

I wouldn’t pipe a random script to bash though, nothing where I wouldn’t trust the people behind it.

https://lemmy.nz/comment/20318408
Reply
$$2928
https://lemmy.world/u/one_knight_scripting posted on Feb 23, 2026 07:03
In reply to: https://thebrainbin.org/m/selfhosted@lemmy.world/t/1440183/-/comment/10102108

I mean, true, but most of the things I do that with are private scripts that I wrote. I think the main exceptions to that is Oh-my-zsh.

https://lemmy.world/comment/22295778
Reply
$$2929
https://thebrainbin.org/u/osanna posted on Feb 23, 2026 07:07
In reply to: https://lemmy.world/comment/22295778

the article isn’t about scripts you wrote yourself. run your own scripts all you like.

https://thebrainbin.org/m/selfhosted@lemmy.world/t/1440183/-/comment/10104409
Reply
$$2945
https://programming.dev/u/moonpiedumplings posted on Feb 23, 2026 08:01
In reply to: https://lemmy.nz/comment/20318349

I won’t lie, I use curl | bash as well, but I do dislike it for two reasons:

Firstly, it is much, much easier to compromise the website hosting than the binary itself, usually. Distributed binaries are usually signed by multiple keys from multiple servers, resulting in them being highly resistant to tampering. Reproducible builds (two users compiling a program get the same output) make it even harder to tamper with them, and easy to detect.

On the other hand, websites hosting infrastructure is generally nowhere near as secure. It’s typically one or two VPS’s, and there is no signature or verification that the content is “official”. So even if I’m not tampering with the binary, I can still tamper with the bash script to add extra goodies to it.

On the other hand (but not really relevant to what OP is talking about), just because I trust someone to give me a binary in a mature programming language they have experience writing in, doesn’t mean I trust them to give me a script in a language known for footguns. A steam bug in their bash script once deleted a user’s home directory. There have also been issues with AUR packages, which are basically bash scripts, breaking people’s systems as well. When it comes to user/community created scripts, I mostly trust them to not be malicious, and I am more fearful of a bug or mistake screwing things up. But at the same time, I have little confidence in my ability to spot these bugs.

Generally, I only make an exception for running bash installers if the program being installed is a “platform” that I can use to install more software. K3s (Kubernetes distro), or the Nix package manager are examples. If I can install something via Nix or Docker then it’s going to be installed via there and not installed via curl | bash. Not every developer under the sun should be given the privilege of running a bash script on my system.

As a sidenote, docker doesn’t recommend their install script anymore. All the instructions have been removed from the website. Personally, I prefer to get it from the distro’s repositories, as usually that’s the simplest and fastest way to install docker nowadays.

https://programming.dev/comment/22344153
Reply
$$2951
https://lemmy.nz/u/Dave posted on Feb 23, 2026 08:15
In reply to: https://programming.dev/comment/22344153

Firstly, it is much, much easier to compromise the website hosting than the binary itself, usually. Distributed binaries are usually signed by multiple keys from multiple servers, resulting in them being highly resistant to tampering. Reproducible builds (two users compiling a program get the same output) make it trivial to detect tampering as well.

Yeah this is a fair call.

But at the same time, I have little confidence in my ability to spot these bugs.

This is the key thing for me. I am not likely to spot any issues even if they were there! I’d only be scanning for external connections or obviously malicious code, which I do when I don’t have as much trust in the source.

As a sidenote, docker doesn’t recommend their install script anymore.

Yeah I used it as an example because there are very few times I ever remember piping to bash, but that’s probably the most common one I have done in the past.

https://lemmy.nz/comment/20319179
Reply
$$3012
https://lemmy.world/u/krispyavuz posted on Feb 23, 2026 11:46
In reply to: https://lemmy.radio/post/12010162

Curl bash is no different than running an sh script you dont know manually…

https://lemmy.world/comment/22298267
Reply
$$3039
https://lemmy.world/u/surewhynotlem posted on Feb 23, 2026 12:16
In reply to: https://lemmy.nz/comment/20317999

It’s really only about trusting the source. Your operating system surely has thousands of scripts that you’ve never read and never checked. And wouldn’t have time to. And people don’t complain about that.

But it’s really bad practice to run random things from random sites. So the practice of downloading a script and running it is frowned upon. Mostly as a way of maintaining good security hygiene.

https://lemmy.world/comment/22298576
Reply
$$3042
https://lemmy.radio/u/K3can posted on Feb 23, 2026 12:26
In reply to: https://lemmy.world/comment/22298267

True, but this is specifically about scripts you think you know, and how curl bash might trick you into running a different script entirely.

https://lemmy.radio/comment/13273381
Reply
$$3074
https://lemmy.world/u/xylogx posted on Feb 23, 2026 13:17
In reply to: https://lemmy.radio/post/12010162

Yes this has risks. At the same time anytime you run any piece of software you are facing the same risks, especially if that software is updated from the internet. Take a look at the NIST docs in software supply chain risks.

https://lemmy.world/comment/22299307
Reply
$$3103
https://lemmy.ml/u/ShortN0te posted on Feb 23, 2026 13:57
In reply to: https://lemmy.world/comment/22299307

Not completely correct. A lot of updaters work with signatures to verify that what was downloaded is signed by the correct key.

With bash curl there is no such check in place.

So strictly speeking it is not the same.

https://lemmy.ml/comment/24133753
Reply
$$3106
https://feddit.nl/u/quick_snail posted on Feb 23, 2026 14:11
In reply to: https://lemmy.radio/post/12010162

Anytime I see a project that had this in their install instructions, I don’t use that project.

It shows how dumb the devs are

https://feddit.nl/comment/23462218
Reply
$$3108
https://feddit.nl/u/quick_snail posted on Feb 23, 2026 14:12
In reply to: https://lemmy.world/comment/22299307

Apt is great

https://feddit.nl/comment/23462222
Reply
$$3109
https://feddit.nl/u/quick_snail posted on Feb 23, 2026 14:13
In reply to: https://lemmy.decronym.xyz/comment/13067

Good bot

https://feddit.nl/comment/23462240
Reply
$$3112
https://feddit.nl/u/quick_snail posted on Feb 23, 2026 14:16
In reply to: https://lemmy.radio/post/12010162

a more cautious user might first paste the url into the address bar of their web browser to see what the script looks like before running it.

Wow, I never thought anyone would be that dumb.

Why wouldn’t they just wget it, read it, and then execute it?

https://feddit.nl/comment/23462292
Reply
$$3129
https://lemmy.world/u/xylogx posted on Feb 23, 2026 14:54
In reply to: https://lemmy.ml/comment/24133753

Signatures do not help if your distribution infra gets compromised. See Solarwinds and the more recent node.js incidents.

https://lemmy.world/comment/22300853
Reply
$$3133
https://lemmy.ml/u/ShortN0te posted on Feb 23, 2026 15:06
In reply to: https://lemmy.world/comment/22300853

This is incorrect. If the update you download is compromised then the signature is invalid and the update fails.

To achieve a compromised update you either need to compromise the update infrastructure AND the key or the infratstructure AND exploit the local updater to accept the invalid or forged signature.

https://lemmy.ml/comment/24134927
Reply
$$3137
https://lemmy.world/u/sturmblast posted on Feb 23, 2026 15:17
In reply to: https://lemmy.radio/post/12010162

You mean blindly running code is bad? /s

https://lemmy.world/comment/22301259
Reply
$$3138
https://feddit.org/u/oeLLph posted on Feb 23, 2026 15:18
In reply to: https://lemmy.radio/post/12010162

@K3can@lemmy.radio love the early 2000s stylesheet/color theme of your blog 🙂

https://feddit.org/comment/11677784
Reply
$$3142
https://lemmy.world/u/xylogx posted on Feb 23, 2026 15:29
In reply to: https://lemmy.ml/comment/24134927

If I can control your infra I can alter what is a valid signature. It has happened. It will happen again. Digital signatures are not sufficient by themselves to prevent supply chain risks. Depending on your threat model, you need to assume advanced adversaries will seek to gain a foothold in your environment by attacking your software supplier. in these types of attacks threat actors can and will take control over the distribution mechanisms deploying trojaned backdoors as part of legitimately signed updates. It is a complex problem and I highly encourage you to read the NIST guidance to understand just how deep the rabbit hole goes.

Cybersecurity Supply Chain Risk Management Practices for Systems and Organizations

https://lemmy.world/comment/22301474
Reply
$$3150
https://lemmy.world/u/ikidd posted on Feb 23, 2026 15:42
In reply to: https://lemmy.radio/post/12010162

Oh, people will keep using it no matter how much you warn them.

Proxmox-helper-scripts is a perfect example. They’ll agree with you until that site comes up, and then its “it’ll never, ever get hacked and subverted, nope, can’t happen, impossible”.

Wankers.

https://lemmy.world/comment/22301705
Reply
$$3169
https://lemmy.radio/u/K3can posted on Feb 23, 2026 16:16
In reply to: https://feddit.org/comment/11677784

Thanks! I like to keep things simple. The colors are based on Counter Strike 1.6. 😁

And if you’re into the classic styling, my homepage is a direct homage to my old 2000s sites.

https://lemmy.radio/comment/13276186
Reply
$$3179
https://lemmy.ml/u/ShortN0te posted on Feb 23, 2026 16:44
In reply to: https://lemmy.world/comment/22301474

No you cannot, the pub key either needs to be present on the updater or uses infrastructure that is not owned by you. Usually how most software suppliers are doing it the public key is supplied within the updater.

https://lemmy.ml/comment/24136806
Reply
$$3188
https://lemmy.ca/u/corsicanguppy posted on Feb 23, 2026 17:07
In reply to: https://lemmy.world/comment/22301705

I was looking at that very thing last night.

But then I realized, “why can’t immich just create usable packages like we had before?” and moped back out.

But, for a moment, I was sure a little inspection and testing would make the Internet equivalent of an NYC MTA coinsucker magically safe. It looked so eeeeasy.

https://lemmy.ca/comment/21859486
Reply
$$3190
https://slrpnk.net/u/axx posted on Feb 23, 2026 17:25
In reply to: https://feddit.nl/comment/23462292

Oh the example in the article is the *nice* version if this attack.

Checking the script as downloaded by wget or curl and the piping curl to bash is still a terrible idea, as you have no guarantee you’ll get the same script in both cases:

https://slrpnk.net/comment/20894184
Reply
$$3192
https://slrpnk.net/u/axx posted on Feb 23, 2026 17:27
In reply to: https://lemmy.world/comment/22299307

This is a bit like saying crossing the street blindfolded while juggling chainsaws and crossing the street on a pedestrian crossing while the light is red for cars both carry risk. Sure. One’s a terrible idea though.

https://slrpnk.net/comment/20894223
Reply
$$3194
https://slrpnk.net/u/axx posted on Feb 23, 2026 17:28
In reply to: https://lemmy.world/comment/22300853

Please tell me you are not seriously equating a highly sophisticated attack line the Solarwind compromise with piping curl to bash?

https://slrpnk.net/comment/20894241
Reply
$$3195
https://slrpnk.net/u/axx posted on Feb 23, 2026 17:29
In reply to: https://feddit.nl/comment/23462218

Yes, this is the correct approach from a security perspective.

https://slrpnk.net/comment/20894255
Reply
$$3196
https://slrpnk.net/u/axx posted on Feb 23, 2026 17:30
In reply to: https://lemmy.world/comment/22298267

No, it is different, as it adds an entire layer of indirection and unknown to the mix, increasing the risk in the process.

https://slrpnk.net/comment/20894284
Reply
$$3198
https://slrpnk.net/u/axx posted on Feb 23, 2026 17:31
In reply to: https://lemmy.nz/comment/20317999

It is, see https://github.com/m4tx/curl-bash-attack

https://slrpnk.net/comment/20894294
Reply
$$3202
https://lemmy.nz/u/deadbeef79000 posted on Feb 23, 2026 17:44
In reply to: https://feddit.org/comment/11671759

Oh that is clever.

https://lemmy.nz/comment/20326200
Reply
$$3207
https://lemmy.world/u/xylogx posted on Feb 23, 2026 18:00
In reply to: https://lemmy.ml/comment/24136806

Not sure how else to explain this. Look at the CISA bulletin on Shai-Hulud the attacker published valid and signed binaries that were installed by hundreds of users.

“CISA is releasing this Alert to provide guidance in response to a widespread software supply chain compromise involving the world’s largest JavaScript registry, npmjs.com. A self-replicating worm—publicly known as “Shai-Hulud”—has compromised over 500 packages.[i]

After gaining initial access, the malicious cyber actor deployed malware that scanned the environment for sensitive credentials. The cyber actor then targeted GitHub Personal Access Tokens (PATs) and application programming interface (API) keys for cloud services, including Amazon Web Services (AWS), Google Cloud Platform (GCP), and Microsoft Azure.[ii]

The malware then:

  • Exfiltrated the harvested credentials to an endpoint controlled by the actor.
  • Uploaded the credentials to a public repository named Shai-Hulud via the GitHub/user/repos API.
  • Leveraged an automated process to rapidly spread by authenticating to the npm registry as the compromised developer, injecting code into other packages, and publishing compromised versions to the registry.[iii]
https://lemmy.world/comment/22304325
Reply
$$3208
https://lemmy.nz/u/Dave posted on Feb 23, 2026 18:11
In reply to: https://slrpnk.net/comment/20894294

That’s an interesting proof of concept, but I don’t think it shows it’s different. That’s a server side attack, whoever has control of the server could just have the script download a malicious binary instead and you wouldn’t be able to tell from the script.

https://lemmy.nz/comment/20326668
Reply
$$3212
https://lemmy.ml/u/ShortN0te posted on Feb 23, 2026 18:21
In reply to: https://lemmy.world/comment/22304325

After gaining initial access, the malicious cyber actor deployed malware that scanned the environment for sensitive credentials.

So as I said, the keys got compromised. Thats what i said in the second post.

https://lemmy.ml/comment/24138637
Reply
$$3218
https://lemmy.world/u/aeiou_ckr posted on Feb 23, 2026 18:39
In reply to: https://lemmy.radio/post/12010162

This helped a lot. I had no clue I could post the curl string in the URL bar of a browser to view the script. Thanks for the education!

https://lemmy.world/comment/22305026
Reply
$$3224
https://lemmy.world/u/MehBlah posted on Feb 23, 2026 18:47
In reply to: https://lemmy.radio/post/12010162

Never have I ever piped curl to bash.

https://lemmy.world/comment/22305186
Reply
$$3231
https://lemmy.world/u/It_Is1_24PM posted on Feb 23, 2026 19:06
In reply to: https://lemmy.radio/post/12010162

I never thought about opening it in a browser. I always used curl to download such a script and view it where it was supposed to be run.

https://lemmy.world/comment/22305564
Reply
$$3244
https://lemmy.world/u/xylogx posted on Feb 23, 2026 19:29
In reply to: https://lemmy.ml/comment/24138637

What you said is the key infra needs to get compromise. I do not need to own the PKI that issued the certs, I just need the private key of the signer. And again, this is something that happens. A lot. A software publisher gets owned, then their account is used to distribute malware.

https://lemmy.world/comment/22306016
Reply
$$3252
https://lemmy.world/u/Nibodhika posted on Feb 23, 2026 19:44
In reply to: https://lemmy.world/comment/22305026

You didn’t knew that the tool to handle URLs written in C (very creatively named C-Url) was handling URLs? It’s also written in C if you didn’t knew.

https://lemmy.world/comment/22306320
Reply
$$3257
https://lemmy.world/u/Nibodhika posted on Feb 23, 2026 19:57
In reply to: https://lemmy.world/comment/22299307

But those are two very different things, I can very easily give you a one liner using curl|bash that will compromise your system, to get the same level of compromise through a proper authenticated channel such as apt/pacman/etc you would need to compromise either their private keys and attack before they notice and change them or stick malicious code in an official package, either of those is orders of magnitude more difficult than writing a simple bash script.

https://lemmy.world/comment/22306550
Reply
$$3258
https://lemmy.ml/u/ShortN0te posted on Feb 23, 2026 19:58
In reply to: https://lemmy.world/comment/22306016

To achieve a compromised update you either need to compromise the update infrastructure AND the key or the infratstructure AND exploit the local updater to accept the invalid or forged signature.

As i said, to compromise a signature checked update over the internet you need to compromise both, the distributing infrastructure AND the key. With just either one its not possible. (Ignoring flaws in the code ofc)

https://lemmy.ml/comment/24140635
Reply
$$3265
https://lemmy.nz/u/smeenz posted on Feb 23, 2026 20:16
In reply to: https://lemmy.world/comment/22305026

You had no idea you could paste a url into a browser’s location bar ?

https://lemmy.nz/comment/20328906
Reply
$$3293
https://lemmy.world/u/xylogx posted on Feb 23, 2026 21:26
In reply to: https://lemmy.world/comment/22306550

I would feel more comfortable running curl bash from a trusted provider than doing apt get from an unknown software repo. What you are trying to do is establish trust in your supply chain, the delivery vehicle is less important.

https://lemmy.world/comment/22308317
Reply
$$3295
https://lemmy.world/u/xylogx posted on Feb 23, 2026 21:29
In reply to: https://lemmy.ml/comment/24140635

Take a look at Shai Hulud. All the attacker had was the key.

https://lemmy.world/comment/22308365
Reply
$$3332
https://lemmy.dbzer0.com/u/floquant posted on Feb 23, 2026 22:08
In reply to: https://lemmy.world/comment/22305026

Shit are URLs esoteric knowledge now?

https://lemmy.dbzer0.com/comment/24588706
Reply
$$3341
https://lemmy.world/u/BluescreenOfDeath posted on Feb 23, 2026 22:24
In reply to: https://reddthat.com/comment/24941693

Users are blameless, I find the fault with the developers.

Asking users to pipe curl to bash because it’s easier for the developer is just the developer being lazy, IMO.

Developers wouldn’t get a free pass for taking lazy, insecure shortcuts in programming, I don’t know why they should get a free pass on this.

https://lemmy.world/comment/22309385
Reply
$$3357
https://lemmy.world/u/Buddahriffic posted on Feb 23, 2026 23:03
In reply to: https://lemmy.radio/post/12010162

An alternative that will avoid the user agent trick is to curl | cat, which just prints the result of the first command to the console. curl >> filename.sh will write it to a script file that you can review and then mark executable and run if you deem it safe, which is safer than doing a curl | cat followed by a curl | bash (because it’s still possible for the 2nd curl to return a different set of commands).

You can control the user agent with curl and spoof a browser’s user agent for one fetch, then a second fetch using the normal curl user agent and compare the results to detect malicious urls in an automated way.

A command line analyzer tool would be nice for people who aren’t as familiar with the commands (and to defeat obfuscation) and arguments, though I believe the problem is NP, so it won’t likely ever be completely foolproof. Though maybe it can be if it is run in a sandbox to see what it does instead of just analyzed.

https://lemmy.world/comment/22309949
Reply
$$3382
https://lemmy.ml/u/ShortN0te posted on Feb 23, 2026 23:48
In reply to: https://lemmy.world/comment/22308365

Yes, the secrets to submit to the distribution system got compromised and therefore the system got compromised.

https://lemmy.ml/comment/24144972
Reply
$$3447
https://sh.itjust.works/u/neidu3 posted on Feb 24, 2026 01:22
In reply to: https://lemmy.radio/post/12010162

Running arbitrary text from the internet through an interpreter.. what could possibly go wrong.

https://sh.itjust.works/comment/23942306
Reply
$$3556
https://lemmy.world/u/Nibodhika posted on Feb 24, 2026 07:35
In reply to: https://lemmy.world/comment/22308317

But what is a trusted provider? How can you trust it? How sure are you that you’re not being MitM? Have you fully manually verified that there’s no funky flags in curl like -k, that the url is using SSL, that it’s a correct url and not pointing at something malicious, etc, etc, etc. There are a lot of manual steps you must verify using this approach, whereas using a package manager all of them get checked automatically, plus some extra checks like hundreds of people validating the content is secure.

To do apt get from an unknown repo, you first need to convince the person to execute root commands they don’t understand on their machine to add that unknown repo, if you can convice someone to run an unsafe command with root credentials then the machine is already compromised.

I get your point, random internet scripts are dangerous but random internet packages can also dangerous. But that’s a false equivalence because there are lots of safeguards to the packages in the usual way people install them, but less than 0 safeguards to the curl|bash. In a similar manner, if this was a post talking about the dangers of fireworks and how you can blow yourself up using them your answer is “but someone can plant a bomb in the mall I go to, or steal the codes for a nuclear missile and blow me up anyways”.

https://lemmy.world/comment/22315794
Reply
$$3562
https://lemmy.world/u/mlg posted on Feb 24, 2026 08:06
In reply to: https://lemmy.radio/post/12010162

Use our easy bash oneliner to install our software!

Looks inside script

if [ $(command -v apt-get) ]; then apt-get install app; else echo “Unsupported OS”

Still less annoying than trying to build something from source in which the dev claims has like 3 dependencies but in reality requires 500mb of random packages you’ve never even heard of, all while their build system doesn’t do any pre comp checking so the build fails after a solid hours of compilation.

https://lemmy.world/comment/22316141
Reply
$$3568
https://lemmy.blahaj.zone/u/ssfckdt posted on Feb 24, 2026 08:29
In reply to: https://lemmy.radio/post/12010162

I’m a bit lost with

a more cautious user might first paste the url into the address bar of their web browser to see what the script looks like before running it. In the

You… You just…. You just dump the curl output to file and examine that and then run it if its good

Just a weird imagined sequence to me.

https://lemmy.blahaj.zone/comment/19340798
Reply
$$3586
https://lemmy.ml/u/martini1992 posted on Feb 24, 2026 09:26
In reply to: https://lemmy.blahaj.zone/comment/19340798

Worse than that, the server can change it’s response based on user agent so you need to curl it to a file first, a browser could be served a completely different response.

https://lemmy.ml/comment/24152055
Reply
$$3604
https://lemmy.radio/u/K3can posted on Feb 24, 2026 10:30
In reply to: https://lemmy.ml/comment/24152055

Which is exactly what is demonstrated in the post. 🙃

https://lemmy.radio/comment/13287359
Reply
$$3760
https://lemmy.world/u/aeiou_ckr posted on Feb 24, 2026 18:24
In reply to: https://lemmy.nz/comment/20328906

I wasn’t looking to get roasted for not knowing something. Guess that teaches me something else. Fuck people and thanking them for Shar something I didn’t know. 

https://lemmy.world/comment/22325239
Reply
$$3765
https://lemmy.world/u/Mister_Hangman posted on Feb 24, 2026 18:53
In reply to: https://lemmy.radio/comment/13276186

Hahahaha noticed this too. 1.5 was where it was at tho

https://lemmy.world/comment/22325761
Reply
$$3819
https://lemmy.nz/u/smeenz posted on Feb 24, 2026 20:58
In reply to: https://lemmy.world/comment/22325239

I think the general response is from confusion over what you could possibly have been using the url bar for in your browser if you didn’t know you could put urls there.

https://lemmy.nz/comment/20348717
Reply