Repository navigation
Conversation
newTempFile opened files with mode 0666, so after the usual umask they end up world- or group-readable (0644) in shared directories such as os.TempDir(). The files hold fetched and converted profile data and the generated report output, so on a multi-user host another local user can read them. Open them with 0600 instead, matching os.CreateTemp.
There was a problem hiding this comment.
Code Review
This pull request restricts the permissions of newly created temporary files from 0666 to 0600 to ensure they are only readable and writable by the owner. Additionally, a new unit test has been added to verify these file permissions on non-Windows platforms. There are no review comments, so I have no feedback to provide.
aalexand
reviewed
Oct 15, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1048 +/- ##
=======================================
Coverage 73.42% 73.42%
=======================================
Files 46 46
Lines 7936 7936
=======================================
Hits 5827 5827
Misses 2086 2086
Partials 23 23 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
aalexand
approved these changes
Oct 16, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
newTempFile opens temporary files with mode 0666, so with the usual umask they land as 0644 and are readable by other local users. The files hold fetched and converted profile data and the generated report output (svg/pdf) under shared directories like os.TempDir(), so another user on the machine can read a profile that isn't theirs. Open them with 0600 so only the owner has access, as os.CreateTemp does. Added a test that checks the created file has no group or other access.