Skip to content

fix(native): refuse inspect_signature on non-Mach-O targets - #2262

Merged
morluto merged 3 commits into
morluto:mainfrom
aznikline:fix/inspect-signature-non-macho
Oct 13, 2026
Merged

morluto merged 3 commits into
morluto:mainfrom
aznikline:fix/inspect-signature-non-macho

Conversation

@aznikline

Copy link
Copy Markdown

Summary

  • inspect_signature on a non-Mach-O container (e.g. a .pkg archive) ran codesign -d on the byte snapshot with no format gate. The codesign "code object is not signed" verdict cannot see a container-level signature layer (such as a xar pkg signature), so a signed or invalidly-signed package was reported as signed:false / "Artifact is not signed." — an unsigned claim for a layer that was never evaluated.
  • Add the same kind/isMachOFormat gate used by inspect_macho and list_architectures: non-Mach-O targets now return capability_unavailable with an explicit reason instead of a false unsigned result.
  • Add a boundary test asserting inspect_signature refuses pkg and elf targets without invoking codesign.

Test plan

  • tests/boundary/providers/native/nativeProvider.test.ts — 37/37 pass (vitest --maxWorkers=4)
  • Real-provider verification (macOS): rea inspect-signature python-3.13.9-macos11.pkg (Developer ID Installer-signed; pkgutil --check-signature = signed + notarized) → capability_unavailable with reason "its container-level signature layer is not evaluated by codesign" (previously signed:false)
  • Regression: rea inspect-signature /bin/ls → signed: true unchanged

Scope note

Reporting the signature layer itself (xar TOC <signature> parsing) is out of scope — this change only stops the false unsigned classification. A future inspect_signature on .pkg could evaluate the archive layer or report it as an explicit unknown.

Generated with Devin

This provider's signature inspection covers Mach-O code signatures only.
On a xar pkg, codesign's "code object is not signed" verdict cannot see
the archive-level signature layer, so a signed or invalidly-signed package
was reported as signed:false with "Artifact is not signed." Match the
existing inspect_macho/list_architectures gate and report
capability_unavailable instead of an unsigned claim for a layer that was
never evaluated.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
aznikline added a commit to aznikline/rea that referenced this pull request Oct 12, 2026
- Draft PRs: morluto#2262 (inspect_signature non-Mach-O gate, minimal
  cherry-pick onto d96550f with corrected comment) and morluto#2263 (WebMCP
  consequential fidelity + qualified prereq docs.
- Real signed-pkg control: python-3.13.9-macos11.pkg (Developer ID
  Installer-signed + notarized per pkgutil oracle) now yields honest
  capability_unavailable instead of signed:false; Mach-O regression intact.
- L3 content-egress prep design only: dedicated test user/VM options,
  proxy-delivered vs egressed distinction, no trust/proxy/pf/VPN changes.
- environment.md/branch-audit.md updated with new worktrees, SHAs, PRs.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
EOF
)
Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@morluto

morluto commented Oct 13, 2026

Copy link
Copy Markdown
Owner

@greptileai review

@greptile-apps

greptile-apps Bot commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

This PR is set for a Plus review. TREX isn't supported with Plus or Apex reviews yet, so Greptile reviews this PR at Base while TREX is on.

@greptile-apps

greptile-apps Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; discovery now matches the provider’s supported targets.

Summary

This PR stops native signature inspection from reporting non-Mach-O containers as unsigned when their signature layer was never checked.

  • Signature inspection only runs for Mach-O executables.

Reviews (3) · Last reviewed commit: "fix(native): align signature capability ..." · Reviewed by Greptile

Comment thread src/native/NativeMacOSProvider.ts Resolved
@morluto
morluto marked this pull request as ready for review October 13, 2026 11:48
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

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 ✅ Completed 2026-10-13T11:52:35.860566Z 64af56e 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 chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 64af56e826

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/native/NativeMacOSProvider.ts Resolved
Bind inspect_signature availability to Mach-O targets in capability discovery and align the public tool description.

Source inspection and git diff --check; tests/builds/typechecks/CI reruns skipped at explicit user request.
@morluto
morluto merged commit 5eb2966 into morluto:main Oct 13, 2026
32 checks passed
aznikline added a commit to aznikline/rea that referenced this pull request Oct 14, 2026
…morluto#2262

Per-thread verdicts, fix SHAs, validation scope, and thread states at
current remote heads; open bound-invocation P1s recorded as confirmed or
not-reproduced with counterexample evidence.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@morluto morluto added bug Something isn't working area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior labels Oct 14, 2026
aznikline added a commit to aznikline/rea that referenced this pull request Oct 15, 2026
…, and morluto#2465 call-site P1

Records the call-site member-read fix a13b935, the main merge 02ef51a (writeSite origin + [null] mutation encoding), the author-readiness human attestation requirement, and the morluto#2263 test-only follow-up draft PR morluto#3837.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants