RocketChat / RocketChat/Rocket.Chat.Electron

Rocket.Chat Electron creates config files with overly permissive file permissions (0666)

Open
#3,147 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: bug
Dominant language
TypeScript
Stars
1.7k
Forks
835
Avg merge
1d 21h
Merged PRs (30d)
15

Description

Search before asking
  • I had searched in the issues and found no similar issues.
Operating System
  • macOS
  • Windows
  • Linux
Operating System Version

Ubuntu 24.04.03

It happens on the web browser too?

No, it just happens on the Desktop app

Rocket.Chat Desktop App Version

4.9.2

Rocket.Chat Server Version

7.10.4

Describe the bug

The Rocket.Chat Electron client creates configuration files in ~/.config/Rocket.Chat/ with overly permissive file permissions. The files are created with mode 0666 (rw-rw-rw-), which means they are world-writable. This is unexpected and can be considered a security issue, as other local users can modify these configuration files.

How to Reproduce

Install app and check file permissions.

$ ls -lh ~/.config/Rocket.Chat/config.json ~/.config/Rocket.Chat/supportedVersions.json
-rw-rw-rw- 1 USER GROUP 22K Nov 27 09:24 ~/.config/Rocket.Chat/config.json
-rw-rw-rw- 1 USER GROUP 13K Nov 27 07:53 ~/.config/Rocket.Chat/supportedVersions.json
Describe your Expected behavior

Configuration files should have more restrictive permissions, typically 0600 or 0640, depending on whether group access is required.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the code that creates ~/.config/Rocket.Chat/config.json and supportedVersions.json, then reproduce the permissions check on Linux. Verify the fix by reinstalling or rerunning the app and confirming both files use restrictive permissions such as 0600 or 0640, as appropriate.

Written by the indexing model from the issue text.

Assessment

Tech stack
electron, typescript
Domain
desktop, security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.