fix(domain): security audit follow-ups — deserialise JSON by reference, literal delete paths in the wasm build
The security gate (PASS, 0 blocking) reported LOW items: an imported attachment's Value was copied for the wrapper and the snapshot gate (a hostile 16 MiB attachment multiplied linear memory), and wasm-build.sh deleted its outputs through a variable. Every JSON input is now read with T::deserialize(&Value) (same errors, no copy); one deserialiser instead of two also shrinks the shipped module from 1,180,281 to 1,046,498 bytes raw (372,132 → 340,929 gzip). The two outputs are removed on their literal paths. RUST.md records the numbers, the quarantine retention and the base-image tag residual.
This commit is contained in:
1 parent
8e8c58efca
commit
e49009e363
10 files changed
+39
-29
No files matched your search
@@ -68,7 +68,7 @@ fn unknown(op: &str) -> Failure {
|
||||
/// Parses the JSON text of an operation input into its contract type.
|
||||
pub(crate) fn parse_input<T: DeserializeOwned>(input: &str) -> Result<T, Failure> {
|
||||
let value = parse_json(input).map_err(|error| Failure::new("invalid_json", error))?;
|
||||
serde_json::from_value(value).map_err(|error| Failure::new("invalid_shape", error))
|
||||
T::deserialize(&value).map_err(|error| Failure::new("invalid_shape", error))
|
||||
}
|
||||
|
||||
pub(crate) fn to_value<T: Serialize>(value: &T) -> Outcome {
|
||||
|
||||
Reference in new issue
Block a user