Miggo Logo

CVE-2021-23359: Code injection in port-killer

7.5

CVSS Score
3.1

Basic Information

EPSS Score
0.68919%
Published
4/13/2021
Updated
2/1/2023
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
port-killernpm<= 1.0.1

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems directly from using child_process.exec() with untrusted input in the port-killer module. The advisory specifically references line 19 of index.js which contains command execution logic. The PoC demonstrates that user input is interpolated into a shell command without proper sanitization, enabling arbitrary command injection through shell command concatenation. While the exact function name isn't explicitly stated in advisories, the code structure and vulnerability pattern indicate the main port-killing function using exec() with user-controlled port parameter is vulnerable.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

T*is *****ts *ll v*rsions o* p**k*** port-kill*r. I* (*tt**k*r-*ontroll**) us*r input is *iv*n, it is possi*l* *or *n *tt**k*r to *x**ut* *r*itr*ry *omm*n*s. T*is is *u* to us* o* t** **il*_pro**ss *x** *un*tion wit*out input s*nitiz*tion. Runnin* t*

Reasoning

T** vuln*r**ility st*ms *ir**tly *rom usin* **il*_pro**ss.*x**() wit* untrust** input in t** port-kill*r mo*ul*. T** **visory sp**i*i**lly r***r*n**s lin* ** o* in**x.js w*i** *ont*ins *omm*n* *x**ution lo*i*. T** Po* **monstr*t*s t**t us*r input is