Skip to content

fix(target): decode app Info.plist executables with an XML parser - #857

Merged
kaoru0822-kitauji merged 1 commit into
mainfrom
fix/app-xml-plist-executable
Oct 7, 2026
Merged

kaoru0822-kitauji merged 1 commit into
mainfrom
fix/app-xml-plist-executable

Conversation

@kaoru0822-kitauji

Copy link
Copy Markdown
Collaborator

Summary

A macOS .app target resolves to Contents/MacOS/<CFBundleExecutable>. For XML Info.plist files, BinaryTargetResolver read that value with a regular expression and a hand-written entity decoder. Several valid plists therefore resolved to the wrong name, and inspect-macho, list-architectures, and session open reported app program file is missing:

Info.plist content Native plutil -extract CFBundleExecutable raw REA on main
<string>a&amp;lt;b</string> a&lt;b decodes twice to a<b → missing
<string>a&#32;b</string> a b numeric reference left undecoded → missing
<string><![CDATA[a&b]]></string> a&b no match → "no readable CFBundleExecutable"
commented-out <key>CFBundleExecutable</key><string>Old</string> before the real key App picks Old
a nested dict with its own CFBundleExecutable before the top-level key top-level value picks the nested value

Fix

XML plists are decoded with the plist package, which InterfaceBuilderAnalysis already uses in the application layer. The resolver reads the top-level dictionary's CFBundleExecutable string. Binary plists still use native plutil -n, unchanged. The existing name-safety and Contents/MacOS containment checks are unchanged. An empty <string/> is now rejected as an unsafe name instead of an unreadable key.

This only affects file resolution. Nothing is executed, and there is no provider claim. The whitespace cases from #765 were already handled on main and remain covered.

Verification

  • New regressions in tests/boundary/filesystem/binaryTarget.test.ts cover entity, numeric-reference, CDATA, and commented/nested key cases. 4 fail on main and pass here. The existing whitespace, unsafe-name, symlink-escape, and binary-plist tests still pass (21/21).
  • Real CLI check on macOS arm64: Clang-compiled programs in three .app bundles (a&amp;lt;b, a&#32;b, and a commented key). node scripts/rea.mjs inspect-macho X.app reported app program file is missing for all three on main. With this change it resolves Contents/MacOS/a&lt;b, a b, and App and reports arm64.
  • npm run check:changed: 18 files / 144 tests passed. npm run check:fast passed.
  • tests/composition/analysis-sessions/appleApplication.test.ts and tests/boundary/providers/native/nativeProvider.test.ts passed. In interfaceBuilderBundle.test.ts, the Xcode-compiled storyboard case fails locally on both main and this branch, because ibtool requires full Xcode and this host has only Command Line Tools.

No Hopper/Ghidra/IDA verification is needed (target path resolution only).

🤖 Generated with Claude Code

The pattern-based reader decoded entities twice, ignored numeric
character references and CDATA, and could match a commented or nested
CFBundleExecutable key, so valid app bundles reported a missing program.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 7, 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-07T04:43:30.308183Z c182f72 PR opened
ℹ️ 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.

@kaoru0822-kitauji
kaoru0822-kitauji merged commit c57f1b7 into main Oct 7, 2026
19 checks passed
@kaoru0822-kitauji
kaoru0822-kitauji deleted the fix/app-xml-plist-executable branch October 7, 2026 05:04
darsrc pushed a commit to darsrc/rea that referenced this pull request Oct 10, 2026
fix(target): decode app Info.plist executables with an XML parser
@morluto morluto added the bug Something isn't working label Oct 14, 2026
@morluto morluto added the area: providers Provider and capability discovery, including provider proposal triage label Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: providers Provider and capability discovery, including provider proposal triage bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants