Repository navigation
Peer signature check requires the hardened runtime and refuses injection entitlements - #4384
Merged
Merged
Conversation
Contributor
Author
|
Review fixes (new commit):
|
Contributor
Author
|
Second review round: kernel flags now come from csops_audittoken (a pid reuse or exec yields no status, tested by bumping the token's pid version); CS_VALID is required and CS_DEBUGGED refused (has_debugger_attached beside the daemon's own check); the CF mapping is a separate function with tests for the raw-blob, non-dictionary and non-string-key refusals and a key with value false; a dead peer is refused. A comment notes entitlements come from the static code behind the guest while runtime flags are live. Mutation checks: pid-only/null-token csops, valid check, debugger check and the three mapping branches each fail a test. Not verified: a real pid-reuse race. |
…ion entitlements A peer that satisfies the team requirement must also carry the hardened-runtime signing flag and neither get-task-allow nor allow-dyld-environment-variables. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ntitlements, refuses disable-library-validation Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ger or an invalid signature Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
mstomar125
force-pushed
the
issue-4377-peer-hardened-runtime
branch
from
November 26, 2026 09:51
79ac20e to
5b84f0e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The peer code-signature check (stage 5 of remote tool approval) verified the Developer ID chain, team and identifier but not that the peer runs hardened. A team-signed build without
--options runtime, or one carryingget-task-alloworallow-dyld-environment-variables, passed and could be injected by a same-user attacker.Change
packages/daemon/src/peer_signature.rs: after the requirement holds,check_hardenedreads the peer's signing information (SecCodeCopySigningInformation, flags and entitlements dict) and refuses unlessCS_RUNTIMEis set and neither injection entitlement is present. NewRefusal::NotHardened. Fails closed (unreadable info is a refusal). Applies to both the app and thenodespacecommand scope.Tests (macOS)
Pure verdict tests, plus tests that re-sign a copy of
/usr/bin/ncad hoc under a test identifier (with/without runtime, with get-task-allow), connect it to a socket and judge its real audit token, including throughcheck_peer(requirement + hardening, the pathTeamSigned::allowsuses).Mutation checks (each reverted afterwards): removing the flag check fails
the_hardened_runtime_flag_is_requiredanda_peer_signed_without_the_hardened_runtime_is_refused; removing the entitlement check failsinjection_entitlements_are_refused_even_when_hardenedanda_hardened_peer_with_get_task_allow_is_refused; droppingcheck_hardenedfromcheck_peerfailsa_peer_signed_without_the_hardened_runtime_is_refused.Not verified
The positive case on a real Developer ID signed build (#4365, #4367) was not run here; only the ad hoc hardened positive case is covered. Security-sensitive change. The agent lane (packages/agent) sign-off applies to this batch; this PR does not touch it.
Closes #4377
🤖 Generated with Claude Code