fix(security): pipe sudo password via stdin instead of shell cmdline - #698
Closed
johnh4098 wants to merge 1 commit into
Closed
fix(security): pipe sudo password via stdin instead of shell cmdline#698johnh4098 wants to merge 1 commit into
johnh4098 wants to merge 1 commit into
Conversation
Contributor
|
Important security fix — clean separation of password from command line across all 6 backends. All 2857 tests pass. Merged to main. Thanks @johnh4098! 🔒🎉 |
teknium1
added a commit
that referenced
this pull request
Mar 10, 2026
… shell cmdline Authored by johnh4098. Fixes CWE-214: SUDO_PASSWORD was visible in /proc/PID/cmdline via echo pipe. Now passed through subprocess stdin. All 6 backends updated: local, ssh, docker, singularity pipe via stdin; modal and daytona use printf fallback (remote sandbox, documented).
angelburgosrosado
pushed a commit
to angelburgosrosado/hermes-agent
that referenced
this pull request
Apr 27, 2026
…n instead of shell cmdline Authored by johnh4098. Fixes CWE-214: SUDO_PASSWORD was visible in /proc/PID/cmdline via echo pipe. Now passed through subprocess stdin. All 6 backends updated: local, ssh, docker, singularity pipe via stdin; modal and daytona use printf fallback (remote sandbox, documented).
02356abc
pushed a commit
to 02356abc/hermes-agent
that referenced
this pull request
May 14, 2026
…n instead of shell cmdline Authored by johnh4098. Fixes CWE-214: SUDO_PASSWORD was visible in /proc/PID/cmdline via echo pipe. Now passed through subprocess stdin. All 6 backends updated: local, ssh, docker, singularity pipe via stdin; modal and daytona use printf fallback (remote sandbox, documented).
waefrebeorn
pushed a commit
to waefrebeorn/slermes
that referenced
this pull request
Jul 2, 2026
…n instead of shell cmdline Authored by johnh4098. Fixes CWE-214: SUDO_PASSWORD was visible in /proc/PID/cmdline via echo pipe. Now passed through subprocess stdin. All 6 backends updated: local, ssh, docker, singularity pipe via stdin; modal and daytona use printf fallback (remote sandbox, documented).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SUDO_PASSWORD was being passed as part of the shell command string:
This makes the password visible in /proc//cmdline and ps aux for
the entire duration of the command — readable by any unprivileged
process on the same machine (CWE-214).
The fix passes the password through subprocess stdin instead. The
transformed command now contains bare
sudo -S -p ''with nocredential in the argument list. The password travels as bytes in
memory only.
local, ssh, docker, singularity — full fix via stdin pipe
modal, daytona — fallback with printf (remote sandbox, different
threat model), noted in comments
Fixes the credential exposure on any system where SUDO_PASSWORD is set.