Skip to content

fix(ghidra): reject byte matches outside searched coverage - #4531

Merged
morluto merged 10 commits into
morluto:mainfrom
ShuaixinHuang:codex/fix-byte-search-coverage
Oct 17, 2026
Merged

morluto merged 10 commits into
morluto:mainfrom
ShuaixinHuang:codex/fix-byte-search-coverage

Conversation

@ShuaixinHuang

@ShuaixinHuang ShuaixinHuang commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Problem and outcome

Byte-search output could report a match outside searched blocks, in skipped memory, in another address space, or at a malformed address, yet become successful Evidence through MCP.

Validate each match against reported searched intervals in the same segment and address space. Parse interval coordinates once per page and reject contradictory provider pages before creating Evidence.

Validation

Head 6352f4b, normally merged fixed upstream 5b24399. The net diff contains only the three byte-search files.

  • Focused tests: 61 passed / 1 Windows socket-fixture failure. bytePattern 14/14, GhidraInventoryValues 11/11, Java probe source 20/20, Java probe boundary 9/9, and production JEB CLI/MCP acceptance 2/2 passed; MCP inventory controls passed 5/6.
  • The unchanged socket fixture fails before analysis because /tmp is not an absolute local NTFS drive path on Windows. No test guard or skip was changed; the current-head Linux CI subsequently passed all 6 MCP inventory cases, including the socket/pagination/skipped-coverage case (833.989 ms).
  • Controls cover malformed/out-of-range/skipped-memory/wrong-space/wrong-segment refusals and inclusive boundary acceptance in default and matching overlay spaces. Invalid pages produce unreadable_output without successful structured Evidence.
  • npm run check: 6/6 tasks plus architecture guards passed. git diff --check passed. Original bytePattern baseline: 3 failed / 9 passed.

Pinned Node 24.18.0/npm 11.16.0, Windows x64. Java boundary tests use controlled Node prerequisite processes; provider output is simulated. No real Ghidra/JVM execution or performance claim. No related cleanup remains.
Current-head CI: CI required and all five shards passed, with no failed executed check. Greptile passed, and no unresolved review threads remain. The independent PR readiness status is absent because that repository workflow is disabled_manually; the human declarations below remain filled.

Author readiness

Human owner: @ShuaixinHuang

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

@ShuaixinHuang
ShuaixinHuang marked this pull request as ready for review October 17, 2026 05:29
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-17T05:29:55.804501Z a4f7a82 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@greptile-apps

greptile-apps Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The reviewed changes appear safe to merge.

Summary

This PR rejects byte-search matches outside the reported searched coverage.

  • Byte-search matches must belong to reported searched memory.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Ghidra byte-search page] --> B[Shared output checks]
  B --> C{Every match inside searched coverage?}
  C -->|Yes| D[Create Evidence]
  C -->|No| E[Return unreadable_output]
Loading

Reviews (2) · Last reviewed commit: "Merge commit '5b243993872c2bcc70cb00060f..." · Reviewed by Greptile

…x-byte-search-coverage

# Conflicts:
#	tests/acceptance/providers/jebConfigurationIsolation.test.ts

@baron baron left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed unchanged head 6352f4baec026161f10d59c5d136d5f0192b4228.

The shared result schema now rejects match coordinates outside examined coverage before they can become successful Evidence, retaining segment/address-space identity and inclusive endpoints. I checked the Ghidra producer/parser and MCP consumer, including existing pagination and cancellation handling; no blocking finding.

Current repository CI is green, including CI required; unrelated lanes are skipped. Human readiness declarations are filled. Validation here was source/CI review, not an independent local test run (the pinned toolchain and locked dependencies were unavailable, and no dependencies/providers were installed). Author-reported simulated-provider coverage is not real-Ghidra verification. No merge performed.

@morluto
morluto merged commit a040533 into morluto:main Oct 17, 2026
35 checks passed
@morluto morluto added bug Something isn't working provider: ghidra Analysis provider / engine: ghidra labels Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working provider: ghidra Analysis provider / engine: ghidra

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants