This repository was archived by the owner on Jun 1, 2026. It is now read-only.
security: CWE-732: Restrict Vault root token file permissions — VC-53734#142
Open
torresashjiancyber wants to merge 1 commit into
Open
security: CWE-732: Restrict Vault root token file permissions — VC-53734#142torresashjiancyber wants to merge 1 commit into
torresashjiancyber wants to merge 1 commit into
Conversation
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
Fixed CWE-732 (Incorrect Permission Assignment for Critical Resource) by setting
umask 077before writing Vault root token files to ensure they are created with 0600 permissions instead of world-readable 0644.Finding
The Vault demo scripts wrote root tokens to files without restrictive permissions. Under the default umask 022, these files were created as 0644 (world-readable), allowing any local user to obtain the Vault root token and gain unrestricted access to all secrets.
CVSS: 6.8 (CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N)
Remediation
Applied
umask 077before writing root token files in:projects/ccm-vault/vault-init-unseal.sh- Added umask before vault operator init outputscripts/vault/vault_ec2.yaml- Added umask before writing vault-init.json and vault-root-token.txtThis ensures files are created with 0600 permissions (read/write owner only), preventing unauthorized access.
Verification