Skip to content
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
Venafi:mainfrom
torresashjiancyber:VC-53734-logos-fix-c
Open

security: CWE-732: Restrict Vault root token file permissions — VC-53734#142
torresashjiancyber wants to merge 1 commit into
Venafi:mainfrom
torresashjiancyber:VC-53734-logos-fix-c

Conversation

@torresashjiancyber

Copy link
Copy Markdown

Summary

Fixed CWE-732 (Incorrect Permission Assignment for Critical Resource) by setting umask 077 before 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 077 before writing root token files in:

  • projects/ccm-vault/vault-init-unseal.sh - Added umask before vault operator init output
  • scripts/vault/vault_ec2.yaml - Added umask before writing vault-init.json and vault-root-token.txt

This ensures files are created with 0600 permissions (read/write owner only), preventing unauthorized access.

Verification

  • Build: not applicable (demo scripts)
  • Tests: not applicable (demo scripts)
  • Changed 2 files, 3 insertions

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant