fix(safety): close the 3 high-severity findings (wire-safe)#15
Merged
Conversation
bulk.rs decode: add a cumulative allocation budget so overlapping/duplicate column data offsets can't declare more total payload than the input holds (was a memory-amplification / OOM vector from a tiny hostile block).
safety.rs CommandWatchdog: bound the enforced ttl — a non-finite (+Inf) ttl_ms made the deadline never fire (fail-OPEN); now non-finite -> immediately stale and large values clamp to a finite ceiling (wire ttl_ms unchanged).
safety.rs geofence: an empty position vector read as r=0 ('at the origin', inside any fence), silently bypassing the geofence; now fails closed to HOLD like an absent channel.
All wire-safe (no contract change). Adds 3 regression tests; ncp-core suite 102 passing; rustfmt-1.88 + clippy -D warnings clean. From KNOWN_LIMITATIONS.md (the 3 HIGH items).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the 3 high-severity items from KNOWN_LIMITATIONS.md. All wire-safe (no on-wire contract change), so safe for Engram/crebain/prisoma. +3 regression tests;
ncp-coresuite 102 passing; rustfmt-1.88 +clippy -D warningsclean.n_rows). Test:decode_rejects_amplifying_overlap.+Inf)ttl_msmade(now-t) > ttlnever true → watchdog never fired. Now non-finite → immediately stale; large values clamp to a finite ceiling (MAX_TTL_MS). Wirettl_msunchanged. Test:unbounded_or_nonfinite_ttl_still_expires.r=0(origin, inside any fence). Now fails closed to HOLD like an absent channel. Test:empty_position_holds_under_geofence.