RocketChat / RocketChat/Rocket.Chat
Shell command is built from environment values
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 46.1k
- Forks
- 13.9k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 130
Description
Description:
When executing the build process in different environments, the use of execSync in the build-livechat.js file poses a potential shell command injection vulnerability. The dynamic shell command construction with values from the local environment may inadvertently change the meaning of the shell command.
Steps to reproduce:
Clone the Rocket.Chat repo
Navigate to the packages/rocketchat-livechat/plugin/build-livechat.js file
Review the execSync calls within this file
Expected behavior:
The shell commands should be constructed securely, to prevent potential shell command injection. Using execFileSync with arguments provided as an array can help achieve this.
Actual behavior:
Currently, execSync is used with dynamically constructed commands, which can pose a potential security risk if environment values are interpreted by the shell in an unintended way.
Server Setup Information:
Version of Rocket.Chat Server: Latest
Operating System: All
Deployment Method: All
Number of Running Instances: Not applicable
DB Replicaset Oplog: Not applicable
NodeJS Version: Not applicable
MongoDB Version: Not applicable
Client Setup Information
- Desktop App or Browser Version: NA
- Operating System: NA
Relevant logs:
No logs are available for this issue, as it pertains to code analysis rather than a runtime error.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in apps/meteor/packages/rocketchat-livechat/plugin/build-livechat.js, especially the execSync call at line 22, and review how environment values enter each command. Compare the build process behavior with Node.js child-process APIs. Done means the commands no longer allow environment values to alter shell interpretation; verify by running the relevant build process.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- build-system, security
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100