Repository navigation
Description
What
Seven places where arithmetic on a value read from the file can overflow, so a crafted file can panic a reader. Each was found by an audit of the parsing paths, confirmed by a second reader, and re-read against main (1a9aacc7).
Two panic in every 32-bit build, including the wasm32 viewer, whose release build has no overflow checks:
src/research/native_index.rs:548,parse:episodes.len().checked_sub(creation_episode as usize + 1), withcreation_episodeau32fromGlobal/ElemTable. At0xFFFF_FFFFthe+ 1wraps to 0 on a 32-bit target, thechecked_subpasses, andepisodes[reverse]indexes past the end. With overflow checks the add panics first. Every native read reaches it (native_preamble).src/research/native_walls.rs:105,shell_widths:exterior + interior, two shell-layer counts from aCompoundStructure. On a 32-bit target two large counts wrap, the length check passes, andwidths[..exterior]slices past the end. 64-bit is safe: no decoded count exceedsi64::MAX.
Three panic only where overflow checks are on (debug builds, CI's i686 job), on every target. A release build wraps:
src/research/native_index.rs:135,decode_increment_rows:greatest_episode + 1atm_greatest.m_id = i64::MAX. Release wraps toi64::MIN, whichu64::try_fromrefuses.src/research/native_stairs.rs:569,native_stair_counts:top - baseof aStairsRun's riser indices, ati64::MAXandi64::MIN. Release wraps to -1 risers, which the export would write as the run's riser count.src/research/native_stairs.rs:1022,railing_records: the same subtraction. Release wraps to -1, and the railing gets no length.
Two more panic on 32-bit targets only with overflow checks. Without them they wrap: 6 reads its number from the wrong offset, and 7 misjudges the encoding.
src/research/partition_mep_systems.rs:83,circuit_number:list + 4 + count * 32, withcountau32from an electrical system's object. The multiply is checked but the add is not. It is on the default export path for 2024 and later (attach_mep_systems).src/transmission_data.rs:152,looks_like_utf16_le:ascii_nul * 100, for aTransmissionDatastream of 85,899,346 bytes or more, under the 256 MiB stream cap. Nothing in the repository calls it (probe_transmission_datais public API).
Done when
- Each is a checked operation that refuses the value on every target.
- Every export of a real file is byte for byte as before: one unfiltered Measure (samples, Nordic, Revit 2025, held-out) against
main.
None has a repro. Each needs a crafted schema and object graph to reach it through the public reader, which is out of proportion to a one-line checked operation. Each was verified by reading.
Found by Tendrils audit workers (DeepSeek), checked by a second worker each, and re-read by rvtDevelop.
Activity
chore(release): prepare v0.20.0 (#1869)
fix(research): arithmetic on a stored creation episode, shell-layer c…