Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eliminate use of state/node files in temp directory #40

Closed
wants to merge 4 commits into from
Closed

Eliminate use of state/node files in temp directory #40

wants to merge 4 commits into from

Conversation

bleargh45
Copy link
Owner

#5 identifies a security concern due to insecure writing of State/Node files in a temporary directory, with predictable filenames, with a possible symlink attack.

Rather than attempting to address the issue by using more random filenames, or by adding extra logic to ensure that the files are being handled in a secure manner, this PR simply eliminates the use of these files completely.

Unfortunately, the historical reason for why the files were originally needed is lost, but discussion present in #5 posits that they may have been present for performance reasons.

Existing test suite passes without change.

Further, the issue highlighted in #27 regarding "duplicate UUIDs after fork" does not appear to be any worse with these changes to remove the state/node files. After running the command documented in #27 repeatedly, both before and after this change, I see no increase in the number of duplicate UUIDs.

CVE-2013-4184 discusses the insecure usage of `/tmp/.UUID_STATE` and
`/tmp/.UUID_NODEID`, due to a potential symlink attack.

Unfortunately, this code is old enough that none of the current
maintainers fully understand the history of the code, nor do we have
sufficient context from the commit history.

Rather than attempting to address this vulnerability by changing the
location of where these files are written, or by adding additional logic
to ensure that they are handled securely, this patch addresses the issue
by eliminating the need for these two files completely.
Now that we are no longer saving any context (of either the Node, or the
State), we no longer need to maintain a "when should we do the next
save?" field in the UUID context.
We no longer save any State/Node files to disk, so we do not need to
keep track of what the requested umask was for those files.
We no longer save State/Node files out to disk, and so we no longer
require the option to specify what directory those files should be
recorded or saved to.
@bleargh45 bleargh45 closed this by deleting the head repository Oct 5, 2022
@karenetheridge
Copy link

why was this closed?

@bleargh45
Copy link
Owner Author

@karenetheridge we are in the process of transferring the repository, but doing that required us to blow away my forked repository.

So no, we are not dropping this MR, just shuffling things around so that someone (me) can help find time to try to move the various MRs/issues ahead.

@jjatria
Copy link

jjatria commented Jul 24, 2023

@bleargh45 Are there any updates on this? Is there anything we can do to help move this along?

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.

3 participants