←back to thread

435 points crawshaw | 6 comments | | HN request time: 1.098s | source | bottom
Show context
kuahyeow ◴[] No.44000013[source]
What protection do people use when enabling an LLM to run `bash` on your machine ? Do you run it in a Docker container / LXC boundary ? `chroot` ?
replies(2): >>44000369 #>>44002663 #
1. CGamesPlay ◴[] No.44000369[source]
The blog post in question is on the site for Sketch, which appears to use Docker containers. That said, I use Claude Code, which just uses unsandboxed commands with manual approval.

What's your concern? An accident or an attacker? For accidents, I use git and backups and develop in a devcontainer. For an attacker, bash just seems like an ineffective attack vector; I would be more worried about instructing the agent to write a reverse shell directly into the code.

replies(2): >>44001584 #>>44002882 #
2. zahlman ◴[] No.44001584[source]
> For an attacker, bash just seems like an ineffective attack vector

All it needs to do is curl and run the actual payload.

replies(2): >>44001663 #>>44002359 #
3. ◴[] No.44001663[source]
4. Wilder7977 ◴[] No.44002359[source]
Or even the standard "echo xxx | base64 -d" or a million other ways. How can someone say that bash is not interesting to an attacker is beyond me.
replies(1): >>44017845 #
5. cess11 ◴[] No.44002882[source]
Bourne-Again SHell is a shell. The "reverse" part is just about network minutiae. /bin/sh is more portable so that's what you'd typically put in your shellcode but /bin/bash or /usr/bin/dash would likely work just as well.

I.e. exposing any of these on a public network is the main target to get a foothold in a non-public network or a computer. As soon as you have that access you can start renting out CPU cycles or use it for distributed hash cracking or DoS-campaigns. It's simpler than injecting your own code and using that as a shell.

Asking a few of my small local models for Forth-like interpreters in x86 assembly they seem willing to comply and produce code so if they had access to a shell and package installation I imagine they could also inject such a payload into some process. It would be very hard to discover.

6. CGamesPlay ◴[] No.44017845{3}[source]
But bash isn't a key ingredient in any of these. The exact same payload could easily be insert in the project's source code, and has the benefit of being persistent. Using a bash shell to do it might be the most obvious way, sure, but shutting down bash access is such a poor defense that it isn't worth doing.