Skip to content

Warn when .env can be read by other users (roadmap 4.10) - #30

Merged
Castor-o7 merged 1 commit into
mainfrom
pdx-37-env-permissions
Oct 31, 2026
Merged

Castor-o7 merged 1 commit into
mainfrom
pdx-37-env-permissions

Conversation

@Castor-o7

Copy link
Copy Markdown
Owner

Story: PDX-37

Loading a .env that group or others can access prints one warning to stderr with the chmod 600 fix, and never the contents. The file still loads. Platforms without POSIX modes skip the check.

Limits

It's a warning, not a refusal. A container's env_file is read by Docker, so this doesn't see it. On Docker Desktop or mounted filesystems modes can read as loose, which would give a false warning.

Tested

Full suite passes locally; see CI for other versions. Tests cover 600 (quiet), 644, 640 and 604 (one warning, no contents, still loads), and no POSIX modes (quiet). With the warning removed the test fails, and it passes with the code intact. Live on the real CLI with a temp home: warned at 644, quiet at 600. With a 644 file, paradox mcp answered a ping with protocol-only stdout.

Not tested

Real Windows, or a mounted filesystem.

🤖 Generated with Claude Code

The file holds every API key and the web password. Loading a loose one prints
one warning to stderr with the fix, and never the file's contents.

Story: PDX-37

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Castor-o7
Castor-o7 merged commit b597c05 into main Oct 31, 2026
5 checks passed
@Castor-o7
Castor-o7 deleted the pdx-37-env-permissions branch October 31, 2026 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant