fix(native): flag nested-code paths that codesign split on newlines

codesign prints one nested path per line, so a nested component whose name
contains a newline is split into fragments. inspect_signature now checks
that every --validated: path it reports exists, and names any that does not
in a limitation instead of trusting it as a complete path. The result stays
deterministic: codesign's progress lines arrive in no fixed order, so the raw
output is not echoed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kaoru0822
2026-10-07 13:05:23 +00:00
co-authored by Claude Opus 5.5
parent 4f46836178
commit 949ab427fb
4 changed files with 84 additions and 5 deletions
+10 -3
View File
@@ -58,6 +58,7 @@ import {
signatureVerification,
signedCodePath,
stapledTicket,
unconfirmedNestedCode,
} from "./NativeSignaturePosture.js";
import { deriveSecurityFacets } from "../domain/codeSigningPosture.js";
import { parseDemangledSymbols } from "./parsers/demangle.js";
@@ -396,6 +397,14 @@ class NativeMacOSClient implements AnalysisClient {
captures.push(...slices.value.captures);
limitations.push(...slices.value.limitations);
}
// Only the top-level signature decides "unsigned"; unsigned nested
// code inside a signed bundle makes the bundle invalid.
const verification = signatureVerification(
verify.value,
verifyPath,
unsigned,
);
limitations.push(...(await unconfirmedNestedCode(verification)));
const provenance = captures.map((capture) =>
invocation(capture, this.target.path),
);
@@ -403,9 +412,7 @@ class NativeMacOSClient implements AnalysisClient {
...parsed,
designated_requirement: requirementText,
entitlements: entitlementValue.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),
verification,
stapled_ticket: await stapledTicket(this.target, signal),
security_facets: deriveSecurityFacets({
signed: !unsigned,