Skip to content

fix(security): input validation for 4 command injection vectors (issue #6089)#6112

Open
nexadodigital wants to merge 1 commit into
Unitech:masterfrom
nexadodigital:security/fix-pm2-issue-6089
Open

fix(security): input validation for 4 command injection vectors (issue #6089)#6112
nexadodigital wants to merge 1 commit into
Unitech:masterfrom
nexadodigital:security/fix-pm2-issue-6089

Conversation

@nexadodigital
Copy link
Copy Markdown

Security Fix: Command Injection and Arbitrary Method Invocation

Fixes 4 unpatched vectors from issue #6089 (reported 2026-03-06).

Vulnerability Summary

Vector File Impact
service_name injection lib/API/Startup.js RCE as root via systemctl
user path traversal lib/API/LogManagement.js Arbitrary file write + root code execution
remoteV2 method injection lib/API/Extra.js Arbitrary CLI method invocation via RPC
post-deploy shell injection lib/API/Deploy.js Shell injection in deploy hooks

Fix Approach

All fixes follow the same minimal pattern — validate attacker-controlled string inputs against a strict allowlist regex before they reach shell execution or filesystem operations. No dependencies added, no behavior changed for valid inputs.

Vectors already patched (not in this PR)

  • Vector 1 (WebAuth.js): fixed in commit 6178d6b
  • Vector 3 (HttpInterface env-strip): fixed in commit b6ef0ad
  • Vector 4 (Configuration.js prototype pollution): fixed in commit 2a48705

Ref: #6089

…nitech#6089)

Four unpatched command injection vulnerabilities from issue Unitech#6089:

- Startup.js: validate service_name before passing to systemctl shell commands
  (prevents RCE as root via --service-name flag)
- LogManagement.js: validate user param before writeFileSync path construction
  (prevents path traversal and logrotate postrotate script injection)
- Extra.js: add explicit allowlist for remoteV2 command parameter
  (prevents arbitrary CLI method invocation via RPC)
- Deploy.js: validate env name before shell string construction
  (prevents shell injection in post-deploy commands)

Ref: Unitech#6089
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Parv Sharma seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants