fix(native): verify nested code and keep ticket read failures local
Address review findings in inspect_signature: - Verify with `codesign --verify --deep --strict`. Shallow verification misses a file added inside a nested XPC service, or a modified dylib inside a framework. verify:code-signature now tampers inside the nested XPC service and requires `invalid`. - Classify verification as `unsigned` only when the top-level target is unsigned. Unsigned nested code inside a signed bundle is `invalid`. - Report a stapled ticket that exists but cannot be read as `unreadable`, with the error code in a new `reason` field, instead of failing the whole signature inspection. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
25ca63f231
commit
37824e8c46
@@ -346,7 +346,8 @@ class NativeMacOSClient implements AnalysisClient {
|
||||
const verify = await this.#run(
|
||||
"inspect_signature",
|
||||
"codesign",
|
||||
["--verify", "--strict", "--verbose=2", verifyPath],
|
||||
// --deep verifies nested frameworks, helpers, extensions and XPC services.
|
||||
["--verify", "--deep", "--strict", "--verbose=2", verifyPath],
|
||||
{ signal, acceptNonZero: true },
|
||||
);
|
||||
if (!verify.ok) return verify;
|
||||
@@ -387,11 +388,9 @@ class NativeMacOSClient implements AnalysisClient {
|
||||
...parsed,
|
||||
designated_requirement: requirementText,
|
||||
entitlements: entitlementValue.value,
|
||||
verification: signatureVerification(
|
||||
verify.value,
|
||||
verifyPath,
|
||||
isNonzeroUnsignedObservation(verify.value),
|
||||
),
|
||||
// Only the top-level signature decides "unsigned"; unsigned nested
|
||||
// code inside a signed bundle makes the bundle invalid.
|
||||
verification: signatureVerification(verify.value, verifyPath, unsigned),
|
||||
stapled_ticket: await stapledTicket(this.target, signal),
|
||||
security_facets: deriveSecurityFacets({
|
||||
signed: !unsigned,
|
||||
|
||||
Reference in New Issue
Block a user