SANDBOX ABI
explanation
7 min read

Isolated Plugin Sandbox: Boa JS vs Wasmi WebAssembly

Traditional CMS plugins run in-process with direct SQL credentials and unrestricted filesystem access. OpenDash executes every plugin inside an isolated --plugin-worker child process communicating over binary IPC, so extension faults or infinite loops cannot crash the web server or bypass permission grants.

Subprocess Worker Architecture & StagedCommitGuard

Workers hold no SqlitePool handle. When the host invokes a hook, filter, action, cron job, or custom route, the worker exchanges length-prefixed binary IPC frames (\x00ODIPC2\x00 banner + u32 LE UTF-8 JSON payloads up to 2 MiB). Every read operation runs on the Host under HostPolicy permission checks, and writes are buffered until the invocation succeeds and committed atomically by StagedCommitGuard inside one guarded BEGIN IMMEDIATE SQLite transaction.

Two Runtimes: Boa JS (ES2024) vs Wasmi WebAssembly

DimensionBoa JS (plugin.js)Wasmi WebAssembly (plugin.wasm)
Engine & Pinboa_engine = "=0.22.0" (pure Rust ES2024 JS)wasmi = "=2.0.0" (wasm32-unknown-unknown)
Build StepZero-build plain JavaScriptCompiled binary via Rust (opendash-plugin-sdk) or AssemblyScript (@opendash/sdk/as/opendash)
Guest API / ABIClean-room globalThis.od.* (od.on, od.kv, od.content, od.http, etc.)opendash_run() -> i32 export + opendash_v1 imports (v1.1 host_last_resp_len / host_read_last_resp)
Minimum SchemaRequires manifest_schema >= 3Supports manifest_schema 1..=4
Execution QuotaUp to 5,000,000 loop iterations, recursion 128, stack 512Up to 20,000,000 Wasmi fuel & 16 MiB Wasm linear memory

Enforced Runtime Quotas & OS Memory Caps

ResourceEnforced LimitHost Control Mechanism
OS Worker Memory Cap128 MiB max worker RSS/address spaceWindows Job Object / Linux RLIMIT_AS / macOS Jetsam
Host Ops & HTTP100 host calls/run (64 in public GET); 10 HTTP calls (2s timeout, 1 MiB stream)MAX_HOST_CALLS & SSRF DNS-pinning egress guard
Execution Deadlines5s standard/POST; 2s sync save/contact filters; 1s RouteGet; 200ms–1000ms renderTokio invocation timer & worker watchdog
KV & Staged Batch256 B keys, 512 KiB values; max 64 staged KV ops / 2 MiBOwner-isolated plugin_kv & single-tx commit
Worker Pool & Async4 Admin + 2 Background + 4 Public = 10 workers; queue 64 jobs, dispatch_depth < 2Independent semaphores & AsyncHookQueue

Package Formats, Ceilings & Data Preservation

Plugins support manifest_schema 1..=4 via folder (plugins/<slug>/) or ZIP upload. Both CLI verification (--check-plugin) and installation perform strictly static checks (wasmi::Module::new bytecode validation or boa_engine syntax parsing without top-level execution):

  • Archive Bounds: Max 5 MiB ZIP, 10 MiB uncompressed total (100:1 max ratio), 104 regular files, directory depth <= 4, manifest.json <= 64 KiB, entrypoint <= 2 MiB, up to 32 custom blocks, and 32 gettext files (.pot/.po/.mo).
  • Public Assets (Schema 4): Opt-in files under assets/ declared in public_assets are served at /plugins/<folder-slug>/assets/... only while the plugin is enabled.

Next Steps

Edit Source URL:

Search OpenDash

Use Arrow keys & Enter to navigate Full search page →