Unitech / Unitech/pm2

PM2 is susceptable to inspector port attack through SIGUSR1

Open
#6,001 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
43.3k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

By default Node.js will listen for SIGUSR1 and start its internal inspector when it is received. This creates a security risk on production systems as the inspector interface could be used to eavesdrop on RPC intractions, for example, and execute arbitrary code in general.
For example in our infrastructure we use a PM2 module to listen for apps starting/restarting and send them their 'secrets' (API/signing keys etc) through sendLineToStdin(). However if a bad actor would manage to get access to the system they could send SIGUSR1 to the PM2 God process, attach a debugger and set some breakpoints to intercept these transactions and therefore steal the secrets.

This can easily be prevented by registering a no-op handler for SIGUSR1, as is recommended in the Security best practices provided by the Node.js team: https://nodejs.org/en/learn/getting-started/security-best-practices.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the PM2 God process entry point and its signal handling, then review Node.js security guidance for SIGUSR1 and the inspector. Done means SIGUSR1 no longer enables the inspector in the PM2 God process, with regression coverage confirming the behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
cli, security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.