Re:Uv is the best thing to happen to the Python ecosystem in...
by joefarish on Thursday October 30, 2025 @05:53AM
(#45758138)
We've all done it. I'm curious though, I wonder what would be the best way to prevent a user from doing this.
[ Parent
| on HN ]
Re:Uv is the best thing to happen to the Python ecosystem in...
by palata on Thursday October 30, 2025 @09:59AM
(#45760115)
The user is the one copy-pasting that line in their terminal. There is no preventing them from doing it, they can `rm -rf /` if they feel like it.
They shouldn't, though...
Re:Uv is the best thing to happen to the Python ecosystem in...
by redleader55 on Thursday October 30, 2025 @10:17AM
(#45760280)
Wrap curl to detect if /dev/stdout is a pipe and if the output is a script - this is fast because of the hash-bang. From there you can do a lot of fancy things: replace the output with echo "don't do this" ; exit 1", check the Url against a list of well known accepted scripts based on hash, run the unknown ones through an LLM to validate if they are potentially malicious, etc.
Re:Uv is the best thing to happen to the Python ecosystem in...
by palata on Thursday October 30, 2025 @04:50PM
(#45765155)
> run the unknown ones through an LLM
Run my command through an LLM and tell me "don't do this" once, I'm out to a different distro :-).
Also, if people copy-paste stuff they don't understand in a terminal (and running a script like this is pretty much "running stuff one does not understand"), I don't think there is anything you can do for them.