security: openhome-cli MEDIUMs — tmpdir, key-detection, version pinning#23
Open
Bradymck wants to merge 1 commit into
Open
security: openhome-cli MEDIUMs — tmpdir, key-detection, version pinning#23Bradymck wants to merge 1 commit into
Bradymck wants to merge 1 commit into
Conversation
8f6168e to
fd3c3f0
Compare
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.
Summary
openhome-cli MEDIUM bucket from the audit.
MEDIUM — Agent prompt written to /tmp on Linux
`src/commands/agents-edit.ts` wrote the in-flight prompt to `os.tmpdir()` — on Linux that's `/tmp` mode 1777, readable by any local user while the editor session is open. Now uses `~/.openhome/tmp` (mode 0o700) via `mkdtempSync`, file written 0o600.
MEDIUM — Hardcoded-key detection regex missed common providers
`HARDCODED_KEY_PATTERN` only caught `sk_/sk-/key_` prefixes followed by plain alphanumerics. Missed: OpenAI project keys, Anthropic keys, Stripe, GitHub PATs, AWS access keys, Slack bot tokens, Google API keys. Replaced with a single alternation covering every common provider format.
MEDIUM — Auto-update re-exec used remote version string with weak validation
`src/cli.ts` fetched `openhome-cli@latest` and passed the version into `execFileSync("npx", [`openhome-cli@${latest}`, …])`. The `/^\d+.\d+.\d+$/` check allowed arbitrarily long digit runs and ran AFTER the cache write. Tightened to `/^\d{1,5}.\d{1,5}.\d{1,5}$/` with a 32-char cap, and re-validates on every cache READ too so a poisoned-by-older-CLI cache value is discarded.
Test plan
🤖 Generated with Claude Code