Command Injection
Description
Command injection in connection-tester before 0.2.1 allows arbitrary command execution via unsanitized host/port inputs.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Command injection in connection-tester before 0.2.1 allows arbitrary command execution via unsanitized host/port inputs.
Vulnerability
Overview
The connection-tester npm package prior to version 0.2.1 is vulnerable to command injection. The injection point is located at line 15 in index.js, where user-supplied host and port values are passed unsanitized to a system command. This allows an attacker to inject arbitrary shell commands through the host or port parameters [1].
Attack
Vector
The vulnerability is exploitable by providing a malicious host or port string to the testConnection function. No authentication is required, and the attack can be carried out remotely if the application passes user-controlled input to this function. The following PoC demonstrates the vulnerability (as per the CVE description):
// Example: host = "$(whoami)" or port = "80;id"
Actual command execution occurs when the package constructs a shell command using exec or similar without proper escaping, enabling arbitrary command execution on the server [2].
Impact
Successful exploitation allows an attacker to execute arbitrary commands on the host system with the privileges of the Node.js process. This can lead to full system compromise, data exfiltration, or further lateral movement within the network.
Mitigation
The vulnerability is fixed in version 0.2.1. Users should upgrade immediately. The fix introduces validation for host and port inputs as demonstrated in the pull request [1]. As of this writing, no CVE lists this as exploited in the wild, but given the low complexity and high impact, immediate patching is recommended.
AI Insight generated on May 21, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
connection-testernpm | < 0.2.1 | 0.2.1 |
Affected products
2- connection-tester/connection-testerdescription
Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
4- github.com/advisories/GHSA-w5mp-8p8w-mhh8ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2020-7781ghsaADVISORY
- github.com/skoranga/node-connection-tester/pull/10ghsax_refsource_MISCWEB
- snyk.io/vuln/SNYK-JS-CONNECTIONTESTER-1048337ghsax_refsource_MISCWEB
News mentions
0No linked articles in our index yet.