CVE-2021-23374: Command Injection in ps-visitor

ps-visitor Updated 02 Oct 2025

Summary

07/05/2021
No i
Critical
9.8

CVE-2021-23374: Command Injection in ps-visitor. Affects ps-visitor versions < 0.0.2. 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 Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The ps-visitor package is an npm package used for visiting and analyzing processes on a system. It provides functionality to interact with processes, including the ability to kill them. The vulnerability in ps-visitor allows an attacker to execute arbitrary commands by providing attacker-controlled user input to the kill function. This vulnerability exists in all versions up to and including version 0.0.2 of the package. The vulnerability arises due to the lack of input sanitization when using the child_process exec function.

Vulnerability Detail

The command injection vulnerability in ps-visitor allows an attacker to execute arbitrary commands on a system. By providing malicious input to the kill function, an attacker can manipulate the command executed by the child_process exec function. This can lead to various malicious activities, such as executing arbitrary code, gaining unauthorized access, or disrupting the normal functioning of the system. The severity of this vulnerability is rated as CRITICAL with a CVSS score of 9.8.

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

If updating to a newer version of ps-visitor is not immediately possible, a temporary workaround can be implemented. It is advised to thoroughly validate and sanitize any user input before passing it to the kill function. By implementing proper input sanitization, the risk of command injection can be mitigated. Here is an example of how input sanitization can be done in JavaScript:

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

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

const userInput = sanitizeInput(userInputFromUser);
exec(`kill ${userInput}`, (error, stdout, stderr) => {
  // Handle the execution result
});

Conclusion

In conclusion, the ps-visitor package is vulnerable to command injection, allowing an attacker to execute arbitrary commands on a system. To mitigate this vulnerability, it is recommended to update to a version higher than 0.0.2 or implement proper input sanitization. For further support on vulnerability remediation, you can contact DevNack.com.

See every vulnerability recorded for ps-visitor →

Share this vulnerability

FAQ

This vulnerability allows an attacker to execute arbitrary commands on a system. Depending on the privileges of the user running the vulnerable code, this can lead to unauthorized access, data breaches, or disruption of the system's normal operation.

While there are no known public exploits for this specific vulnerability at the moment, it is important to address it promptly to prevent any potential exploitation.

Yes, all versions up to and including version 0.0.2 of ps-visitor are affected by this vulnerability. It is recommended to update to a version higher than 0.0.2 to mitigate the risk.

Yes, the maintainers of ps-visitor have addressed this vulnerability in later versions by implementing input sanitization. It is advised to update to the latest version to ensure the vulnerability is patched.

You can use Vulert's playground (https://vulert.com/scanner) to check if your application is affected by this vulnerability. Vulert monitors and alerts in real-time for open-source vulnerabilities, using just the package-lock.json file.

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