CVE-2022-25865: Command injection in workspace-tools

workspace-tools Updated 02 Oct 2025

Summary

14/05/2022
Yes i
Critical
9.8

CVE-2022-25865: Command injection in workspace-tools. Affects workspace-tools versions < 0.18.4. Fixed in 0.18.4. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

The package workspace-tools is an npm package that provides various tools and utilities for managing workspaces in a project. It is commonly used to streamline development workflows and improve collaboration among developers. However, the package is vulnerable to a command injection vulnerability, which allows an attacker to execute arbitrary commands by manipulating the arguments passed to the git fetch subcommand.

Vulnerability Detail

The vulnerability in workspace-tools arises from the insecure handling of user input when calling the fetchRemoteBranch function. The remote and remoteBranch parameters are not properly sanitized, allowing an attacker to inject additional flags that can be used to execute arbitrary commands. This can lead to various security risks, including unauthorized access, data leakage, and remote code execution. The severity of this vulnerability is rated as CRITICAL with a CVSS score of 9.8.

How To Fix

Minimum fixed version

0.18.4

This is the first release that contains the fix.

npm install workspace-tools@0.18.4

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If upgrading to the latest version is not immediately feasible, a temporary workaround can be implemented by manually sanitizing the user input before calling the fetchRemoteBranch function. This can be done by validating and sanitizing the remote and remoteBranch parameters to ensure they do not contain any malicious characters or additional flags. Here is an example of how the input can be sanitized in JavaScript:

function sanitizeInput(input) {
  // Implement input sanitization logic here
  return sanitizedInput;
}

const sanitizedRemote = sanitizeInput(remote);
const sanitizedRemoteBranch = sanitizeInput(remoteBranch);

fetchRemoteBranch(sanitizedRemote, sanitizedRemoteBranch, cwd);

Conclusion

The command injection vulnerability in the workspace-tools package poses a significant security risk, allowing attackers to execute arbitrary commands on the system. It is crucial to upgrade to the latest version of the package (0.18.4 or later) or apply the provided workaround to mitigate the risk. For further assistance or support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for workspace-tools →

Share this vulnerability

FAQ

Workspace-tools is an npm package that provides tools and utilities for managing workspaces in a project. It helps streamline development workflows and improve collaboration among developers.

Command injection is a security vulnerability that allows an attacker to execute arbitrary commands on a target system by injecting malicious input into a command execution context.

The vulnerability in workspace-tools allows an attacker to inject additional flags into the arguments passed to the git fetch subcommand. These additional flags can be used to execute arbitrary commands on the system.

The command injection vulnerability in workspace-tools can lead to unauthorized access, data leakage, and remote code execution. An attacker could exploit this vulnerability to gain control over the affected system and perform malicious actions.

To mitigate the risk of exploitation, it is recommended to upgrade to version 0.18.4 or later of the workspace-tools package. This version includes a fix for the command injection vulnerability. Additionally, ensure that user input is properly validated and sanitized before being used in any command execution context.

How To Fix

Minimum fixed version

0.18.4

This is the first release that contains the fix.

npm install workspace-tools@0.18.4

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback