Repository navigation
Stop /processes returning command lines; cache the matched key check - #12
Merged
Merged
Conversation
/processes listed each host process's command line (through /host/proc), and command lines carry passwords and keys; /runtime already collects none. Every admin request ran 200k rounds of PBKDF2 even for a wrong key, so any caller reaching the port could starve the single worker. After the first match, primed at startup from the configured key, a constant-time SHA-256 compare decides; a new key file is checked in full. Journal and package output loses terminal control codes, and a failed command reports only its exception class. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
From the overnight security review (security-systemgate-1, S1, S2, S6).
/processesreturned up to 100 host command lines (/host/proc), which carry passwords and keys. It now returns the same metadata as/runtime: pid, name, user, CPU and memory, picked by an explicit field list so extra psutil fields never pass through. Nothing calls/processestoday (ToolGate reads/runtime).SYSTEMGATE_ADMIN_KEY), a constant-time SHA-256 compare decides; a new key file misses the cache and is checked in full.Not changed here: S3 (root user and
uts: host; needs an image release and a server change), S5 (/backupsre-hashing; needs a cache design). S4 (open/docs) is how every gate serves its contract.Evidence:
pytest tests45 passed / 8 skipped; ruff clean; file sizes ok. Ten mutants, each caught by its test: cmdline requested again,proc.infopassed through, control codes kept,str(exc)in either place, no cache, cache accepts anything, cache ignores the key file, cache stores a wrong key, no startup prime.🤖 Generated with Claude Code