test(parser): #174 Mythos sweep — section-range invariant guard (NO FINDINGS)#178
Conversation
Mythos delta-pass requiredThis PR modifies one or more Tier-5 source files (per Before merge, run the Mythos discover protocol on the
Why this gate exists: LS-A-10 The gate check on this PR will pass once the label is |
LS-N verification gate✅ 19/19 approved LS entries verified
Approved Failed LS entries(none) Missing regression tests(none) Updated automatically by |
Mythos delta-pass (auto)❌ 1 finding(s) across 1 Tier-5 file(s)
Auto-run via |
Mythos auto-runner finding — reviewed, dispositioned (not confirmed)The mythos-auto scan of The finding: Arithmetic — correct. Impact claim — rejected. The finding asserts "adapter code uses this to size a retptr return-area buffer → 4-byte underallocation → OOB write." That is a hallucination: Verdict: NOT a confirmed finding. Per Residual: the arithmetic is a latent correctness defect in a This PRPR #178's own change is the #174-Step-5 NO-FINDINGS regression guard ( Applying |
…INDINGS) Issue #174's v0.5 post-ship Mythos sweep carried an unverified hypothesis: parse_core_module stores reader.range() for the element and data sections (parser.rs:1279 / :1287), and parse_element_segments / parse_data_segments slice module.bytes[start..end] from those ranges with no explicit bounds check (segments.rs:198 / :258). The question was whether 1279/1287 are LS-P-5 siblings — i.e. whether wasmparser could yield a core-module section reader with a range past the buffer. Mythos delta-pass verdict: NO FINDINGS. Unlike Payload::ModuleSection — yielded eagerly with an explicitly unchecked range before the nested module is parsed, which is what made LS-P-5 exploitable — a core-module element/data section is only framed once parse_all has its full declared content. A truncated section (size LEB claiming more bytes than remain) makes parse_all yield an Err; parse_core_module's `payload?` propagates it and the *_section_range field is never set. The downstream slice is therefore defended by construction: every range that reaches it came from a section wasmparser successfully framed, and a framed section's range is in-bounds. Adds `truncated_core_section_errors_rather_than_yielding_oob_range`, which feeds truncated element- and data-section inputs and asserts wasmparser rejects each with an Err rather than handing back a section reader with an out-of-bounds range. This is the oracle for the NO FINDINGS verdict and a standing regression guard: a future wasmparser bump that changed the framing behaviour would fail this test and reopen the hypothesis. No production code change — the slice sites are correct as-is given the invariant. No LS-N entry (NO FINDINGS). Refs: #174 Step 5, LS-P-5. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
743f075 to
297df0d
Compare
Summary
Resolves Step 5 of issue #174 — the v0.5 post-ship Mythos sweep's outstanding unverified hypothesis.
Verdict: NO FINDINGS.
The hypothesis
parse_core_modulestoresreader.range()for the element and data sections intoelement_section_range/data_section_range(parser.rs:1279 / :1287).parse_element_segments/parse_data_segmentsthen slicemodule.bytes[start..end]from those ranges with no explicit bounds check (segments.rs:198 / :258). #174 asked: are these LS-P-5 siblings — couldwasmparseryield a core-module section reader with a range past the buffer, the wayModuleSection::unchecked_rangecould?Why it's NO FINDINGS
It cannot. The crux is the difference between
Payload::ModuleSectionand a core-module section:ModuleSectionis yielded eagerly with an explicitly unchecked range — the nested module isn't parsed yet. That's what made LS-P-5 exploitable.parse_allhas its full declared content. A truncated section — size LEB claiming more bytes than remain — makesparse_allyield anErr, whichparse_core_module'spayload?propagates. The*_section_rangefield is never set.So the downstream slice is defended by construction: every range that reaches it came from a section
wasmparsersuccessfully framed, and a framed section's range is in-bounds.The oracle
Per the Mythos protocol, a NO FINDINGS verdict still wants an oracle.
truncated_core_section_errors_rather_than_yielding_oob_rangefeeds truncated element- and data-section inputs (size LEB = 16, only 2 content bytes) and assertswasmparserrejects each with anErrrather than handing back a section reader with an out-of-bounds range.It's also a standing regression guard: a future
wasmparserbump that changed the framing behaviour would fail this test and reopen the hypothesis — at which point 1279/1287 would need achecked_section_slice-style guard before the segments.rs slice.Scope
parser.rs(Tier-5) — the Mythos auto-runner will scan it.Refs: #174 Step 5, LS-P-5.
🤖 Generated with Claude Code