Unable to use extensions that depend on unsafe-eval policy, in code-editor

オープン
#301 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
52/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
javascript
領域
frontend, security

調査の方向性

まず、Code Editor が web/worker host で CommonJS 拡張機能をどのように読み込み、CSP ポリシーがどこで設定されているかを追跡します。vscodevim.vim 拡張機能のアクティベーションを再現し、その後、報告された EvalError なしで意図したポリシーの下で動作することを確認します。

索引モデルが issue の本文から書いたものです。

説明

Description:
The change in the security policy from unsafe-eval to wasm-unsafe-eval stops JavaScript from turning strings into runnable code.

  • Vim is a CommonJS format extension.
  • When Code Editor loads a CommonJS extension in the web/worker host, it wraps the code string in a function and executes it.
  • In the Code Editor space, the new CSP policy blocks that step, so it fails.

2026-09-10 16:47:24.991 [error] Activating extension vscodevim.vim failed due to an error: 2026-09-10 16:47:24.991 [error] EvalError: Evaluating a string as JavaScript violates the following Content Security Policy directive because 'unsafe-eval' is not an allowed source of script: script-src 'self' 'wasm-unsafe-eval' 'sha256-8VDNIuBNbWfgSAsMFpnaas1UmjLKHwTaKfM2t/FPUfc=' https: http://localhost:* blob:".

https://www.w3.org/TR/CSP3/#directive-script-src
Per the CSP spec, new Function() is gated only on 'unsafe-eval'; 'wasm-unsafe-eval' "only permits WebAssembly and does not affect JavaScript." So replacing 'unsafe-eval' with 'wasm-unsafe-eval' removes the exact permission the extension loader needs, and the browser throws EvalError.

Ticket ID: D523182748

主要言語
Shell
スター
26
フォーク
24
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

aws/code-editor のほかの issue

aws/code-editor の issue をすべて見る

似ている issue

Shell/Bash の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。