Skip to content

Repository files navigation

Fork Notice: Wasmtime 46 Runtime Baseline

This repository is a temporary fork of extism/extism for Rust hosts that need Extism v1.30.0 API compatibility with a wasmtime 46 security baseline before an official upstream Extism release supports it.

Base upstream: extism/extism tag v1.30.0, commit 7038ad1.

Fork repository: arthurianresolve/extism-with-wasmtime46.

What This Fork Covers

  • Rust SDK/runtime source in runtime/.
  • The workspace crates needed by that Rust runtime: runtime, manifest, convert, and convert-macros.
  • WASIp1 execution through Extism's existing wasi-common / wiggle path.
  • The Extism Rust APIs used by Caliburn's plugins-wasm integration: loading a .wasm file, registering host functions, calling plugin exports, memory exchange helpers, and per-call plugin construction.
  • A Rust runtime pool fix for concurrent checkout under slow plugin creation.

Changes From Upstream v1.30.0

  • Upgraded runtime dependency train:
    • wasmtime: 43 -> 46.0.1
    • wasi-common: 43 -> 46.0.1
    • wiggle: 43 -> 46.0.1
  • Raised the pinned Rust toolchain from 1.91.0 to 1.97.0 because Wasmtime 46 requires Rust 1.94.0 or newer.
  • Rechecked the Rust 1.97.0 syntax and lint surface, including the new Clippy useless_borrows_in_formatting lint in runtime tests; the standalone kernel crate is pinned to the same Rust baseline.
  • Pinned GitHub workflow Rust setup steps to 1.97.0 so CI and release jobs use the same Rust baseline as the checked-in toolchain files.
  • Updated workspace metadata to identify this fork as 1.30.0+wasmtime46 and point repository metadata at this GitHub repository.
  • Adapted the runtime to Wasmtime 45 and 46 API changes:
    • Linker::get now returns Result<Extern, wasmtime::Error> instead of Option<Extern>.
    • Host functions now bridge anyhow::Error into wasmtime::Error with ToWasmtimeResult where Wasmtime requires its own error type.
    • Runtime error contexts now use wasmtime::error::Context on Wasmtime call paths.
    • Resource limiter and fuel errors now use wasmtime::Error internally and convert back to Extism's public anyhow::Error surface at API boundaries.
    • Removed deprecated Config::async_support(false) usage.
  • Fixed pool checkout behavior by reserving capacity under the mutex and creating plugins outside the mutex. This prevents unrelated waiters from spending their timeout behind slow Wasmtime plugin compilation.
  • Aligned test code with the Rust 1.95 / Wasmtime 45 lint surface by marking a derive-only conversion fixture with #[expect(dead_code)] and removing an unnecessary clone from a Copy wasmtime::Val in the pool test.
  • Integrated the cargo dependency refresh that was pending on fork maintenance branches:
    • toml: 0.9 -> 1.1
    • sha2: 0.10 -> 0.11
    • criterion: 0.7.0 -> 0.8.2
    • rand: 0.9.0 -> 0.10.1
    • schemars: 0.8 -> 1.2
    • prost: 0.14.1 -> 0.14.4
    • protobuf: 3.2.0 -> 4.35.0-release
  • Adapted the optional extism-convert protobuf wrapper to the protobuf 4.x API by replacing the removed 3.x Message::write_to_bytes and Message::parse_from_bytes calls with Serialize::serialize and Parse::parse.
  • Rechecked dependency freshness on the protobuf-4.x branch on 2026-06-08: the direct Wasmtime, WASI, Wiggle, Prost, and Protobuf floors were current; libc remains on the stable 0.2 line rather than the 1.0.0-alpha line.
  • Rechecked dependency freshness on the protobuf-4.x branch on 2026-07-05 and upgraded the Wasmtime dependency train from 45.0.3 to 46.0.1.
  • Rechecked dependency freshness on the protobuf-4.x branch on 2026-07-10, confirmed fresh compatible Cargo resolution clears RUSTSEC-2026-0204 in crossbeam-epoch, and updated the release workflow Node.js pin from 26.1.0 to 26.5.0.
  • Adapted fuel-limit handling for Wasmtime 46 so wrapper setup work does not consume the caller's configured guest-execution fuel budget, and failed guest execution resets the store before the next call.
  • Checked the public wrapper API surface against the Wasmtime 46 migration: existing Rust host APIs remain source-compatible, and the generated C header keeps the existing EXTISM_PTR spelling without exporting cbindgen's generic Rust PTR helper.
  • Disabled the implicit Wasmtime default cache configuration lookup on Android when no cache config is supplied, avoiding extism/extism#851 plugin construction failures while preserving explicit with_cache_config, EXTISM_CACHE_CONFIG, and with_cache_disabled behavior.
  • Added runtime export discovery for extism/extism#868 via Plugin::function_names(), Pool::function_names(), and the C ABI extism_plugin_function_names, which returns a JSON array of callable plugin function names.
  • Hardened plugin teardown for extism/extism#890: Plugin drop now stops any active timer entry, clears the host-context payload, and releases cached runtime/instance state before the remaining Wasmtime-owned fields are destroyed.
  • Added host-function timeout controls for extism/extism#637: Rust host functions can pause, resume, extend, or reduce the active plugin timeout via CurrentPlugin, and C ABI host functions can use the matching extism_current_plugin_timeout_* helpers.
  • Added linked-module regression coverage for extism/extism#819, ensuring a single CompiledPlugin can create multiple plugin instances that all retain access to non-main modules imported by the main module.
  • Added compiled-plugin concurrency regression coverage for extism/extism#791, ensuring a single shared CompiledPlugin can create independent plugin instances across threads while preserving per-instance execution state.
  • Updated the reusable GitHub composite action pins to current workflow equivalents: actions/checkout@v6, actions-rust-lang/setup-rust-toolchain@v1, Swatinem/rust-cache@v2, and actions/cache@v5.
  • Adapted optional manifest JSON Schema generation to the Schemars 1.2 API and updated the Rand property-test import for Rand 0.10.
  • Added SECURITY-WASMTIME46.md documenting the Wasmtime advisory baseline and why the fork exists.

Security Coverage

The Wasmtime 46 baseline includes the April 2026 Wasmtime advisory set, the May 2026 WASI permission advisory, and the June 2026 WASI FilePerms advisory. This fork is intended to clear the Wasmtime 41.x advisory lane that blocked Caliburn while Extism still depended on Wasmtime ^41.

Covered issue classes include:

  • Critical aarch64 Cranelift sandbox escape.
  • Critical Winch sandbox escape.
  • Component-model string transcoding issues.
  • Winch table and data-leakage issues.
  • Pooling allocator data leakage.
  • WASI path_open(TRUNCATE) host write-permission bypass.
  • WASI hard-link and rename destination permission checks.

See SECURITY-WASMTIME46.md for advisory identifiers and links.

Explicit Non-Coverage

This fork is intentionally narrow. It does not cover:

  • Published crates.io packages.
  • libextism C ABI release artifacts or downstream C-ABI package publishing.
  • Python SDK wheels, Node/npm packages, Java artifacts, .NET/NuGet packages, RubyGems, Packagist packages, CPAN packages, opam packages, or Hackage packages.
  • The separate Go SDK or JavaScript SDK repositories.
  • Downstream Python SDK wrapper ownership fixes. The Rust runtime/C ABI extism_plugin_free teardown path has been hardened for extism/extism#890, but Python SDK package code is outside this fork.
  • WASI Preview 2, the Component Model, or WIT-based plugin interfaces.
  • WASI threads support.
  • Async cancellation support for guest code blocked in uninterrupted sleeps or long-running host functions.
  • allowed_paths redesign, single-file mounts, or breaking manifest path semantics.
  • New observability/Observe SDK integration.
  • A new runtime API for listing all exported plugin functions.

Validation Evidence

The fork was validated with:

  • cargo check -p extism
  • CARGO_INCREMENTAL=0 cargo test -p extism
  • cargo fmt --all -- --check
  • CARGO_INCREMENTAL=0 cargo clippy -p extism -- -D warnings
  • cargo audit

Additional Rust 1.95 syntax and lint alignment was validated with:

  • cargo check --workspace
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test -p extism-convert test -- --nocapture
  • cargo test -p extism test_pool_with_captured_builder -- --nocapture

The full parallel Rust runtime test suite passed after the pool checkout fix.

The cargo dependency refresh was validated with:

  • cargo fmt --all -- --check
  • cargo check --workspace
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo check -p extism-manifest --features json_schema --examples
  • cargo check -p extism-convert --features protobuf
  • cargo test -p extism-convert --features protobuf
  • cargo update
  • cargo test -p extism test_toml_manifest -- --nocapture
  • cargo test -p extism check_alloc_with_load_and_store -- --nocapture
  • cargo test -p extism --benches --no-run
  • CARGO_INCREMENTAL=0 CARGO_BUILD_JOBS=1 cargo bench -p extism --no-run

