From 83a66a23dc10cc58af490290fd32ee75ec878d01 Mon Sep 17 00:00:00 2001 From: bchanot Date: Sun, 18 Oct 2026 16:29:07 +0200 Subject: [PATCH] =?UTF-8?q?docs(docs):=20RUST.md=20=C2=A710.3=20records=20?= =?UTF-8?q?the=20R4.2=20security=20gate=20findings=20and=20the=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/development/RUST.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/development/RUST.md b/docs/development/RUST.md index 16ad2a7a..27ba077e 100644 --- a/docs/development/RUST.md +++ b/docs/development/RUST.md @@ -1154,6 +1154,7 @@ instance's growth, which never shrinks; "RSS" the Node process): | 16 MiB dense strings (5.6 M values) | attachment_stripped | 85 | 16.1 | 16.0 | | 16 MiB at depth 64 | attachment_stripped | 92 | 16.1 | 16.0 | | 16 MiB dense numbers as a rescue copy | invalid | 152 | 48.1 | 80.1 | +| 16 MiB at depth 65 as a rescue copy | invalid | 128 | 48.1 | 80.3 | | 16 MiB inflation (zeros, not JSON) | attachment_stripped | 14 | 31.3 | 31.0 | | 16 MiB + 1 inflation (bomb, refused) | attachment_stripped | 19 | 63.4 | 47.0 | | 32 bombs (17 MiB each) before the attachment | attachment_stripped | 181 | 63.9 | 47.5 | @@ -1178,6 +1179,18 @@ Residual risks and open points for the owner (R4.2 checkpoint): must be revisited, never the cap. - The Node numbers measure the module, not a browser: the browser run of the same classes (content-process RSS, worker terminated, GC) is in 10.4. +- Found by the independent security gate of R4.2 and fixed (593893a): the + value count stopped at the depth cap, so a rescue copy nested 65 deep hid + its 8 million values from the budget (792 MiB built, the cap-off figure). + The count now runs to the end whatever the depth verdict, and the budget + covers the archive text of `draft.restore` too. Reported, not blocking: + the TypeScript import path and `archive.import` carry no budget until + R4.3 replaces them (BLK-012, pre-existing); a 50 MiB file with 32 stream + heads walks its whitespace 32 times (783 ms against 269 ms, bounded by + `MAX_CANDIDATES`, as the TypeScript); the inflation buffer's capacity + reaches 2 × limit during its last growth (the 63 MiB row); the 50 MiB + size check runs after the glue copied the bytes, so the main thread's + pre-check must stay on the R4.3 worker path. - The probe parses the candidate twice (version check, then the session), as the TypeScript did; the peak is one tree since the first is dropped. A single parse would need the gated session reader to take a value.