Skip to content

fix: Secrets stored in world-readable temp state#42

Open
mrwind-up-bird wants to merge 1 commit intomainfrom
autofix/dd2853cd/secrets-stored-in-world-readab
Open

fix: Secrets stored in world-readable temp state#42
mrwind-up-bird wants to merge 1 commit intomainfrom
autofix/dd2853cd/secrets-stored-in-world-readab

Conversation

@mrwind-up-bird
Copy link
Copy Markdown
Collaborator

AutoFix: Secrets stored in world-readable temp state

Category: security
Severity: medium

Issue

During the brief window between file creation and chmod 600, the .env file containing database passwords and encryption keys is created with default permissions (typically 644). Other users or processes could potentially read these secrets before permissions are restricted.

Fix

The fix uses umask 077 in a subshell to ensure the .env file is created with 600 permissions (owner read/write only) from the moment of creation, eliminating the security window where secrets could be readable by other users. The explicit chmod 600 is removed as it's now redundant.


Generated by nyxCore AutoFix

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