Repository navigation
security: owner-only store, race-free credential files, safer defaults - #161
Merged
Merged
Conversation
Found in end-to-end testing before go-live: - ~/.secfoo was 0755 with 0644 files: on a shared machine or CI runner any local user could read every prompt (the scanned source), report and finding. The store root is now 0700, and an older store is tightened. - cloud.toml, memory.toml and claude-mcp-config.json were written with the default umask and chmod-ed afterwards, so a secret was briefly readable (and stayed readable until the chmod if the file pre-existed). They are now created 0600 via os.open. - 'secfoo config init' wrote an active Atlassian MCP entry, so every claude run executed 'npx -y mcp-remote@latest' (an unpinned download) and started an OAuth flow even for users who never use Atlassian. It is now a commented-out example, like the others. - Docker: the image installed an unpinned 'secfoo' after a fixed 60s sleep, so a release image could contain the previous version. release.yml now passes the version as a build arg and the Dockerfile retries until PyPI serves it. - release.yml no longer interpolates inputs.tag into a shell script; the value reaches the script as a variable. - install.sh ignored a writable PREFIX whose bin/ did not exist yet and silently installed to ~/.local/bin. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Found during end-to-end testing before go-live (fresh wheel install in a clean home, the real
install.sh, a real Claude run, the release workflow).Security
~/.secfoo0755, files0644: any local user on a shared machine or CI runner could read every prompt (the scanned source), report and finding0700; an older store is tightened on first use (a store the user doesn't own is left alone)cloud.toml,memory.toml,claude-mcp-config.jsonwritten with the default umask, thenchmod 0600: the secret was briefly world-readable, and a pre-existing0644file kept that mode until the chmodconfig.write_private_textcreates them0600(os.open+fchmod)secfoo config initwrote an active Atlassian[[mcp_servers]]entry, so everyclauderun executednpx -y mcp-remote@latest(an unpinned download) and started an OAuth flow, Atlassian user or notrelease.yml${{ inputs.tag }}interpolated into a shell scriptRelease and install
pip install secfoo(unpinned) after a fixedsleep 60, so the image taggedX.Y.Zcould contain the previous release while PyPI's index caught up.release.ymlnow passesSECFOO_VERSIONas a build arg. The Dockerfile installs exactly that version, retries up to 6 times, and ends withsecfoo --version. Without the arg it installs the latest release, as before.install.sh. A writablePREFIXwithoutbin/yet was silently ignored and the binary went to~/.local/bin. It now creates$PREFIX/bin.Verification
tests/test_store_privacy.py:0700write_private_textcreates0600files and tightens existing ones0600filesmcp_serversmainRUNloop, run in/bin/shwith a stubpip: succeeds first time, succeeds after 2 failures, exits 1 after 6 failures, and installs unpinned when no version is given.install.shrun for real withPREFIX=<new dir>: installs v0.3.1 into$PREFIX/binafter the checksum check. Before this change it went to~/.local/bin.Not in this PR (needs an account owner):
NPM_TOKENis unset, so@rakfortltd/secfoowas never published, although the README tells users tonpm install -git.🤖 Generated with Claude Code