pm2 icon indicating copy to clipboard operation
pm2 copied to clipboard

`critical` vm2 security issues

Open vsanse opened this issue 1 year ago • 25 comments

What's going wrong?

https://github.com/advisories/GHSA-cchq-frgv-rjh5

Security issue found in vm2, allows remote code execution

How could we reproduce this issue?

POC not yet disclosed.

Supporting information

vm2 is already deprecated. it suggests switching to isolated-vm https://github.com/patriksimek/vm2#%EF%B8%8F-project-discontinued-%EF%B8%8F

$ pm2 report

OUTPUT

--- PM2 report ----------------------------------------------------------------
Date                 : Tue Jul 18 2023 07:27:44 GMT+0000 (Coordinated Universal Time)
===============================================================================
--- Daemon -------------------------------------------------
pm2d version         : 5.3.0
node version         : 16.20.0
node path            : /home/user/.nvm/versions/node/v16.20.0/bin/pm2
argv                 : /home/ec2-user/.nvm/versions/node/v16.20.0/bin/node,/home/user/.nvm/versions/node/v16.20.0/lib/node_modules/pm2/lib/Daemon.js
argv0                : node
user                 : ec2-user
uid                  : 1000
gid                  : 1000
uptime               : 21212min
===============================================================================
--- CLI ----------------------------------------------------
local pm2            : 5.3.0
node version         : 16.20.0
node path            : /home/user/.nvm/versions/node/v16.20.0/bin/pm2
argv                 : /home/user/.nvm/versions/node/v16.20.0/bin/node,/home/user/.nvm/versions/node/v16.20.0/bin/pm2,report
argv0                : node
user                 : ec2-user
uid                  : 1000
gid                  : 1000
===============================================================================
--- System info --------------------------------------------
arch                 : x64
platform             : linux
type                 : Linux
cpus                 : Intel(R) Xeon(R) CPU E5-2686 v4 @ 2.30GHz
cpus nb              : 2
freemem              : 2253070336
totalmem             : 4111364096
home                 : /home/user
===============================================================================

vsanse avatar Jul 18 '23 07:07 vsanse

Up. Need this fixed ASAP for CI/CD Pipeline which recognizes this as a Critical risk

gabrielenosso avatar Jul 18 '23 15:07 gabrielenosso

The proxy-agent dependency just released a new version 6.3.0 that no longer depends on vm2: https://github.com/TooTallNate/proxy-agents/releases

mterrel avatar Jul 18 '23 16:07 mterrel

Up. Need this fixed ASAP for CI/CD Pipeline which recognizes this as a Critical risk

+1 https://github.com/Unitech/pm2/issues/5639

boxexchanger avatar Jul 19 '23 13:07 boxexchanger

Up. Need this fixed ASAP for CI/CD Pipeline which recognizes this as a Critical risk

+1

+1

eladkolet avatar Jul 19 '23 13:07 eladkolet

+1

ruslanrusu avatar Jul 19 '23 16:07 ruslanrusu

+1

Braicce avatar Jul 19 '23 20:07 Braicce

+1

OIRNOIR avatar Jul 19 '23 21:07 OIRNOIR

+1

frztmr avatar Jul 21 '23 02:07 frztmr

Thanks for maintaining pm2, @Unitech! Is there something I can do to help you with getting a new release out? Would a PR to bump proxy-agent be helpful? Any particular sanity checks with the new version that it might be helpful to do in preparation for a release?

lognaturel avatar Jul 21 '23 21:07 lognaturel

+1

medbenmakhlouf avatar Jul 21 '23 23:07 medbenmakhlouf

+1

@Unitech Is there anything that you may communicate at the moment? Any timeline for the fix? Are you aware of the problem and are working on a solution?

cklat avatar Jul 24 '23 10:07 cklat

+1

@Unitech Is there anything that you may communicate at the moment? Any timeline for the fix? Are you aware of the problem and are working on a solution?

They are working on it.

OIRNOIR avatar Jul 24 '23 13:07 OIRNOIR

+1

@Unitech Is there anything that you may communicate at the moment? Any timeline for the fix? Are you aware of the problem and are working on a solution?

An update was just released to @pm2/agent updating proxy-agent to version 6.3.0. Run npm update to ensure that you have the latest version. If your pm2 is installed globally, don't forget to also sudo npm update -g Still awaiting a fix to the semver issue: https://github.com/keymetrics/pm2-io-agent/pull/131

OIRNOIR avatar Jul 24 '23 14:07 OIRNOIR

+1

orange1337 avatar Jul 28 '23 12:07 orange1337

+1

jrwhite17 avatar Jul 28 '23 16:07 jrwhite17

Snyk is still reporting this as a vulnerability when I do a package.json overrides to pm2/[email protected], any thoughts?

CVE-2023-37466 Introduced through: [email protected] › @pm2/[email protected][email protected][email protected][email protected][email protected][email protected] Fix: No remediation path available.

denodaeus avatar Aug 02 '23 01:08 denodaeus

yes. [email protected] depends on [email protected] depends on [email protected] with no dependency on vm2!

Enrice avatar Aug 02 '23 08:08 Enrice

May I ask how the progress is ?

+1 @Unitech Is there anything that you may communicate at the moment? Any timeline for the fix? Are you aware of the problem and are working on a solution?

They are working on it.

jieLi086 avatar Aug 17 '23 06:08 jieLi086

May I ask how the progress is ?

+1 @Unitech Is there anything that you may communicate at the moment? Any timeline for the fix? Are you aware of the problem and are working on a solution?

They are working on it.

I don't know what you mean.

  • vm2 is no longer a dependency
  • semver was updated to ~7.5.0, so current 7.5.4 with vulnerability fix can be used

Enrice avatar Aug 17 '23 13:08 Enrice

Thank you for your answer. This has already solved my problem

jieLi086 avatar Aug 18 '23 03:08 jieLi086

Same here. For some reason, I thought the pm2 package had to change, and I was waiting for a pm2 release. It looks like just @pm2/agent, a subdependency of pm2, needs to be updated:

npm update @pm2/agent

matthew-white avatar Aug 18 '23 18:08 matthew-white

Running yarn upgrade solved the issue for my project.

RobinTail avatar Aug 30 '23 15:08 RobinTail

This is all fixed. Feel free to close this issue.

OIRNOIR avatar Sep 17 '23 19:09 OIRNOIR

This is all fixed. Feel free to close this issue.

@vsanse

OIRNOIR avatar Sep 19 '23 16:09 OIRNOIR

for anyone using yarn: add the following to your package.json and rerun yarn. "resolutions": { "@pm2/agent": "2.0.3" },

confirm that vm2 is removed: yarn why vm2 -R

tlebon avatar Mar 06 '24 16:03 tlebon