Change XDG_RUNTIME_DIR mode from 0777 to 0700#1333
Open
Conversation
Member
Author
|
Needs some testing, easiest way for me to get a system distro VHD is to use this CI. |
|
In the meantime, would you recommend changing the permissions on the runtime dir to get weston running again? |
There was a problem hiding this comment.
Pull request overview
This PR addresses a security concern by changing the permissions of the XDG_RUNTIME_DIR directory from world-accessible (0777) to user-only access (0700), as reported in issue #12884.
Changes:
- Modified the chmod call for XDG_RUNTIME_DIR from 0777 to 0700 for improved security
Comments suppressed due to low confidence (2)
WSLGd/main.cpp:290
- The c_dbusDir is also set with overly permissive 0777 permissions on line 290. Since this directory is owned by the same user (passwordEntry->pw_uid) as c_xdgRuntimeDir (line 289), it should similarly be restricted to 0700 for consistency and security.
THROW_LAST_ERROR_IF(chmod(c_dbusDir, 0777) < 0);
WSLGd/main.cpp:293
- The c_x11RuntimeDir uses overly permissive 0777 permissions without ownership assignment. Unlike c_xdgRuntimeDir which has chown applied, this directory has no ownership set and allows world-write access. Consider whether these permissions are necessary or if they should be restricted.
THROW_LAST_ERROR_IF(chmod(c_x11RuntimeDir, 0777) < 0);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Member
Author
|
I'm not 100% sure we can make this change. We need to test creating a user whos UID does not equal 1000 and make sure GUI apps work for them. |
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.
Reported by microsoft/WSL#12884