alexcrichton opened PR #14224 from alexcrichton:primitives36 to bytecodealliance:release-36.0.0:
This is the equivalent of #14219 for the 36.0.x release branch which we'll be supporting for another year. The goal here is to ensure that fixing security issues in the filesystem sandbox is in theory a purely local change within Wasmtime like it would be on
mainto avoid having to both changemainand additionally change publishedcap-stdcrates.The backport here is much more involved than just cherry-picking #14219 to this branch. As described in the second commit this historical version of Wasmtime is missing major refactorings such as moving away from
cap-stdand the refactoring of filesystem internals across wasip2 and wasip3. This means that while theprimitivesdirectory is directly cherry-picked from #14219 the rest of this is basically hand-written. This hand-vendors more platform-specific modules frommainand wires everything up.To add another wrinkle to all of this the
cap-stdcrate is visible in the public API ofwasmtime-wasito a greater degree than it is on main. For example theDescriptortype hasfileanddirmethods which expose the underlyingFileandDirstructures ofwasmtime-wasiwhich havepubfields which arecap_std::fs::{File,Dir}types. It would be a semver-breaking change, technically, to change these tostd::fs::Fileas is present onmain. To handle this those parts are left as-is but all operations are done internally asstd::fs::File. The intention is that all sandboxing logic lives within the localprimitivesmodule.
alexcrichton requested pchickey for a review on PR #14224.
alexcrichton requested wasmtime-wasi-reviewers for a review on PR #14224.
alexcrichton requested fitzgen for a review on PR #14224.
alexcrichton requested wasmtime-default-reviewers for a review on PR #14224.
alexcrichton unassigned fitzgen from PR #14224 [36.0.x] Vendor cap-std/cap-primitives into wasmtime-wasi.
:thumbs_up: pchickey submitted PR review.
github-actions[bot] added the label wasi on PR #14224.
github-actions[bot] added the label wasmtime:docs on PR #14224.
Last updated: Aug 30 2026 at 09:07 UTC