Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vm2 Sandbox Escape vulnerability #1024

Closed
ajaykarthikr opened this issue Jul 17, 2023 · 6 comments
Closed

vm2 Sandbox Escape vulnerability #1024

ajaykarthikr opened this issue Jul 17, 2023 · 6 comments

Comments

@ajaykarthikr
Copy link

Npm is reporting vm2 vulnerability again. I have noticed the packages were updated recently but it seems the issue wasn't resolved. I looked at the vm2 package, the author suggests to use an alternative.

TL;DR The library contains critical security issues and should not be used for production! The maintenance of the project has been discontinued. Consider migrating your code to isolated-vm.

Is it possible to fix this issue? This comes from degenerator dependency

Severity: critical
vm2 Sandbox Escape vulnerability - GHSA-cchq-frgv-rjh5

Reference: TooTallNate/proxy-agents#218

@webpro
Copy link
Collaborator

webpro commented Jul 17, 2023

Thanks, @ajaykarthikr. The proxy-agent dependency is used in the GitHub plugin, and only when the github.proxy is set. Most people don't use this, but on the other hand it is vital to some (e.g. when behind firewalls etc).

Let's track the reference issue indeed. Other suggestions also welcome of course.

❯ npm why vm2
vm2@3.9.19
node_modules/vm2
  vm2@"^3.9.19" from degenerator@4.0.4
  node_modules/degenerator
    degenerator@"^4.0.4" from pac-resolver@6.0.2
    node_modules/pac-resolver
      pac-resolver@"^6.0.1" from pac-proxy-agent@6.0.4
      node_modules/pac-proxy-agent
        pac-proxy-agent@"^6.0.4" from proxy-agent@6.2.2
        node_modules/proxy-agent
          proxy-agent@"6.2.2" from the root project

@kamal-brill
Copy link

@webpro I understand, but as package it's throwing critical errors when we run npm audit. So we are eagerly waiting for this to get resolved.

@webpro
Copy link
Collaborator

webpro commented Jul 18, 2023

FYI, I'm not a security expert, but if this explanation is correct it sounds like the leak can only be exploited when the url (github.proxy in release-it) points to a pac (proxy auto config) file. If someone has a better understanding of this I'm all ears.

Usually release-it is a devDependency, not meant to run in your production environment.

Security tooling is essential, keep assessing the actual risks for your own circumstances.

arafel added a commit to arafel/CaptchaJs that referenced this issue Jul 19, 2023
It's causing problems where sometimes we can't merge changes due to a
problem in a package 4 levels down that's only used for making releases.

(vm2, I'm looking at you.)

TooTallNate/proxy-agents#218 (comment)
release-it/release-it#1024 (comment)
arafel added a commit to arafel/CaptchaJs that referenced this issue Jul 19, 2023
It's causing problems where sometimes we can't merge changes due to a
problem in a package 4 levels down that's only used for making releases.

(vm2, I'm looking at you.)

TooTallNate/proxy-agents#218 (comment)
release-it/release-it#1024 (comment)
@ghiscoding
Copy link
Contributor

ghiscoding commented Jul 19, 2023

FYI, I also came here because I got security messages from GitHub as well and I did notice it came from proxy-agent from a transitive dependency. I then search on proxy-agent and found that they indeed worked on addressing the issue via this PR - Use quickjs-emscripten instead of vm2 to execute PAC file code, the PR was merged yesterday and it looks like they also released it as proxy-agent release v6.3.0 has the fix. So @webpro you might be able to just update to the latest version of proxy-agent and that will hopefully resolve the issue!? Crossing finger 🤞🏻

If it doesn't then I know release-it is a dev deps, so it's not the end of the world, but it's nice to see no security issue showing in audit though :)

@webpro
Copy link
Collaborator

webpro commented Jul 20, 2023

🚀 This issue has been resolved in v16.1.3. See Release 16.1.3 for release notes.

@webpro webpro closed this as completed in 79430b4 Jul 20, 2023
@webpro
Copy link
Collaborator

webpro commented Jul 20, 2023

Thanks for your notification, @ghiscoding!

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

No branches or pull requests

4 participants