Skip to content

Pin the HMAC boundary and WASI 0.9 together - #17

Open
codeitlikemiley wants to merge 20 commits into
mainfrom
gol/hmac-wasip3-integration-5bda
Open

codeitlikemiley wants to merge 20 commits into
mainfrom
gol/hmac-wasip3-integration-5bda

Conversation

@codeitlikemiley

@codeitlikemiley codeitlikemiley commented Oct 24, 2026 •

Copy link
Copy Markdown
Owner

Problem / repro

PR 15 has the HMAC trusted-context boundary and still locks wasip3 0.7.0. PR 16 locks wasip3 0.9.0+wasi-0.3.0 and does not contain that boundary. leptos_wasi and ddd-cqrs-es need one revision that has both.

Implementation

Merge of the HMAC replay rejection onto the WASI 0.9 branch, then the CI fixes and the middleware pin from PR 16. crates/wasi-auth/src/http.rs matches the security branch. spin_grpc.rs keeps wasip3::wit_bindgen::spawn_local. The middleware commits do not change those files.

accept_signed_trusted_context records the HMAC in a process-local set after open succeeds. A second presentation in that process fails closed with trusted-context envelope was already accepted. The MAC still binds audience, method, path, and request ID. open does not consume the envelope.

Residual risk: another guest process that shares the key has its own set and can accept the captured envelope until the freshness window ends (default 5s, maximum 30s). Ingress strips client x-wasi-auth-* headers, including a correctly signed client envelope.

The four middleware git pins are 3df96c21a7906b885e67229e9a7c8c01b6497109, the head of middleware PR 1. policy-core writes baseline security and CORS response fields only when absent. wit-bindgen 0.62.0 and wasip3 0.9.0 stay. artifacts/SHA256SUMS uses the ubuntu-24.04 HTTP PEP digest from run 40141593944, which matches PR 16.

Nothing was tagged or published. Crate version is still 0.1.0-rc.5.

CI

This branch merges the updated PR 16, which includes PR 18. rustls is =0.23.46. crypto-bigint 0.5.5 remains, so the audit jobs stay red. No ignore was added. jsonwebtoken 11.1.0 and passkey-auth 0.1.3 still require p256 0.13, and aws-lc-rs does not compile for wasm32-wasip2.

The HTTP PEP, Cedar PDP, and SpiceDB PDP allowlists accept the Rust 1.99 libstd WASI 0.2.12 imports (stdin, stdout, the five wasi:cli/terminal-* interfaces, wasi:io/[email protected], and wasi:clocks/[email protected]). Filesystem, sockets, and key-value stay forbidden.

Fuzz uses dated nightly-2026-09-01. cargo-semver-checks is 0.51.0. The ingress SBOM keeps bytes, http-body, and http-body-util.

Downstream pin

4fcf631c556e4db26a20e916381e7f3385b66b06

Dependent PRs

  • PR 18 — advisory bumps. Merge into main first.
  • PR 15 — HMAC boundary. Merge second. It does not git-pin the middleware.
  • PR 16 — WASI 0.9 and the middleware pin. Merge third, keeping spawn_local and the security edits in spin_grpc.rs.
  • This branch is the pin until those are on main. Do not publish an rc.6 tag from here.
Open in Web Open in Cursor 

cursoragent and others added 7 commits October 24, 2026 12:39
The guest had no HMAC acceptor, so a portable middleware context or a
client-supplied x-wasi-auth-* header could be confused with the signed
ingress envelope. Accept only the HMAC envelope, strip credentials and
reserved identity headers before the guest, and refuse a second CORS or
security-header policy on the same response.

Co-authored-by: Uriah Galang <[email protected]>
Replace the vendored middleware copy with a git dependency on
codeitlikemiley/wasi-http-middleware at 896f8f5. The crate version
stays 0.2.0-alpha.3 until v0.2.0-alpha.4 is published. Move the
workspace to Rust 1.99.0, wasip3 0.9.0+wasi-0.3.0, wit-bindgen
0.62.0, server_fn 0.8.13, and spin-sdk 7.0.0 at 3cf3001.
Production crates do not link those middleware packages.

