fix(security): block dotenv variants from agent and IDE IO - #143
Draft
cursor[bot] wants to merge 2 commits into
Draft
cursor[bot] wants to merge 2 commits into
cursor[bot] wants to merge 2 commits into
Conversation
.read_file/.write_file and the desktop workspace editor only treated an exact .env suffix as sensitive, so .env.local and similar files were readable and writable. Treat .env, .envrc, and .env.* path components as blocked, with regression tests. Co-authored-by: EXboy <EXboys@users.noreply.github.com>
Record verification commands, mark TASK-2026-071 done, and sync the board. Co-authored-by: EXboy <EXboys@users.noreply.github.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.
Summary
read_file/write_fileand the desktop IDE workspace editor treated.envas a hard-blocked sensitive path, but the check only matched an exact.envsuffix or a/.env/directory..env.local,.env.production,.envrc) were readable and writable. In a Vite/Next.js workspace this leaks values such asDATABASE_URLinto the model context, or lets the agent overwrite local env files..env,.envrc, or starting with.env.as sensitive, keeping existing.key/.pem/.git/configblocks.Task Linkage
TASK-2026-071tasks/TASK-2026-071-block-dotenv-variants/Injected Specs
spec/security-nonnegotiables.md(if sandbox/security changed)spec/testing-policy.md(required for any code change)spec/docs-sync.md(if behavior/docs/env/commands changed)spec/architecture-boundaries.md(if architecture/layering changed)Validation Evidence
python3 scripts/validate_tasks.py— passed (71 task directories)cargo fmt --check— exit 0cargo clippy --all-targets -- -D warnings— exit 0cargo test -p skilllite-agent— 251 passed, 0 failedcargo test(workspace) — all crates ok, 0 failedgdk-3.0missing in this environmenttest_read_file_blocks_dotenv_variantspassedtest_write_file_blocks_dotenv_variantspassedblocks_dotenv_and_common_variantspassedsrc/env.rs/environment.jsonstill allowedRegression Scope
read_file,write_file,search_replace,insert_lines)Docs Sync (EN/ZH)
docs/en/ARCHITECTURE.mddocs/zh/ARCHITECTURE.mdcrates/skilllite-assistant/README.mdReview Checklist
tasks/TASK-2026-071-block-dotenv-variants/TASK.mdsatisfied (or explicitly deferred)tasks/TASK-2026-071-block-dotenv-variants/STATUS.mdupdated with latest progresstasks/TASK-2026-071-block-dotenv-variants/REVIEW.mdincludes merge readiness decisiontasks/board.mdstatus is up to date