Skip to content

fix(apple): keep unrooted extensionless Mach-O in IPA executables - #3300

Merged
morluto merged 1 commit into
morluto:mainfrom
Sriram-PR:fix/ipa-unrooted-macho-components
Oct 14, 2026
Merged

morluto merged 1 commit into
morluto:mainfrom
Sriram-PR:fix/ipa-unrooted-macho-components

Conversation

@Sriram-PR

Copy link
Copy Markdown
Contributor

Summary

For IPA inventories, project-apple-application-graph keeps components outside every application root, but an extensionless Mach-O there (for example SwiftSupport/HelperTool) was dropped from every component array and never paired with unrooted JavaScript. executables required application-root membership and native_libraries only matched .dylib/.so names, so the helper fit neither.

Fixes #3174

Problem and expected behavior

Smallest trigger: an IPA with SwiftSupport/HelperTool (Mach-O) and SwiftSupport/outside.js. docs/apple-application-analysis.md says IPA components outside every root stay in the component lists and their JavaScript/native candidates pair with other unrooted components. Expected: the helper is listed as a native component, stays unrooted, and forms the outside.js -> HelperTool candidate.

Change and scope

  • executables in classifyComponents now includes a Mach-O outside every root unless it is already a native library by name. Unrooted .dylib/.so images stay only in native_libraries, as the existing sidecar test expects.
  • Directory, ZIP and DMG projections are unchanged: their component list is already limited to application roots before classification, so the root check only ever mattered for IPA.
  • The .dylib/.so test is shared through a small isNativeLibrary helper so both arrays use the same rule.

Contribution scope: ordinary fix within existing boundaries; no scope decision needed.

Contract and boundary impact

  • Semantic owner and earliest changed stage: src/domain/apple/appleApplication.ts, component classification in the Apple projection.
  • Contribution scope fit and linked maintainer decision: not applicable (bug fix, [Bug] IPA projection omits extensionless Mach-O components outside application roots #3174).
  • CLI and MCP/tool-catalog contract: no schema change. IPA components.executables and bridge_candidates can now include unrooted extensionless Mach-O images.
  • Provider, bridge, target-format, or platform compatibility: IPA only; directory, ZIP and DMG unchanged.
  • Evidence, artifact, provenance, or reconstruction contract: affected projections gain the missing component and candidate, so their projection_id changes; component paths and hashes are reported as inventoried, and no application-root attribution is added.
  • Target selection, authority, upstream behavior, and cleanup details: not applicable.
  • Generated metadata, package, or installation impact: none.

Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added or updated: src/domain/apple/appleApplication.test.ts, an IPA with a rooted executable, SwiftSupport/HelperTool, SwiftSupport/iphoneos/libswiftCore.dylib and SwiftSupport/outside.js. It checks that executables holds the rooted executable and the helper (not the unrooted dylib) and that both unrooted native components pair with outside.js.
  • Base reproduction: the new test fails on the base revision because executables lacks the helper and the outside.js -> HelperTool candidate is missing. The existing sidecar test, which keeps unrooted dylibs out of executables, still passes.
  • User-visible CLI output: a real IPA (Mach-O bytes from a darwin/arm64 Go build) through inspect-artifact and project-apple-application-graph:
    base: executables ["Payload/Fixture.app/Fixture"]
          bridge      ["SwiftSupport/outside.js -> SwiftSupport/iphoneos/libswiftCore.dylib"]
    PR:   executables ["Payload/Fixture.app/Fixture", "SwiftSupport/HelperTool"]
          bridge      ["SwiftSupport/outside.js -> SwiftSupport/HelperTool",
                       "SwiftSupport/outside.js -> SwiftSupport/iphoneos/libswiftCore.dylib"]
    both: native_libraries ["SwiftSupport/iphoneos/libswiftCore.dylib"], coverage complete-within-inventory
    
  • Remaining proof gaps: ran on Linux x64 only; the projection is pure domain code.

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

  • npm run test:local -- src/domain/apple/appleApplication.test.ts — 20 passed (new test fails on the base revision)
  • npm run test:focused on the Apple/Android/Harmony projection boundary and acceptance tests (tests/boundary/filesystem/{appleApplication,android/application,harmony/application}.test.ts, tests/acceptance/applications/mobileFrameworkConventions.test.ts, tests/boundary/cli/jsonInputStatus.test.ts, ArtifactOccurrenceIdentity.test.ts) — 7 files, 93 passed
  • npm run check:fast — typecheck and lint passed
  • CLI comparison above, built with npm run build:cached on base and on this branch

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: not applicable; Linux x64, Node 24.18.0.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: none; classification only.

Author readiness

Human owner: @Sriram-PR

  • 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 the current revision ready for maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

IPA projections keep components outside every application root, but
executables required root membership and native_libraries matched only
.dylib/.so names, so an unrooted extensionless Mach-O such as
SwiftSupport/HelperTool was in neither list and formed no bridge
candidate. List unrooted Mach-O images under executables unless they
are already native libraries.

Fixes #3174
@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 14, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; the fix preserves root separation and existing library classification.

Summary

The PR keeps unrooted Mach-O images in IPA executables unless their names already place them in native_libraries.

  • IPA projections include unrooted extensionless Mach-O files as executables.

Reviews (1) · Last reviewed commit: "fix(apple): keep unrooted extensionless ..." · Reviewed by Greptile

@morluto
morluto merged commit ffeb2d4 into morluto:main Oct 14, 2026
28 of 30 checks passed
@Sriram-PR
Sriram-PR deleted the fix/ipa-unrooted-macho-components branch October 14, 2026 08:53
@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
@morluto

morluto commented Oct 20, 2026

Copy link
Copy Markdown
Owner

Thank you, @Sriram-PR, for catching the unrooted extensionless Mach-O case in IPA inventories. Recognizing helper tools such as SwiftSupport/HelperTool as executables keeps useful components from disappearing from the projected graph.

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.

[Bug] IPA projection omits extensionless Mach-O components outside application roots

2 participants