CVE-2021-23375: Command Injection in psnode

psnode Updated 02 Oct 2025

Summary

06/05/2021
No i
High
7.3

CVE-2021-23375: Command Injection in psnode. Affects psnode versions < 0.0.1. No fix is published. 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 MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

The psnode package is an npm package that provides functionality for interacting with the process list on a system. It allows users to retrieve information about running processes and perform actions such as killing processes. The package is widely used in various applications and systems.

Vulnerability Detail

The vulnerability identified as CVE-2021-23375 affects all current versions of the psnode package. It arises from a command injection vulnerability in the kill function. If an attacker-controlled user input is passed to the kill function without proper sanitization, it becomes possible for the attacker to execute arbitrary commands. This vulnerability is a result of the package's use of the child_process exec function without input validation. Exploiting this vulnerability can lead to unauthorized command execution with the privileges of the user running the affected application.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

As a temporary workaround, it is advised to implement input validation and sanitization for user-controlled input passed to the kill function. By carefully validating and filtering user input, the risk of command injection can be mitigated. Here is an example of how input validation can be implemented in Node.js:

const { exec } = require('child_process');

function killProcess(processId) {
  if (!/^[0-9]+$/.test(processId)) {
    throw new Error('Invalid process ID');
  }

  exec(`kill ${processId}`, (error, stdout, stderr) => {
    if (error) {
      console.error(`Error executing kill command: ${error.message}`);
      return;
    }

    console.log(`Process killed: ${stdout}`);
  });
}

Conclusion

In conclusion, the psnode package is vulnerable to a command injection vulnerability (CVE-2021-23375) that allows attackers to execute arbitrary commands. To mitigate this vulnerability, it is crucial to update the package to a version that includes the necessary fixes. Implementing input validation and sanitization for user-controlled input passed to the kill function can serve as a temporary workaround. For further assistance and support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for psnode →

Share this vulnerability

FAQ

Exploiting this vulnerability can allow an attacker to execute arbitrary commands with the privileges of the user running the affected application. This can lead to unauthorized access, data breaches, and potential compromise of the entire system.

At the time of this advisory, there are no known public exploits specifically targeting this vulnerability. However, it is important to promptly apply the recommended fixes to mitigate the risk of potential exploitation.

No, this vulnerability requires an attacker to have control over user input that is passed to the kill function. Therefore, it can only be exploited by an attacker with local access or by leveraging another vulnerability that allows remote input injection.

If updating the package is not immediately feasible, implementing strict input validation and sanitization for user-controlled input passed to the kill function can help mitigate the risk of command injection. Additionally, restricting access to the affected functionality can limit the potential impact of the vulnerability.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. 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