Repository navigation
base red: the moved-acpmux peer test accepts Apple's expired clang leaf being refused before the OU rule - #29362
Conversation
…ill passes after it expires (red) acpmux_peer_moved fails on every fleet host since 2026-10-24 (5 of 5 runs at feat 038bf00, aws-m4pro-3, -4, -6, -8, macOS 26 and 27): the peer check evaluates the CMS signer's certificate chain as of now, so it refuses any binary whose signing certificate expired after it was signed (CSSMERR_TP_CERT_EXPIRED for Xcode's clang). Security's code signing checks a chain as of the signature's own time (its secure timestamp, else its signing time). This commit adds the seam code_signature::verify_at(signature, ours, now) (verify is verify_at as of SystemTime::now()), and checks the CMS signature first and then its chain as of now, which is the old behavior. The tests: - moved_peer_signed_while_its_certificate_was_valid_passes_after_it_expires: the nightly fixture (leaf expires 2031-04-16, signed and time-stamped 2026-10-21) as of 2031-06-01 must pass; it fails here. - moved_peer_a_signature_from_after_now_is_refused: as of 2026-01-01 (before the leaf was issued) it is refused, and the later signing time is never used (a guard; it passes before and after the fix).
…s of the signature's own time once its certificate has expired The moved-acpmux peer check evaluated the CMS signer's certificate chain as of now, so a peer signed while its certificate was valid was refused once that certificate expired: our own acpmux after its Developer ID certificate expires, and Xcode's clang on every fleet host today (CSSMERR_TP_CERT_EXPIRED, acpmux_peer_moved red 5 of 5 at feat 038bf00). As Security's code signing does, a chain that does not verify as of now is checked again as of the signature's own time: its secure timestamp (a time-stamping authority's signed time) when it has one, else the signing time the signer signed. A time after now is never used, and a signature with no time keeps the refusal. Every other rule (cdhash, team ID, identifier, Apple Root CA anchor, the leaf's OU) is unchanged.
A chain that does not verify now says whether the signature had no secure timestamp or signing time, was dated after now, or also failed as of its own time. The green run at 80807ce (step 56b55177172b414957392c9b) still refused Xcode's clang with certificate result -67818 (errSecCertificateExpired) and did not say why; this names the case.
…gnature rule refusing Apple's clang The diagnostic run at 043330a (step fe6ee97b8e6583951437f90c) shows why Xcode's clang is still refused: "its CMS signature's certificate chain does not verify as of now, and the signature has no secure timestamp or signing time (certificate result -67818)". Apple signs clang with no time, so once Apple's leaf expired (Xcode 26.6's did on 2026-10-24) there is no time to check its chain at, and the chain rule refuses before the OU rule the test expected. The test's purpose is unchanged and still checked: a peer whose executable is gone has its kernel signature read and goes through the signature rules (not the unknown-executable refusal), and is refused. It now accepts either signature rule as the one that refuses Apple's clang. The OU rule itself stays covered by the fixture tests. The peer check is not loosened: an expired chain with no secure timestamp or signing time is still refused, unlike Security's default for code.
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) Review App of this head (app.zip, kept 1 day)
Shipped in:
|
|
Review (claude-opus independent reviewer): FIX at 82f51bd Read only. I read the diff, the PR body and Apple's open-source Security ( Findings
To ship
If the base red must go first, the test change alone ( |
…test changes (review FIX) The security review of 82f51bd (FIX) is right. The base check calls CMSDecoderCopySignerStatus with trust evaluation on, and Security already evaluates the chain as of the signature's secure timestamp, else its signing time, else now. The red recorded for this PR came from its own seam, which checked the chain as of now; the base would accept our time-stamped acpmux after its certificate expires. The retry also added a fallback to a key holder's signing time with no Apple timestamp rule, which is looser than Security's code signing. So code_signature.rs is the base again, and the two verify_at tests go. The only real base red stays fixed: Apple signs Xcode's clang with no secure timestamp or signing time, so since its leaf expired (Xcode 26.6, 2026-10-24) Security refuses it as an invalid certificate (signer status 4) before the OU rule. The end-to-end test now accepts either signature rule, and still proves that a peer whose executable is gone has its kernel signature read and is refused by a signature rule.
|
Found 1 test failure on Blacksmith runners: Failure
|
|
Review (claude-opus independent reviewer): SHIP at 3afb061 Read only. I read the diff against the merge base, Findings
|
Bugbot needs on-demand usage enabledBugbot uses usage-based billing for this team and requires on-demand usage to be enabled. A team admin can enable on-demand usage in the Cursor dashboard. |
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)
Summary
Base red:
moved_peer_the_kernel_signature_of_a_peer_whose_executable_is_gone_is_read_and_checked(Native/OptChat/optchat-chief/tests/acpmux_peer_moved.rs) fails on every fleet host. It failed 5 of 5 at feat 038bf00, on aws-m4pro-3 and -4 (macOS 27) and on -6 and -8 (macOS 26), withits CMS signature does not verify (signer status 4, certificate result -2147409654)(CSSMERR_TP_CERT_EXPIRED).Cause: the test uses Xcode's clang as a stand-in peer. Apple signs clang with its own leaf, and with no secure timestamp and no signing time. While that leaf was valid, the chain verified and the leaf-OU rule refused clang, which the test expected. Apple's leaf for Xcode 26.6's clang expired on 2026-10-24. Security now has no time but now to check the chain at, and it refuses the signer as an invalid certificate (signer status 4) before the OU rule runs.
The product code does not change. The base check calls
CMSDecoderCopySignerStatuswith trust evaluation on, so Security checks the chain as of the signature's secure timestamp, else its signing time, else now (read in Apple's open-source Security code, not tested here).The test now accepts either signature rule as the one that refuses clang. It still proves its purpose: the kernel signature of a peer whose executable is gone is read, the peer goes through the signature rules (not the unknown-executable refusal), and it is refused.
Takes back an earlier version of this PR. Its first commits added a check of the chain as of now plus a retry at the signing time. The security review (FIX at 82f51bd) showed that this was wrong. The base already uses the signature's own time, so the red I recorded came from that version's own seam. The retry was also looser than Security's code signing: it fell back to the key holder's signing time with no Apple timestamp rule. Those commits are taken back in 3afb061.
Coverage gap (said plainly): with Xcode 26.6 on the fleet, no test reaches the leaf-OU refusal now. The fixture tests stop at the CodeDirectory team rule, which runs first. A fixture of a valid Apple-signed binary's kernel signature would bring it back. That is a follow-up (owner: me), not done here.
Testing
Focused command (fleet, macOS):
32985ab9,3cfdf956,367d52bc,aa89890f,7d878a1d) fail at the old assertion with the message above.aa62cbd64274581bed28c121(aws-m4pro-6): all 7moved_peertests pass, including the end-to-end clang test; clippy and fmt pass.Observed / Not run
Observed:
prepush-gate.pyfound no new violations. Against the branch base, the PR changes onlytests/acpmux_peer_moved.rs.Not run: no test of the leaf-OU rule (see the coverage gap above). No test shows that our time-stamped acpmux still passes after its certificate expires; that comes from reading the base code, as above.
Changelog
none