Co-authored-by: Uriah Galang <[email protected]>
Debug of SessionId printed the raw identifier, so any Debug of a
containing session leaked it into logs. Display and as_str still
return the identifier for storage and the signed envelope.

The host-probe test seals a now-relative envelope only when
SPIN_ENVELOPE_OUT is set.

Co-authored-by: Uriah Galang <[email protected]>
accept_signed_trusted_context now consumes each HMAC signature once in
the guest process. The codec still only checks freshness, audience,
method, path, and request ID. A second instance that shares the key can
accept the same envelope until that window ends.

Co-authored-by: Uriah Galang <[email protected]>
Combines the signed-context branch with the canonical middleware and
wasip3 0.9 pin. spin_grpc keeps the security notes and uses spawn_local.

Co-authored-by: Uriah Galang <[email protected]>
Parallel tests share the process-local seen-set. A later fixture clock
pruned an entry another test still needed, so the second presentation
looked accepted. The tests now take one lock for the consume sequence.

Co-authored-by: Uriah Galang <[email protected]>
cursoragent and others added 7 commits October 24, 2026 21:24
Move the exact rustls pin to 0.23.46 and cargo-update rustls-webpki
0.103.16, webpki-roots 1.0.11, quinn-proto 0.11.19, ctutils 0.4.5, and
tokio 1.54.1. Refresh the SBOMs those crates appear in.

crypto-bigint stays at 0.5.5. The advisory is fixed only in 0.7.6, and
jsonwebtoken 10/11 plus passkey-auth 0.1.3 still require the
elliptic-curve 0.13 stack.

Co-authored-by: Uriah Galang <[email protected]>
Rust 1.99 libstd on wasm32-wasip2 links WASI 0.2.12 and adds stdin,
stdout, terminal, poll, and monotonic-clock imports. An empty program
imports the same set, and the HTTP PEP sources do not touch stdio.
Record that surface for the PEP, Cedar PDP, and SpiceDB PDP.

Pin the fuzz toolchain to nightly-2026-09-01 (rustc 1.100.0-nightly)
and cargo-semver-checks to 0.51.0, which reads rustdoc JSON v61.

Co-authored-by: Uriah Galang <[email protected]>
The checked-in component SBOMs still described wasip3 0.7. Regenerating
them records wasip3 0.9.0, wit-bindgen 0.62.0, and the patched rustls,
tokio, quinn-proto, ctutils, and webpki-roots versions.

Co-authored-by: Uriah Galang <[email protected]>
Version 0.51 reports a semver finding as exit 100 and a tool error as
exit 101. The inventory gate still requires the known contract and
testkit diagnostics and rejects any other outcome.

Co-authored-by: Uriah Galang <[email protected]>
Regenerate the ingress CycloneDX document after merging the advisory
bumps so bytes, http-body, and http-body-util remain dependencies.

Co-authored-by: Uriah Galang <[email protected]>
cursoragent and others added 6 commits October 24, 2026 21:43
Final-WASI rebuilds the release components on ubuntu-24.04 and diffs
artifacts/SHA256SUMS. The previous file still named the wasip3 0.7
bytes. These three digests are the ones that job produced for the HTTP
PEP, Cedar PDP, and SpiceDB PDP.

Co-authored-by: Uriah Galang <[email protected]>
Move wasi-http-metadata, wasi-http-policy-core,
wasi-http-middleware-component-support, and wasi-http-authn from
896f8f5 to the head of middleware pull request 1. That revision
writes baseline security and CORS response fields only when they are
absent. The lockfile, companion manifest, and middleware SBOMs follow
the new revision.

Co-authored-by: Uriah Galang <[email protected]>
Ubuntu 24.04 rebuilt the release components for 3df96c21. Only the HTTP
PEP digest changed. Cedar and SpiceDB stayed on the previous digests.
SBOM and WIT dumps already matched.

Co-authored-by: Uriah Galang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants