diff --git a/Cargo.lock b/Cargo.lock index 43ca17ad..f854a420 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -254,7 +254,7 @@ checksum = "8ae3f5d315924270530207e2a68396c3cc547f6dca3fbdca317cfb1a51edb593" [[package]] name = "cargo-kiln" -version = "0.4.3" +version = "0.4.4" dependencies = [ "anyhow", "async-trait", @@ -1260,7 +1260,7 @@ dependencies = [ [[package]] name = "kiln-async" -version = "0.4.3" +version = "0.4.4" dependencies = [ "criterion", "kiln-error", @@ -1268,7 +1268,7 @@ dependencies = [ [[package]] name = "kiln-build-core" -version = "0.4.3" +version = "0.4.4" dependencies = [ "anyhow", "chrono", @@ -1298,7 +1298,7 @@ version = "0.1.0" [[package]] name = "kiln-component" -version = "0.4.3" +version = "0.4.4" dependencies = [ "criterion", "kiln-decoder", @@ -1317,7 +1317,7 @@ dependencies = [ [[package]] name = "kiln-debug" -version = "0.4.3" +version = "0.4.4" dependencies = [ "kiln-error", "kiln-format", @@ -1326,7 +1326,7 @@ dependencies = [ [[package]] name = "kiln-decoder" -version = "0.4.3" +version = "0.4.4" dependencies = [ "criterion", "hex", @@ -1343,11 +1343,11 @@ dependencies = [ [[package]] name = "kiln-error" -version = "0.4.3" +version = "0.4.4" [[package]] name = "kiln-format" -version = "0.4.3" +version = "0.4.4" dependencies = [ "kani-verifier", "kiln-error", @@ -1357,7 +1357,7 @@ dependencies = [ [[package]] name = "kiln-foundation" -version = "0.4.3" +version = "0.4.4" dependencies = [ "criterion", "hashbrown 0.17.1", @@ -1375,7 +1375,7 @@ dependencies = [ [[package]] name = "kiln-host" -version = "0.4.3" +version = "0.4.4" dependencies = [ "kiln-error", "kiln-foundation", @@ -1386,7 +1386,7 @@ dependencies = [ [[package]] name = "kiln-instructions" -version = "0.4.3" +version = "0.4.4" dependencies = [ "kiln-error", "kiln-foundation", @@ -1398,7 +1398,7 @@ dependencies = [ [[package]] name = "kiln-intercept" -version = "0.4.3" +version = "0.4.4" dependencies = [ "chrono", "kani-verifier", @@ -1411,7 +1411,7 @@ dependencies = [ [[package]] name = "kiln-logging" -version = "0.4.3" +version = "0.4.4" dependencies = [ "kiln-error", "kiln-foundation", @@ -1421,7 +1421,7 @@ dependencies = [ [[package]] name = "kiln-math" -version = "0.4.3" +version = "0.4.4" dependencies = [ "kiln-error", "kiln-platform", @@ -1430,11 +1430,11 @@ dependencies = [ [[package]] name = "kiln-panic" -version = "0.4.3" +version = "0.4.4" [[package]] name = "kiln-platform" -version = "0.4.3" +version = "0.4.4" dependencies = [ "criterion", "kiln-error", @@ -1444,7 +1444,7 @@ dependencies = [ [[package]] name = "kiln-runtime" -version = "0.4.3" +version = "0.4.4" dependencies = [ "criterion", "kiln-debug", @@ -1464,7 +1464,7 @@ dependencies = [ [[package]] name = "kiln-sync" -version = "0.4.3" +version = "0.4.4" dependencies = [ "kani-verifier", "kiln-error", @@ -1473,7 +1473,7 @@ dependencies = [ [[package]] name = "kiln-wasi" -version = "0.4.3" +version = "0.4.4" dependencies = [ "kiln-error", "kiln-format", @@ -1487,7 +1487,7 @@ dependencies = [ [[package]] name = "kilnd" -version = "0.4.3" +version = "0.4.4" dependencies = [ "kiln-component", "kiln-debug", diff --git a/Cargo.toml b/Cargo.toml index 7bcdfaa2..f6be205d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,7 +29,7 @@ edition = "2024" rust-version = "1.85.0" license = "MIT" repository = "https://github.com/pulseengine/kiln" -version = "0.4.3" +version = "0.4.4" [workspace.dependencies] @@ -37,22 +37,22 @@ anyhow = "1.0" wit-bindgen = "0.41.0" # Internal crate versions -kiln-error = { path = "kiln-error", version = "0.4.3", default-features = false } -kiln-sync = { path = "kiln-sync", version = "0.4.3", default-features = false } -kiln-format = { path = "kiln-format", version = "0.4.3", default-features = false } -kiln-foundation = { path = "kiln-foundation", version = "0.4.3", default-features = false } -kiln-decoder = { path = "kiln-decoder", version = "0.4.3", default-features = false, features = ["std"] } -kiln-debug = { path = "kiln-debug", version = "0.4.3", default-features = false } -kiln-runtime = { path = "kiln-runtime", version = "0.4.3", default-features = false } -kiln-logging = { path = "kiln-logging", version = "0.4.3", default-features = false } -kiln-instructions = { path = "kiln-instructions", version = "0.4.3", default-features = false } -kiln-component = { path = "kiln-component", version = "0.4.3", default-features = false } -kiln-host = { path = "kiln-host", version = "0.4.3", default-features = false } -kiln-intercept = { path = "kiln-intercept", version = "0.4.3", default-features = false } -kiln-math = { path = "kiln-math", version = "0.4.3", default-features = false } -kiln-platform = { path = "kiln-platform", version = "0.4.3", default-features = false } -kiln-panic = { path = "kiln-panic", version = "0.4.3", default-features = false } -kiln-wasi = { path = "kiln-wasi", version = "0.4.3", default-features = false } +kiln-error = { path = "kiln-error", version = "0.4.4", default-features = false } +kiln-sync = { path = "kiln-sync", version = "0.4.4", default-features = false } +kiln-format = { path = "kiln-format", version = "0.4.4", default-features = false } +kiln-foundation = { path = "kiln-foundation", version = "0.4.4", default-features = false } +kiln-decoder = { path = "kiln-decoder", version = "0.4.4", default-features = false, features = ["std"] } +kiln-debug = { path = "kiln-debug", version = "0.4.4", default-features = false } +kiln-runtime = { path = "kiln-runtime", version = "0.4.4", default-features = false } +kiln-logging = { path = "kiln-logging", version = "0.4.4", default-features = false } +kiln-instructions = { path = "kiln-instructions", version = "0.4.4", default-features = false } +kiln-component = { path = "kiln-component", version = "0.4.4", default-features = false } +kiln-host = { path = "kiln-host", version = "0.4.4", default-features = false } +kiln-intercept = { path = "kiln-intercept", version = "0.4.4", default-features = false } +kiln-math = { path = "kiln-math", version = "0.4.4", default-features = false } +kiln-platform = { path = "kiln-platform", version = "0.4.4", default-features = false } +kiln-panic = { path = "kiln-panic", version = "0.4.4", default-features = false } +kiln-wasi = { path = "kiln-wasi", version = "0.4.4", default-features = false } # Note: Safety level presets should be defined in individual crate Cargo.toml files # as workspace.features is not supported by Cargo diff --git a/safety/requirements/functional-requirements/SR-45.yaml b/safety/requirements/functional-requirements/SR-45.yaml index 0369d78c..e6b104e4 100644 --- a/safety/requirements/functional-requirements/SR-45.yaml +++ b/safety/requirements/functional-requirements/SR-45.yaml @@ -2,8 +2,8 @@ artifacts: - id: SR-45 type: requirement title: The kiln.resource_limits manifest section is applied (wire the dead extraction) - status: implemented - description: 'IMPLEMENTED (PR #464): real extract_resource_limits_from_binary in kiln-decoder scans the binary custom sections and decodes kiln.resource_limits — strictly distinguishing absent (Ok(None)) from present-but-malformed (Err, fail loud, never treated as absent). load_module converts the manifest max_memory_usage via EngineResourceLimits::from_max_memory_bytes and feeds it into the SAME SR-46/47/48 pre-instantiate gate (check_declared_minimums) + runtime grow caps (set_runtime_max_pages/set_runtime_max_elements) the CLI --memory path uses, so a module with a manifest and NO CLI flag is bounded. Precedence: CLI + manifest combine via most_restrictive (min) — the operator cannot loosen the signed bound, the module cannot loosen the operator cap. The .unwrap_or(None) masking fallback and the foundation stub extractor are deleted; EngineBuilder::from_binary now selects ASIL mode from the manifest qualified level and fails loud on malformed manifests (it previously always yielded ASIL-D from the stub). NOT yet enforced: max_call_depth/fuel (EngineResourceLimits cannot express them; memory — the WCMC attack surface — is). Verified: manifest_memory_bound_enforced_without_cli_limits, manifest_bound_admits_fitting_module_and_caps_growth, manifest_tighter_than_cli_wins, cli_tighter_than_manifest_wins, malformed_manifest_section_fails_loud, builder_from_binary_fails_loud_on_malformed_manifest, builder_from_binary_selects_manifest_asil_level (kiln-runtime/tests/resource_limits_gate_tests.rs); test_extract_absent_section_is_none, test_extract_present_section_roundtrips, test_extract_malformed_section_is_error, test_extract_non_wasm_binary_is_error (kiln-decoder). --- The WCMC analysis (AD-WCMC-001) found the kiln.resource_limits section is decoded but NEVER APPLIED (capability_engine.rs:561 TODO). DEEPER FINDING this pass: the extraction fn (kiln-foundation/src/execution.rs:144) is ALSO a stub — returns a default and does NOT read the section (the parser from_bytes_with_provider in kiln-decoder/src/resource_limits_section.rs is never called). So SR-45 is a bigger cross-crate wire: (1) make extract scan+parse the section; (2) thread limits to instantiate; (3) apply max_memory_usage -> set_runtime_max_pages (SR-41), max_call_depth -> engine cap. This is the on-target enforcement point the embedded trust chain (AD-WCMC-001) depends on. Own feature loop. AD-WCMC-001. Issue #415.' + status: verified + description: 'VERIFIED (PR #464; re-verified on the binary at the v0.4.4 cut commit 35a573b3: a module carrying a kiln.resource_limits section is rejected at load with NO --memory flag — [Resource][E0BB9] rejected before allocation; a plain no-manifest module still runs; 12 gate tests + 4 extraction tests pass). IMPLEMENTED (PR #464): real extract_resource_limits_from_binary in kiln-decoder scans the binary custom sections and decodes kiln.resource_limits — strictly distinguishing absent (Ok(None)) from present-but-malformed (Err, fail loud, never treated as absent). load_module converts the manifest max_memory_usage via EngineResourceLimits::from_max_memory_bytes and feeds it into the SAME SR-46/47/48 pre-instantiate gate (check_declared_minimums) + runtime grow caps (set_runtime_max_pages/set_runtime_max_elements) the CLI --memory path uses, so a module with a manifest and NO CLI flag is bounded. Precedence: CLI + manifest combine via most_restrictive (min) — the operator cannot loosen the signed bound, the module cannot loosen the operator cap. The .unwrap_or(None) masking fallback and the foundation stub extractor are deleted; EngineBuilder::from_binary now selects ASIL mode from the manifest qualified level and fails loud on malformed manifests (it previously always yielded ASIL-D from the stub). NOT yet enforced: max_call_depth/fuel (EngineResourceLimits cannot express them; memory — the WCMC attack surface — is). Verified: manifest_memory_bound_enforced_without_cli_limits, manifest_bound_admits_fitting_module_and_caps_growth, manifest_tighter_than_cli_wins, cli_tighter_than_manifest_wins, malformed_manifest_section_fails_loud, builder_from_binary_fails_loud_on_malformed_manifest, builder_from_binary_selects_manifest_asil_level (kiln-runtime/tests/resource_limits_gate_tests.rs); test_extract_absent_section_is_none, test_extract_present_section_roundtrips, test_extract_malformed_section_is_error, test_extract_non_wasm_binary_is_error (kiln-decoder). --- The WCMC analysis (AD-WCMC-001) found the kiln.resource_limits section is decoded but NEVER APPLIED (capability_engine.rs:561 TODO). DEEPER FINDING this pass: the extraction fn (kiln-foundation/src/execution.rs:144) is ALSO a stub — returns a default and does NOT read the section (the parser from_bytes_with_provider in kiln-decoder/src/resource_limits_section.rs is never called). So SR-45 is a bigger cross-crate wire: (1) make extract scan+parse the section; (2) thread limits to instantiate; (3) apply max_memory_usage -> set_runtime_max_pages (SR-41), max_call_depth -> engine cap. This is the on-target enforcement point the embedded trust chain (AD-WCMC-001) depends on. Own feature loop. AD-WCMC-001. Issue #415.' tags: - kiln-runtime - resource-limits