vscode-cpptools
vscode-cpptools copied to clipboard
Home directories are created as world writable
Environment
- OS and version: Debian sid
- VS Code: 1.69.2
- C/C++ extension: v1.11.4
Bug Summary and Steps to Reproduce
Bug Summary:
The cpptools extension creates home directories as world-writable.
Steps to reproduce:
- Start vscode
find ~ -type d \( -perm -0002 \) -print/home/user/.cache/vscode-cpptools /home/user/.cache/vscode-cpptools/ipch /home/user/.cache/vscode-cpptools/ipch/58f22437dcceb170 /home/user/.config/Code/User/workspaceStorage/6436be42c71df59dad4c490a7584641d/ms-vscode.cpptools
Other Extensions
No response
Additional Information
No response
Hi @cgzones .
On linux, those directories are being created using the following call to mkdir:
mkdir(path, 0777 & ~umask(0));
Is there a benefit to restricting permissions of directories to 755 or 700?
Is there a benefit to restricting permissions of directories to 755 or 700?
If for example all parent directories were created with a default umask of 0022, other users can modify those directories and their contents.
mkdir(path, 0777 & ~umask(0));
Why set the file mode creation mask to 0, which will affect the mode result for the next file creation? (mkdir(2) already internally takes the current umask value into account.)
The fix is available with 1.13.3 (pre-release): https://github.com/microsoft/vscode-cpptools/releases/tag/v1.13.3