Lasm 0.5.1
A fix release, from the new boundary fuzzing. Upgrade with npm install -D @lasm/[email protected]; ^0.5.0 picks it up. Two fixes matter for any public server: a forged Host header can no longer change the path a handler sees, and a small Lasm.RPC request can no longer hang the server.
Fixes
Lasm.RPCrefuses a request whose JSON has a number with an exponent of more than four digits (400): Lean's parser computes10 ^ exponent, so a 90-byte request hung the server.Lasm.RPC.parseJsonis the same guard for other untrusted JSON (#135).- On Node and WASI (CGI), a Host header that is not a plain
host[:port](one with/,?,#,\,@, whitespace) is replaced bylocalhost:<port>inRequest.url, so it can no longer change the path or query a handler sees.Lasm.Fetch.nodeRequestUrlis the function. Request.pathkeeps://inside a path (/go/https://example.com); it used to take the whole URL for the path.- The Lambda handler forwards an ALB's query values as the client sent them; a malformed escape (
?q=%E0) used to throw (a 502). - The Lasm.UI patch decoder fails with a
Lasm.UI:error on a truncated frame (it looped forever) or attribute ops on a text node. lasm init --template constructor,--deploy __proto__andlasm package --target constructorare refused.
Testing (no change to how programs build or run)
- Conduit's RealWorld traffic is compared across every target.
node test/api.mjs --equivalencerecords the official API suite's requests and responses through a proxy; each of Conduit's 19 CI targets (Node 24 and 26, Workers, Bun, Deno, Docker, Lambda .zip and image, Vercel, Netlify, Azure, Google Cloud Functions, Deno Deploy, Vercel Edge, Netlify Edge, Fastly, wasi-http, Spin, Supabase Edge) must give Node's statuses, headers and body bytes, with tokens, timestamps, generated ids and documented platform headers normalized (examples/conduit/test/equivalence.mjs, docs/TESTING.md#conduits-realworld-traffic). - Boundary fuzzing. Six coverage-guided fuzz targets (
test/fuzz/,fuzz.yml): the CLI's argument parser, the function platforms' HTTP mapping, the Lasm.UI patch decoder, Lasm.Fetch's request parsing, Lasm.RPC's decoding and the WASI CGI host. Every pull request replays the committed corpus and regressions; campaigns run 10 minutes per target nightly and 60 minutes weekly (TESTING.md). They found the fixes above. - Deterministic simulation of the example apps. A shared harness (
scripts/sim: a seeded PRNG, simulated time and clocks with skew and jumps, a network with latency, reordering, drops, duplication and partitions, KV and SQLite/D1 stores with failed and ambiguous commits, outages and crash-restarts, fault profiles drawn per seed) runs Tandem's editor and sync server, Ledger's server and Porter's server, compiled by Lasm, in simulated worlds that check their invariants: no lost acknowledged edit, convergence after the network heals and the CRDT laws (Tandem); conservation of money, the auditor, durable acknowledged transfers, transfers applied once and linked chains all or nothing under racing commits (Ledger); single-use codes and refresh tokens, family revocation, exact expiry under clock skew and the ID token's claims and signature (Porter). Every failure replays from its seed (npm run build:sim && node test/dst.mjs --seed N). 30 fixed seeds per pull request; random seeds every night. It found three bugs in Tandem, now fixed: the editor could drop an unsent edit from its pending operations (two syncs in flight after a WebSocket push), a failed catch-up sync was never retried, and a commit that succeeded and then reported an error was never pushed to other tabs. A Porter issue is reported (#138). - The example apps build with 0.5.0. Ledger, Porter, Tandem, Conduit and Folio pin
@lasm/cli0.5.0. Their edge, Bun, Deno and WASI build scripts no longer pass--output dist/server(ordist/edge,dist/wasm,dist/wasi,dist/verify), since each platform writes its own directory and no longer writes a Node build todist/. Conduit's view proofs no longer nameAttr.onWith. None of the apps relied on Lasm handlers running before JavaScript listeners, so the bubble-phase change needed no code change.