[GH-ISSUE #4586] [Bug] Ghidra seed commitment accepts a file that grows during its read #2380

Closed
opened 2026-10-17 21:03:57 +00:00 by bsakaguchi · 2 comments
Owner

Originally created by @morluto on GitHub (Oct 16, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/4586

Area

Provider or capability discovery

Observed behavior

At main 61e688070, a controlled real seed-file read returned a successful commitment even though the file grew after the reader's initial size/read. The additional seed was not included in the admitted commitment.

Reproduction

npm run test:focused -- tests/boundary/filesystem/ghidraProfileArtifactOwnership.test.ts: refuses seeds that grow beyond the admitted read extent failed (expected failed Result, received success). Fixture starts with 0x1000<TAB>code, performs the real first read, then replaces the file contents with two valid seed rows before read completion. No Ghidra engine or seed application was executed.

Expected behavior

Reject a seed file that changes during commitment reading, preserving uncertainty rather than committing an unexamined prefix. AGENTS.md requires preserved source identity and bounded format-aware reads. The neighboring extension reader already checks one extra byte for growth.

Impact and scope

Observed once in a deterministic real-file control. The later launch reread may detect digest disagreement; no claim that additional seeds execute or bypass the launch digest check. Real concurrent-writer incidence, native Ghidra execution and Windows behavior are NOT_ENOUGH_INFO.

REA version

Main 61e688070f48016b6d178cd04c02fcc2f33e19ad, 6.5.0.

Runtime and platform

Pinned Node24.18.0/npm11.16.0; Darwin arm64.

Target and artifact context

Disposable synthetic seed TSV with one row, grown to two rows during read; no target execution.

Interface

Provider boundary

Earliest failure stage

Provider profile resolution

Relevant output or evidence

src/ghidra/GhidraAnalysisSeeds.ts:135: allocate initial stat size, read exactly that extent and return without checking EOF or metadata afterward. Controlled test: expected false, received true. Evidence provenance: observed controlled filesystem race; consumer impact source-derived.

Typed outcome or recovery expected

Failed profile resolution with changed-artifact reason; stable seed commitments and canonical digest semantics continue to work.

Analysis or suspected cause

The owning reader never checks whether its initial extent still describes the selected file after reading. Proposed shared bounded owned reader checks an extra byte and descriptor metadata.

Additional context

Related #4584 tracks lost primary/cleanup ownership in these readers; this is distinct read-extent validation. #4483 concerns other artifact readback consumers. No real-provider or production reproduction claimed.

Originally created by @morluto on GitHub (Oct 16, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/4586 ### Area Provider or capability discovery ### Observed behavior At main `61e688070`, a controlled real seed-file read returned a successful commitment even though the file grew after the reader's initial size/read. The additional seed was not included in the admitted commitment. ### Reproduction `npm run test:focused -- tests/boundary/filesystem/ghidraProfileArtifactOwnership.test.ts`: `refuses seeds that grow beyond the admitted read extent` failed (expected failed Result, received success). Fixture starts with `0x1000<TAB>code`, performs the real first read, then replaces the file contents with two valid seed rows before read completion. No Ghidra engine or seed application was executed. ### Expected behavior Reject a seed file that changes during commitment reading, preserving uncertainty rather than committing an unexamined prefix. AGENTS.md requires preserved source identity and bounded format-aware reads. The neighboring extension reader already checks one extra byte for growth. ### Impact and scope Observed once in a deterministic real-file control. The later launch reread may detect digest disagreement; no claim that additional seeds execute or bypass the launch digest check. Real concurrent-writer incidence, native Ghidra execution and Windows behavior are NOT_ENOUGH_INFO. ### REA version Main `61e688070f48016b6d178cd04c02fcc2f33e19ad`, 6.5.0. ### Runtime and platform Pinned Node24.18.0/npm11.16.0; Darwin arm64. ### Target and artifact context Disposable synthetic seed TSV with one row, grown to two rows during read; no target execution. ### Interface Provider boundary ### Earliest failure stage Provider profile resolution ### Relevant output or evidence `src/ghidra/GhidraAnalysisSeeds.ts:135`: allocate initial stat size, read exactly that extent and return without checking EOF or metadata afterward. Controlled test: expected false, received true. Evidence provenance: observed controlled filesystem race; consumer impact source-derived. ### Typed outcome or recovery expected Failed profile resolution with changed-artifact reason; stable seed commitments and canonical digest semantics continue to work. ### Analysis or suspected cause The owning reader never checks whether its initial extent still describes the selected file after reading. Proposed shared bounded owned reader checks an extra byte and descriptor metadata. ### Additional context Related #4584 tracks lost primary/cleanup ownership in these readers; this is distinct read-extent validation. #4483 concerns other artifact readback consumers. No real-provider or production reproduction claimed.
Author
Owner

@nikhilsaxena04 commented on GitHub (Oct 16, 2026):

Opened PR #4596 addressing this issue by verifying trailing bytes and checking post-read metadata consistency in readSeedFile.

<!-- gh-comment-id:6224781925 --> @nikhilsaxena04 commented on GitHub (Oct 16, 2026): Opened PR #4596 addressing this issue by verifying trailing bytes and checking post-read metadata consistency in `readSeedFile`.
Author
Owner

@morluto commented on GitHub (Oct 18, 2026):

Closing as fixed on main after reconciling this report with the landed owner/consumer changes.

  • f9ccacca2: fix(ghidra): own configured profile artifact lifetimes.

Evidence scope: this closure uses the landed source, regression coverage and validation already recorded in the linked commits/thread. No new local tests or native-provider reproduction were run during this backlog pass; previously documented platform and real-provider gaps still apply.

<!-- gh-comment-id:6256001321 --> @morluto commented on GitHub (Oct 18, 2026): <!-- rea-backlog-reconciliation-2026-10-19-4586 --> Closing as fixed on `main` after reconciling this report with the landed owner/consumer changes. - [f9ccacca2](https://github.com/morluto/rea/commit/f9ccacca2cbf7c7f1c338cddd19160fc0a778074): fix(ghidra): own configured profile artifact lifetimes. Evidence scope: this closure uses the landed source, regression coverage and validation already recorded in the linked commits/thread. No new local tests or native-provider reproduction were run during this backlog pass; previously documented platform and real-provider gaps still apply.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#2380
No description provided.