@jswork Next NPM Version Command Injection Vulnerability

Vulnerability

A command injection vulnerability exists in the NPM package '@jswork/next-npm-version' version 1.0.1. The issue arises in the 'npmVersion' function, where the 'inName' variable is not properly sanitized before being passed to 'execSync'. This oversight allows attackers to inject arbitrary commands when the 'npmVersion' function is called to check the version of an NPM package. The injected command is executed in the context of the Node.js process, potentially leading to unauthorized command execution.

Impact

Exploitation of this vulnerability allows for arbitrary command execution on the server where the package is used.

Reproduction

To reproduce this vulnerability, import the '@jswork/next-npm-version' package and call the 'npmVersion' function with a crafted package name that includes a command injection payload. The injected command will be executed on the server.

Added: May 7, 2026, 3:58 PM
Updated: May 7, 2026, 3:58 PM

Vulnerability Rating

Custom Algorithm
spread
0.0
impact
7.5
exploitability
8.7
remediation
0.0
relevance
7.7
threat
6.4
urgency
2.9
incentive
4.2

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.