permissions: { network: "allow" } authorizes egress but guest fetch() hangs — no host network adapter on public API
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 52/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- node.js, typescript
- 領域
- api, backend, documentation
調査の方向性
まず、公開 NodeRuntime.create API で 10 秒のタイムアウトを再現し、次に NodeRuntimeCreateOptions と、参照されている test-runtime の定義(NetworkAdapter および hasHostNetworkAdapter() を含む)を調査します。公開されている @secure-exec/core の index.d.ts と、クイックスタートの Permissions Configuration セクションを確認します。外向きのリクエストが文書化された公開セットアップを通じて機能するか、またはアダプターなしでは network: "allow" が即座に失敗し、クイックスタートが明確化されていれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Summary
Granting permissions: { network: "allow" } via the public NodeRuntime.create API authorizes guest network access, but there is no way through the public SDK to provide a host network adapter to actually service outbound requests. As a result, an outbound fetch() in guest code hangs indefinitely instead of either succeeding or failing fast.
The quickstart's Permissions Configuration section implies network: "allow" is sufficient to enable network, so this is misleading as written.
Environment
[email protected]/@secure-exec/[email protected]- Node.js v24.13.0, Linux
Repro
import { NodeRuntime } from "secure-exec";
const rt = await NodeRuntime.create({ permissions: { network: "allow" } });
const r = await Promise.race([
rt.run(`
try { const res = await fetch("https://example.com"); __return({ status: res.status }); }
catch (e) { __return({ err: String(e.message || e) }); }
`),
new Promise((res) => setTimeout(() => res({ value: { TIMEOUT_10s: true } }), 10000)),
]);
console.log("result:", r.value); // -> { TIMEOUT_10s: true } (hangs until the race timer fires)
await rt.dispose();
Observed: the guest fetch never resolves — bounded to a 10s race, it times out at exactly 10s every time.
Control checks:
- A host-side
fetch("https://example.com")returns200in the same environment, so host egress is not the problem. - The default deny path works correctly and fails fast: without the permission, the guest
fetchrejects promptly withfetch failed.
So the issue is specific to the network: "allow" + outbound-request path hanging rather than completing.
Root cause (from reading the type defs)
Granting the permission only authorizes network; performing it requires a host network adapter. The architecture clearly expects one — @secure-exec/core's test-runtime defines createNodeHostNetworkAdapter(), createDefaultNetworkAdapter(), a NetworkAdapter interface, and hasHostNetworkAdapter().
However:
test-runtimeis not re-exported from@secure-exec/core'sindex.d.ts, and the publicsecure-execpackage only re-exportsNodeRuntime+ types.NodeRuntimeCreateOptionshas no field to supply a network adapter (onlypermissions,env,cwd,commandsDir,files,mounts,nodeModules,tools,loopbackExemptPorts).
So through the public API there is no way to wire egress, and network: "allow" ends up granting permission with no transport behind it.
Suggested fix (either)
- Expose a host network adapter on
NodeRuntimeCreateOptions(e.g.network/networkAdapter), and document it in the quickstart, or - Make
network: "allow"with no available adapter reject fast with a clear error (e.g. "network permitted but no host network adapter configured") instead of hanging.
Either way, the quickstart's Permissions section should clarify whether outbound HTTP is supported on the public SDK in 0.3.0 and, if so, the complete setup required.
Minor doc nit
The quickstart code uses .run<{...}>(...) (TS generics) and the package is "type": "module", but doesn't mention that a .js file in a CommonJS project won't load it — it needs .mjs or "type": "module". Worth a one-line note for JS users following along.
- 主要言語
- TypeScript
- スター
- 1k
- フォーク
- 54
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
rivet-dev/dynamic-apps のほかの issue
-
Build cache ignores maxResponseBytes, potentially reusing an outdated response limit対応中かも @Utkarshpandey0001 が 29 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 78/100
rivet-dev/dynamic-apps#297 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
rivet-dev/dynamic-apps#280 · コメント 2 件 ·
-
Make agentOS runtime classifier content-based (match Linux exec semantics), not extension-based対応中かも @mittal-parth が 34 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
rivet-dev/dynamic-apps#275 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
rivet-dev/dynamic-apps#272 ·
-
Treat the WASM/WASI build target as cfg(unix) so filesystem tools need no per-tool mode-bit patchesオープン
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
rivet-dev/dynamic-apps#271 ·
rivet-dev/dynamic-apps の issue をすべて見る
似ている issue
-
freshness freshness:observed-only
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
thoroc/context-radar#280 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
-
documentation story
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
bug category:billing priority:p3 track:fast
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
LanternOps/breeze#9223 ·
メンテナーはふだん 1 日以内に返信