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

Use quickjs-emscripten instead of vm2 to execute PAC file code #224

Merged
merged 8 commits into from Jul 18, 2023

Conversation

TooTallNate
Copy link
Owner

@TooTallNate TooTallNate commented Jul 18, 2023

The vm2 module has been deprecated and has critical security vulnerabilities. The suggested replacement module isolated-vm is not suitable for these packages, since it relies on a C++ binary. The reason for that is because the common use-case for these proxy agent modules is within CLI applications, which usually would not otherwise depend on a C++ module.

Instead, these packages will use the quickjs-emscripten module to execute the user code in an isolated QuickJS environment compiled to WASM. This should allow the highest level of sandboxing and will hopefully put an end to this cat and mouse game once and for all.

Fixes #218.

The `vm2` module has been deprecated and has critical security
vulnerabilities. The suggested replacement module `isolated-vm`
is not suitable for these packages, since it relies on a C++ binary.

Instead, these packages will use the `quickjs-emscripten` module to
execute the user code in an isolated QuickJS environment compiled to
WASM. This should allow the highest level of sandboxing and will
hopefully put an end to this cat and mouse game once and for all.

Fixes #218.
@changeset-bot
Copy link

changeset-bot bot commented Jul 18, 2023

🦋 Changeset detected

Latest commit: a8eb5fb

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
pac-proxy-agent Major
pac-resolver Major
degenerator Major
proxy-agent Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Jul 18, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
proxy-agents ✅ Ready (Inspect) Visit Preview Jul 18, 2023 8:44am

@sfc-gh-dszmolka
Copy link

sfc-gh-dszmolka commented Jul 20, 2023

hey @TooTallNate first of all major kudos for the quick fix here ! just a question: do you think there's any chance backporting the fix to earlier major versions of proxy-agent ? to be more precise, the v5 line.

edit: or perhaps only in degenerator v3 ?

@TooTallNate
Copy link
Owner Author

@sfc-gh-dszmolka No, the fix will not be backported since this commit is a breaking change.

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

Successfully merging this pull request may close these issues.

vm2 is now deprecated
2 participants