TooTallNate / proxy-agents

Node.js HTTP Proxy Agents Monorepo
https://proxy-agents.n8.io
872 stars 229 forks source link

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

Closed TooTallNate closed 11 months ago

TooTallNate commented 11 months ago

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.

changeset-bot[bot] commented 11 months ago

🦋 Changeset detected

Latest commit: a8eb5fba10248313faa29a78bf4e15def9a322fb

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[bot] commented 11 months ago

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 commented 11 months ago

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 commented 6 months ago

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