CVE-2022-25171: p4 vulnerable to Command Injection due to improper input sanitization
7.4
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.65835%
CWE
Published
12/20/2022
Updated
8/17/2023
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| p4 | npm | < 0.0.7 | 0.0.7 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from the pre-patch implementation of runCommand in p4.js, which used child_process.exec() with string concatenation to execute p4 commands. This approach allowed command injection through specially crafted arguments, as demonstrated in the Snyk PoC. The patch replaced exec() with spawn() and array-based argument handling, confirming the vulnerability existed in the original runCommand implementation. The function is explicitly referenced in CVE descriptions and security advisories as the injection vector.