2023-07-20のJS: vm2の開発終了、Storybook 7.1、Fresh 1.3 #1100
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Node.jsのnode:vmモジュールはSandbox(信用できないコードの実行環境)としては利用できませんが、vm2は
node:vm
をラップしてSandboxを提供するモジュールでした。今回、
vm2
の仕組み的に修正できないSandboxに関する脆弱性が発見されたため、メンテナンスを終了することが宣言されています。脆弱性の詳細はまだ公開されていませんが、Sandboxを破ることができる脆弱性で、PoCは8月ごろに公開される予定です。Sandbox機能が欲しい場合は、QuickJSをWebAssemblyにコンパイルしたquickjs-emscriptenやV8のIsolateを使ったisolated-vmへの移行を推奨しています。
proxy-agents(PACファイルを評価するためにvm2を利用していた)は
quickjs-emscripten
へ移行したようです。quickjs-emscripten
instead ofvm2
to execute PAC file code by TooTallNate · Pull Request #224 · TooTallNate/proxy-agentsvm2
はnode:vm
上で実行するコードからホスト環境を参照できないようにパッチで塞いでいくアプローチをとっていました。(📝node:vm
を使ったことがある人向けの話。contextとして渡すオブジェクトにProxyを使い、特定のプロパティを参照できなくするなど)これは軽量ですが、塞げない穴が出てきたり抜け漏れが出やすいアプローチです。
こういったSandboxにはどのようなアプローチがあるかは、次の記事が面白いと思います。
Storybook 7.1がリリースされました。
Storybook上でオンボーディングの追加、Emotionなどのスタイリングライブラリのセットアップを自動化、Vueのサポートの改善などが含まれています。
また今までコミュニティ開発であったFigma design addonをコアのAddonとして管理するようになっています。
Deno向けのウェブアプリケーションフレームワークであるFresh 1.3がリリースされました。
非同期のルートコンポーネントをサポート、プラグインがルーティングやミドルウェアを定義できるように、
_500.tsx
でのエラーページのサポート、ErrorBoundaryのサポートなどが追加されています。また、1ファイルから複数のislandsをexportできるように、
Deno.serve
のサポートなども追加されています。