This repository was archived by the owner on Jun 1, 2026. It is now read-only.
security: CWE-377: Insecure tmp private keys — VC-53731#145
Open
torresashjiancyber wants to merge 1 commit into
Open
security: CWE-377: Insecure tmp private keys — VC-53731#145torresashjiancyber 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
Fixes CWE-377 (Insecure Temporary File) vulnerability in certificate issuance scripts that were writing private keys to /tmp with world-readable permissions.
Finding
The
issue-cert.shscripts in bothprojects/ccm-idp/andprojects/secrets-manager/were creating private key files in predictable /tmp locations with default permissions (0644), allowing any local user to read the private keys before they were moved or deleted.CVSS: 5.7 (CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N)
Remediation
Applied the following security hardening measures:
umask 077at script initialization to ensure all created files have 0600 permissions (readable/writable only by owner)/tmp/$cnand/tmp/${CERT_NAME}paths withmktemp -dfor cryptographically secure temporary directory creationtrap 'rm -rf "$tmp_dir"' EXITto ensure temporary files are deleted on script exit (success or failure)Verification