Repository navigation
V15: Deny .env files to workspace tools by default - #680
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
LinuxDevil
force-pushed
the
v15-deny-env
branch
from
October 19, 2026 21:31
c86724d to
3da6ed8
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.
Fixes audit finding SEC-9 (Vercel competitor audit, 2026-10-19).
What was wrong
The fs tools' default deny list covered only
.git, soread_file .envreturned the file's contents and a prompt-injected model could read secrets.What changed
denyis now['.git', '.env', '.env.*'].*is a prefix match; it never matches.env.example,.env.sampleor.env.template.pkg/.env), case (.ENV), trailing dots/spaces and Windows 8.3 aliases work, and the realPath link guard covers symlinks/junctions the same way as.git.denystill replaces the defaults (unchanged); documented in docs/workspace-tools.md. llms-full.txt regenerated.Behavior change: workspace file tools (
read_file,write_file,edit_file,list_dir,glob,grep) now refuse.envand.env.*(except.example/.sample/.template) by default. Passdeny: ['.git']to restore the old behavior.Tests
New tests in fsTools.test.ts:
.env,sub/.env,.env.local,.env.production,.ENVetc. are refused with the existing deny error;.env.example/.sample/.templateand.environmentreadable;.gitstill refused; customdenyreplaces defaults. Ran tsc, typecheck:tests, lint, docs:llms, vitest on src/tools/workspace and scripts: pass. Full coverage run has 6 failures unrelated to this change (create-lousho-agent tests need built packages/*/dist; a tracing test; sharedChunks needs dist), sonpm run fallowcould not read coverage locally.Changelog: Workspace file tools now deny
.envand.env.*(not.env.example/.sample/.template) by default alongside.git.🤖 Generated with Claude Code