fix(worker): security audit of R0 — no core dumps, tkill/tgkill limited to SIGABRT on self, mmap without PROT_EXEC, Broken outcome for a broken child environment, frame vs canvas check, unsafe denied with local allows, sandbox tests and derivation on the release profile (syscall marker); wasm proof exports behind a feature; ci: release-images hardened (typed input via env, advisories gate, ephemeral builder, env secrets + logout, ref gate, pinned checkout)

This commit is contained in:
bchanot committed 2026-10-13 00:18:53 +02:00
1 parent 9d3e0294e2
commit 11813f5560
14 files changed
+293 -58

No files matched your search

+6
View File
@@ -11,6 +11,12 @@ publish.workspace = true
crate-type = ["cdylib", "rlib"]
path = "src/lib.rs"
[features]
default = []
# The R0 trap proofs (panic_for_test, recurse_for_test): built for the proofs, never for the
# module the application ships (docker/wasm-build.sh passes it until R2 wires the real loader).
proofs = []
[dependencies]
faunosteo-core = { path = "../core" }
wasm-bindgen.workspace = true
+3
View File
@@ -19,17 +19,20 @@ pub fn call(op: &str, input: &str) -> String {
/// R0 proof: on wasm32 a panic is a trap (panic = abort), reaching JavaScript as a
/// `WebAssembly.RuntimeError`; the caller re-instantiates the module.
#[cfg(feature = "proofs")]
#[wasm_bindgen]
pub fn panic_for_test() {
panic!("deliberate panic for the R0 proof");
}
/// R0 proof: exhausting the shadow stack traps instead of corrupting memory.
#[cfg(feature = "proofs")]
#[wasm_bindgen]
pub fn recurse_for_test(depth: u32) -> u32 {
recurse(depth)
}
#[cfg(feature = "proofs")]
#[inline(never)]
fn recurse(depth: u32) -> u32 {
let mut frame = [depth; 32];