Hardening: codeMode VM context exposes host-realm objects

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

メンテナーはふだん 1 日以内に返信

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

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
12/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
javascript, node.js, python
領域
security

調査の方向性

Start by locating the npm codeMode implementation and its node:vm context creation, plus where capabilities.sandbox is advertised, then read the existing source-text guard rails and the linked security policy. The real work is architectural: designing a separate-process or OS/container isolation boundary and removing host-realm callbacks from the VM context, so expect a design discussion before any patch. Done means untrusted code no longer inherits host prototypes and the reproduction no longer reaches filesystem or subprocess APIs.

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

説明

Summary

The npm codeMode implementation runs model- or user-supplied JavaScript in a node:vm context while passing host-created callbacks or objects into that context. A callback's host-realm prototype chain can be used to recover host JavaScript capabilities, bypassing the current source-text checks.

This was reproduced against the current published praisonai package and corresponding source. The bounded reproduction demonstrated local file read/write and invocation of a harmless subprocess under the PraisonAI process privileges.

Why this matters

The current implementation advertises capabilities.sandbox = true, but node:vm with host-realm objects is not an isolation boundary. Applications relying on codeMode for model- or user-controlled JavaScript may expose host process capabilities.

Suggested direction

Use a separate process or OS/container-backed isolation boundary for untrusted code. Avoid passing host-created functions or objects into the VM context, and do not rely on source-text regular expressions as containment.

This issue is opened in accordance with the current security policy's guidance for hardening issues involving built-in codeMode guard rails.

主要言語
Python
スター
9.3k
フォーク
1.5k
平均マージ
1日 5時間
マージ済み PR(30日)
520

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

MervinPraison/PraisonAI のほかの issue

MervinPraison/PraisonAI の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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