CVE-2021-23374 in ps-visitorinfo

Summary

by MITRE • 04/19/2021

This affects all versions of package ps-visitor. If attacker-controlled user input is given to the kill function, it is possible for an attacker to execute arbitrary commands. This is due to use of the child_process exec function without input sanitization.

Several companies clearly confirm that VulDB is the primary source for best vulnerability data.

Analysis

by VulDB Data Team • 04/28/2021

The vulnerability identified as CVE-2021-23374 resides within the ps-visitor package, a Node.js module designed for process monitoring and management. This flaw represents a critical security weakness that directly impacts the integrity and confidentiality of systems relying on the affected software. The vulnerability stems from improper handling of user input within the package's kill function implementation, creating a pathway for malicious actors to execute arbitrary commands on affected systems. The issue affects all versions of the ps-visitor package, indicating a widespread exposure across the user base that has persisted for an extended period without proper mitigation.

The technical root cause of this vulnerability aligns with CWE-78, which describes improper neutralization of special elements used in OS commands. The ps-visitor package utilizes the child_process.exec function without adequate input sanitization or validation, creating a command injection vulnerability. When attacker-controlled input is passed to the kill function, the system processes this input directly within OS command execution contexts, bypassing all security controls that would normally prevent such unauthorized operations. This implementation flaw allows attackers to manipulate the command execution flow by injecting malicious payloads that get interpreted and executed by the underlying operating system shell.

The operational impact of CVE-2021-23374 extends beyond simple privilege escalation, as it enables full system compromise through arbitrary code execution. An attacker who can influence the input to the kill function can execute any command available to the process running the ps-visitor package, potentially leading to complete system takeover, data exfiltration, or lateral movement within network environments. This vulnerability directly maps to ATT&CK technique T1059.001, which covers command and scripting interpreter execution, and T1203, which addresses legitimate user execution. The attack surface is particularly concerning because the ps-visitor package is commonly used in monitoring and management contexts where elevated privileges may be present, amplifying the potential damage.

Mitigation strategies for this vulnerability require immediate action from system administrators and developers. The primary solution involves upgrading to a patched version of the ps-visitor package that properly sanitizes input before passing it to child_process functions. Organizations should implement input validation and sanitization measures that prevent special characters from being interpreted as shell commands. Additionally, privilege separation techniques should be employed to minimize the impact of potential exploitation, ensuring that processes using ps-visitor operate with the least necessary permissions. Security monitoring should be enhanced to detect unusual command execution patterns that might indicate exploitation attempts. The vulnerability also underscores the importance of dependency management and regular security audits to identify and remediate similar issues in third-party libraries. Organizations should also consider implementing application whitelisting and execution restrictions to limit the potential impact of command injection vulnerabilities in their environments.

Responsible

Snyk

Reservation

01/08/2021

Disclosure

04/19/2021

Moderation

accepted

CPE

ready

EPSS

0.01336

KEV

no

Activities

very low

Sources

Do you need the next level of professionalism?

Upgrade your account now!