fix(native): require Apple origin for platform facets and keep cancellation

- Treat a CodeDirectory platform identifier as a platform binary only when
  the signature satisfies `anchor apple`, checked with
  `codesign --verify -R="anchor apple"`; otherwise the dependent facets are
  unknown. Developer ID code chains to Apple Root CA but fails this check.
- Report every security facet as unknown when architecture slices differ in
  signing state.
- Map an aborted signal that escapes a native helper, such as ticket
  hashing, to AnalysisCancelledError instead of an output error.
- Treat a target as an app bundle only when it was opened from a bundle
  directory, so a regular file named X.app is verified as a bare Mach-O.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kaoru0822
2026-10-07 12:43:47 +00:00
co-authored by Claude Opus 5.5
parent 73eb20a4b9
commit ce8e969112
9 changed files with 295 additions and 46 deletions
+7 -1
View File
@@ -33,7 +33,13 @@ explicit limitation; architecture inventory locations remain available.
- executable-memory policy;
- App Sandbox.
System Integrity Protection, AMFI and setuid policy are not evaluated.
A CodeDirectory platform identifier counts as a platform binary only
when the signature also satisfies `anchor apple` (Apple's own code;
`codesign --verify -R="anchor apple"`). Otherwise the facets that depend
on it are `unknown`. A universal file whose slices differ in signing
state reports every facet as `unknown`, because no one CodeDirectory
describes the process. System Integrity Protection, AMFI and setuid
policy are not evaluated.
- `inspect_asset_catalog` / `rea inspect-asset-catalog <app>` reads compiled
`Assets.car` metadata through macOS `assetutil --info`. Catalog digests, raw
rendition fields, pagination and exact UI resource-name matches are returned.
+1 -1
View File
@@ -86,7 +86,7 @@ copies of a clang-built fixture with real `codesign`: ad hoc, hardened
runtime, hardened runtime with relaxing entitlements, and `library,restrict`
flags. It checks that `inspect-signature` decodes those flags and derives the
expected security facets. It also checks a platform binary, which must report a
platform identifier, and bundles with an added unsealed file, at the top level
platform identifier and pass the `anchor apple` origin check, and bundles with an added unsealed file, at the top level
and inside a nested XPC service, which must fail deep strict verification. CLI and stdio MCP results must match.
`verify:macos-bundle` needs only macOS with Command Line Tools. It compiles a
source-owned app with `clang`: a versioned framework, XPC services, an app