The Wasmtime 46 upgrade and API-surface compatibility pass was validated with:

  • cargo test -p extism
  • cargo check -p extism --no-default-features
  • cargo check --workspace
  • cargo check -p extism-convert --features protobuf
  • cargo test -p extism-convert --features protobuf
  • cargo check --manifest-path kernel/Cargo.toml --target wasm32-unknown-unknown
  • cargo fmt --all -- --check

The Rust 1.97.0 toolchain bump was syntax-checked with:

  • cargo fmt --all -- --check
  • cargo check --workspace
  • cargo check -p extism --no-default-features
  • cargo check -p extism-convert --features protobuf
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo check --manifest-path kernel/Cargo.toml --target wasm32-unknown-unknown
  • cargo audit
  • cargo test -p extism

The Android default cache config fallback fix for extism/extism#851 was validated with:

  • cargo test -p extism android_skips_implicit_default_cache_config
  • cargo check -p extism --no-default-features
  • cargo clippy -p extism --all-targets -- -D warnings
  • cargo fmt --all -- --check

The runtime export discovery API for extism/extism#868 was validated with:

  • cargo test -p extism test_function_names
  • cargo test -p extism test_c_api_function_names
  • cargo test -p extism pool::test_exists
  • cargo check --workspace
  • cargo check -p extism --no-default-features
  • cargo clippy -p extism --all-targets -- -D warnings
  • cargo fmt --all -- --check

The plugin teardown hardening for extism/extism#890 was validated with:

  • cargo test -p extism test_plugin_teardown_clears_cached_instance
  • cargo test -p extism test_c_api_plugin_free_repeated_creation
  • cargo fmt --all -- --check
  • cargo check --workspace
  • cargo check -p extism --no-default-features
  • cargo clippy -p extism --all-targets -- -D warnings
  • cargo test -p extism

The host-function timeout controls for extism/extism#637 were validated with:

  • cargo test -p extism test_host_function_can_pause_timeout
  • cargo test -p extism test_c_api_host_function_can_extend_timeout
  • cargo fmt --all -- --check
  • cargo check --workspace
  • cargo check -p extism --no-default-features
  • cargo clippy -p extism --all-targets -- -D warnings
  • cargo test -p extism

The compiled-plugin linked-module regression for extism/extism#819 was validated with:

  • cargo test -p extism test_linking
  • cargo test -p extism test_compiled_plugin_linking
  • cargo fmt --all -- --check
  • cargo check --workspace
  • cargo check -p extism --no-default-features
  • cargo clippy -p extism --all-targets -- -D warnings
  • cargo test -p extism

The compiled-plugin concurrency regression for extism/extism#791 was validated with:

  • cargo test -p extism test_compiled_plugin_concurrent_instances
  • cargo test -p extism test_plugin_threads
  • cargo test -p extism pool::test_threads
  • cargo fmt --all -- --check
  • cargo check --workspace
  • cargo check -p extism --no-default-features
  • cargo clippy -p extism --all-targets -- -D warnings
  • cargo test -p extism

The 2026-07-10 dependency security check and Node.js 26.5.0 release workflow pin were validated with:

  • cargo audit
  • cargo fmt --all -- --check
  • cargo check --workspace
  • cargo check -p extism --no-default-features
  • cargo clippy -p extism --all-targets -- -D warnings
  • cargo test -p extism

Prefer returning to upstream Extism as soon as an official release supports the required Wasmtime security baseline.

Overview

Extism is a lightweight framework for building with WebAssembly (Wasm). It supports running Wasm code on servers, the edge, CLIs, IoT, browsers and everything in between. Extism is designed to be "universal" in that it supports a common interface, no matter where it runs.

Note: One of the primary use cases for Extism is building extensible software & plugins. You want to be able to execute arbitrary, untrusted code from your users? Extism makes this safe and practical to do.

Additionally, Extism adds some extra utilities on top of standard Wasm runtimes. For example, we support persistent memory/module-scope variables, secure & host-controlled HTTP without WASI, runtime limiters & timers, simpler host function linking, and more. Extism users build:

  • plug-in systems
  • FaaS platforms
  • code generators
  • web applications
  • & much more...

Supported Targets

We currently provide releases for the following targets:

  • aarch64-apple-darwin
  • aarch64-unknown-linux-gnu
  • aarch64-unknown-linux-musl
  • x86_64-apple-darwin
  • x86_64-pc-windows-gnu
  • x86_64-pc-windows-msvc
  • x86_64-unknown-linux-gnu
  • x86_64-unknown-linux-musl

For Android we suggest taking a look at the Chicory SDK for a pure Java Extism runtime.

Run WebAssembly In Your App

Pick a SDK to import into your program, and refer to the documentation to get started:

Type Language Source Code Package
Rust SDK Rust SDK https://github.com/extism/extism/tree/main/runtime Crates.io
JS SDK JS SDK https://github.com/extism/js-sdk
(supports Web, Node, Deno & Bun!)
NPM
Elixir SDK Elixir SDK https://github.com/extism/elixir-sdk Hex
Go SDK Go SDK https://github.com/extism/go-sdk Go mod
Haskell SDK Haskell SDK https://github.com/extism/haskell-sdk Hackage
Java SDK Java SDK https://github.com/extism/java-sdk Sonatype
.NET SDK .NET SDK https://github.com/extism/dotnet-sdk
(supports C# & F#!)
Nuget
OCaml SDK OCaml SDK https://github.com/extism/ocaml-sdk opam
Perl SDK Perl SDK https://github.com/extism/perl-sdk CPAN
PHP SDK PHP SDK https://github.com/extism/php-sdk Packagist
Python SDK Python SDK https://github.com/extism/python-sdk PyPi
Ruby SDK Ruby SDK https://github.com/extism/ruby-sdk RubyGems
Zig SDK Zig SDK https://github.com/extism/zig-sdk N/A
C SDK C SDK https://github.com/extism/extism/tree/main/libextism N/A
C++ SDK C++ SDK https://github.com/extism/cpp-sdk N/A

Compile WebAssembly to run in Extism Hosts

Extism Hosts (running the SDK) must execute WebAssembly code that has a PDK, or Plug-in Development Kit, library compiled in to the .wasm binary. PDKs make it easy for plug-in / extension code authors to read input from the host and return data back, read provided configuration, set/get variables, make outbound HTTP calls if allowed, and more.

Pick a PDK to import into your Wasm program, and refer to the documentation to get started:

Type Language Source Code Package
Rust PDK Rust PDK https://github.com/extism/rust-pdk Crates.io
JS PDK JS PDK https://github.com/extism/js-pdk N/A
Python PDK Python PDK https://github.com/extism/python-pdk N/A
Go PDK Go PDK https://github.com/extism/go-pdk Go mod
Haskell PDK Haskell PDK https://github.com/extism/haskell-pdk Hackage
AssemblyScript PDK AssemblyScript PDK https://github.com/extism/assemblyscript-pdk NPM
.NET PDK .NET PDK https://github.com/extism/dotnet-pdk
(supports C# & F#!)
Nuget
C PDK C PDK https://github.com/extism/c-pdk N/A
C++ PDK C++ PDK https://github.com/extism/cpp-pdk N/A
Zig PDK Zig PDK https://github.com/extism/zig-pdk N/A

Generating Bindings

It's often very useful to define a schema to describe the function signatures and types you want to use between Extism SDK and PDK languages.

XTP Bindgen is an open source framework to generate PDK bindings for Extism plug-ins. It's used by the XTP Platform, but can be used outside of the platform to define any Extism compatible plug-in system.

1. Install the xtp CLI.

See installation instructions here.

2. Create a schema using our OpenAPI-inspired IDL:

version: v1-draft
exports: 
  CountVowels:
      input: 
          type: string
          contentType: text/plain; charset=utf-8
      output:
          $ref: "#/components/schemas/VowelReport"
          contentType: application/json
# components.schemas defined in example-schema.yaml...

See an example in example-schema.yaml, or a full "kitchen sink" example on the docs page.

3. Generate bindings to use from your plugins:

xtp plugin init --schema-file ./example-schema.yaml
  > 1. TypeScript                      
    2. Go                              
    3. Rust                            
    4. Python                          
    5. C#                              
    6. Zig                             
    7. C++                             
    8. GitHub Template                 
    9. Local Template

This will create an entire boilerplate plugin project for you to get started with. Implement the empty function(s), and run xtp plugin build to compile your plugin.

For more information about XTP Bindgen, see the dylibso/xtp-bindgen repository and the official XTP Schema documentation.

Support

Discord

If you experience any problems or have any questions, please join our Discord and let us know. Our community is very responsive and happy to help get you started.

Usage

Head to the project website for more information and docs. Also, consider reading an overview of Extism and its goals & approach.

Contribution

Thank you for considering a contribution to Extism, we are happy to help you make a PR or find something to work on!

The easiest way to start would be to join the Discord or open an issue on the extism/proposals issue tracker, which can eventually become an Extism Improvement Proposal (EIP).

For more information, please read the Contributing guide.


Who's behind this?

Extism is an open-source product from the team at:

Reach out and tell us what you're building! We'd love to help: hello@dylibso.com

About

Extism v1.30.0 fork patched for Wasmtime 46

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages