fix(deps): update Wasmtime 29.0.1 to 36.0.12 for RUSTSEC-2026-0096 (ARN-169)#345
Open
rita-aga wants to merge 2 commits into
Open
fix(deps): update Wasmtime 29.0.1 to 36.0.12 for RUSTSEC-2026-0096 (ARN-169)#345rita-aga wants to merge 2 commits into
rita-aga wants to merge 2 commits into
Conversation
…ox escape) Closes the CVSS 9.0 aarch64 Cranelift miscompilation (RUSTSEC-2026-0096) that let a WASM guest escape its linear-memory sandbox, plus ~18 other wasmtime / wasmtime-wasi advisories, by bumping wasmtime and wasmtime-wasi 29.0.1 → 46.0.1 (latest; workspace MSRV 1.92 / toolchain nightly 1.95). The only source break is the wasmtime-34 wasmtime-wasi module reorg (preview1 -> p1, pipe -> p2::pipe); five path renames in temper-wasm/src/engine/mod.rs. The core embedding API is unchanged and no sandbox control is weakened: per-invocation fresh Store, fuel budget, epoch wall-clock timeout, memory limiter, and WASI with no preopened dirs / no inherited env / no network (in-memory stderr pipe only). Also clears advisories reachable by a safe lockfile-only bump: postgres-protocol 0.6.12, tokio-postgres 0.7.18, quinn-proto 0.11.16, crossbeam-epoch 0.9.20, rustls-webpki 0.103.13. cargo audit: 37 -> 9 vulnerabilities; all 19 wasmtime/wasmtime-wasi advisories cleared. Remaining 9 have no safe bump here (rsa, tokio-tar: no fix; protobuf via pprof, rustls-webpki 0.102 via libsql: upstream-pinned; quick-xml: needs a temper-spec CSDL parser migration) and are tracked as follow-ups in ADR-0158. Refs ARN-169. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Collaborator
Author
|
@greptile review |
Collaborator
Author
ARN-165 principle audit — request changes / scope incompleteThe dependency upgrade is worthwhile, but it does not meet ARN-169's “clear advisories in both repos” acceptance criteria. Audit evidence
Required before closure
This upgrade also does not address the independent raw-host/stream-capability sandbox findings in ARN-207/208. Please narrow the title if those deliverables are intentionally moved to separate PRs. |
There was a problem hiding this comment.
rita-aga has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.
Owner
|
@greptile review |
There was a problem hiding this comment.
rita-aga has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.
Owner
|
@greptile review |
Owner
|
@greptile review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes ARN-169 under epic ARN-165. Draft for review — do not merge.
What
Update
wasmtimeandwasmtime-wasifrom 29.0.1 to 36.0.12 to close RUSTSEC-2026-0096 (CVSS 9.0, AArch64 Cranelift miscompile enabling a WASM sandbox escape) and the other Wasmtime advisories affecting the prior dependency line.Wasmtime 46.0.1 was evaluated and rejected because it requires Rust 1.94, while this workspace declares Rust 1.92. The fix for RUSTSEC-2026-0096 was backported in Wasmtime 36.0.7; 36.0.12 is the newest compatible patched release on that line. ADR-0159 records the decision and rejected alternatives.
Changes
wasmtimeandwasmtime-wasito 36.0.12.MemoryOutputPipeto the 36.xwasmtime_wasi::p2::pipepath.fd_writecompile/invoke path.Verification
0c345290across compile/lint, workspace tests, DST shards, verification, instrumentation, and integrity gates.Scope
Temper kernel only. This PR does not claim to close the independent WASM host/stream-capability findings ARN-207 and ARN-208.
Greptile Summary
Updates
wasmtimeandwasmtime-wasifrom 29.0.1 to 36.0.12 to remediate RUSTSEC-2026-0096 (CVSS 9.0 AArch64 Cranelift sandbox escape) and 18 other advisories, with 46.0.1 rejected because it requires Rust 1.94 — above the workspace's declared 1.92 MSRV. The only host-side API change is the relocation ofMemoryOutputPipefromwasmtime_wasi::pipetowasmtime_wasi::p2::pipe; all sandbox controls (per-invocation store, fuel, epoch, memory limiter, WASIp1 isolation) are preserved verbatim.engine/mod.rs: single import-path fix forMemoryOutputPipe; allConfig,Store,Linker,ResourceLimitercall sites are unchanged.tests/sandbox.rs: three new targeted tests — memory-growth denial (now stricter: WAT traps ifmemory.growdoes not return −1), over-budget initial-memory rejection at instantiation, and a WASIp1fd_writeend-to-end smoke test via the updated pipe path.docs/adrs/0159-wasmtime-36-security-update.md: decision record covering the full advisory set, MSRV rationale, API migration table, and rollback procedure.Confidence Score: 5/5
Safe to merge — the host-side code change is a single import path fix, all sandbox controls are preserved, and CI is green.
The only functional change in the host code is one import path for
MemoryOutputPipe; the surrounding fuel, epoch, memory limiter, and per-invocation store logic is byte-for-byte identical to what was there before. The lockfile movement is confined to the Wasmtime/Cranelift/pulley closure, and the new tests are stricter than the ones they replace.No files require special attention. The ADR, tests, and Cargo pins are all internally consistent.
Important Files Changed
wasmtime_wasi::pipe::MemoryOutputPipe→wasmtime_wasi::p2::pipe::MemoryOutputPipe. All surrounding sandbox logic (store creation, fuel, epoch deadline, memory limiter) is untouched.fd_writeis correctly constructed (iov at 0–7, data at 32, nwritten ptr at 16). The memory-grow WAT now actively traps on unexpected growth success, making the assertion stronger than the removed test.mod sandbox;. Removed old WAT_MEMORY_GROW constant and weaker memory_growth_denied_by_limiter test, both superseded by the stricter versions in sandbox.rs.Sequence Diagram
%%{init: {'theme': 'neutral'}}%% sequenceDiagram participant Host as temper-wasm host participant Engine as WasmEngine participant Store as Store (per-invocation) participant Limiter as MemoryLimiter participant WASI as WasiCtxBuilder (p2::pipe) participant Guest as WASM Guest Host->>Engine: compile_and_cache(wasm_bytes) Engine->>Engine: detect needs_wasi (wasi_snapshot_preview1 import) alt needs_wasi Engine->>WASI: link preview1::add_to_linker_sync Engine->>Engine: cache instance_pre_wasi else no WASI Engine->>Engine: cache instance_pre end Host->>Engine: invoke(hash, context, limits) Engine->>Store: Store::new(engine, host_state) Engine->>Store: set_fuel(limits.max_fuel) Engine->>Store: "limiter(MemoryLimiter { max_memory })" Engine->>Store: set_epoch_deadline(ticks) alt needs_wasi Engine->>WASI: MemoryOutputPipe::new (p2::pipe path in 36.x) Engine->>WASI: WasiCtxBuilder::new().stderr(pipe).build_p1() end Engine->>Store: "instance_pre.instantiate(&mut store)" Store->>Limiter: memory_growing(current, desired, max)? Limiter-->>Store: Ok(true) or Ok(false) / Instantiation error Engine->>Guest: run_fn.call(ctx_ptr, ctx_len) Guest-->>Engine: result_ptr or trap note over Engine,Guest: Fuel / epoch deadline enforced by Wasmtime 36.x%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% sequenceDiagram participant Host as temper-wasm host participant Engine as WasmEngine participant Store as Store (per-invocation) participant Limiter as MemoryLimiter participant WASI as WasiCtxBuilder (p2::pipe) participant Guest as WASM Guest Host->>Engine: compile_and_cache(wasm_bytes) Engine->>Engine: detect needs_wasi (wasi_snapshot_preview1 import) alt needs_wasi Engine->>WASI: link preview1::add_to_linker_sync Engine->>Engine: cache instance_pre_wasi else no WASI Engine->>Engine: cache instance_pre end Host->>Engine: invoke(hash, context, limits) Engine->>Store: Store::new(engine, host_state) Engine->>Store: set_fuel(limits.max_fuel) Engine->>Store: "limiter(MemoryLimiter { max_memory })" Engine->>Store: set_epoch_deadline(ticks) alt needs_wasi Engine->>WASI: MemoryOutputPipe::new (p2::pipe path in 36.x) Engine->>WASI: WasiCtxBuilder::new().stderr(pipe).build_p1() end Engine->>Store: "instance_pre.instantiate(&mut store)" Store->>Limiter: memory_growing(current, desired, max)? Limiter-->>Store: Ok(true) or Ok(false) / Instantiation error Engine->>Guest: run_fn.call(ctx_ptr, ctx_len) Guest-->>Engine: result_ptr or trap note over Engine,Guest: Fuel / epoch deadline enforced by Wasmtime 36.xReviews (4): Last reviewed commit: "fix(wasm): update Wasmtime security base..." | Re-trigger Greptile