CVE-2021-23355: Command Injection in ps-kill

ps-kill Updated 02 Oct 2025

Summary

19/03/2021
No i
Critical
9.8

CVE-2021-23355: Command Injection in ps-kill. Affects ps-kill versions < 1.0.0. 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-kill package is an npm package used for terminating processes on a system. It provides a convenient way to kill processes based on their process ID (PID) or name. The package is widely used in various applications and environments.

Vulnerability Detail

The vulnerability (CVE-2021-23355) in ps-kill allows an attacker to execute arbitrary commands by injecting malicious input. This occurs due to the lack of input sanitization in the kill function of the package's index.js file. By providing attacker-controlled input to the kill function, an attacker can execute arbitrary commands on the system. The vulnerability has a CVSS score of 9.8 (Critical), indicating its severity. Exploiting this vulnerability can lead to unauthorized command execution and potential compromise of the affected system.

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, users can implement input sanitization or validation before passing user input to the kill function. This can help prevent command injection attacks. Here is an example of how input validation can be implemented in Node.js:

const ps_kill = require('ps-kill');

function sanitizeInput(input) {
  // Implement input sanitization logic here
  // Return sanitized input
}

const userInput = '$(touch success)';
const sanitizedInput = sanitizeInput(userInput);

ps_kill.kill(sanitizedInput, function() {
  // Callback function
});

Conclusion

The ps-kill package is vulnerable to a command injection vulnerability (CVE-2021-23355) that allows attackers to execute arbitrary commands on the system. To mitigate this vulnerability, it is crucial to update the package to version 1.0.1 or later. Implementing input sanitization or validation can serve as a temporary workaround. For further assistance and support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for ps-kill →

Share this vulnerability

FAQ

ps-kill is an npm package used for terminating processes on a system. It provides a convenient way to kill processes based on their process ID (PID) or name.

This vulnerability allows an attacker to execute arbitrary commands on the system by injecting malicious input. Exploiting this vulnerability can lead to unauthorized command execution and potential compromise of the affected system.

To fix the vulnerability, update the ps-kill package to a version that includes a patch for the command injection issue. The package maintainers have addressed this vulnerability in version 1.0.1 and later. Update your package dependencies to the latest version.

As a temporary workaround, implement input sanitization or validation before passing user input to the kill function. This can help prevent command injection attacks. Refer to the provided code example in the 'workaround' section for more details.

The CVSS score of this vulnerability is 9.8 (Critical), indicating its severity.

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